This page walks through techniques that can be used in Stripes to reduce the amount of configuration (usually in the form of annotation) that is necessary on a per-ActionBean basis.
URL Bindings and Event Names
...
Code Block | ||
---|---|---|
| ||
public class MyActionResolver extends NameBasedActionResolver { @Override public Set<String> getBasePackages() { return Literal.set("ui", "client"); } @Override public String getBindingSuffix() { return ".do"; /* ugh */ } } |
...
Now, if you created your own TypeConverter you could use it by attaching a single annotation to your property:
Code Block |
---|
@Validate(converter=MoneyTypeConverter.class)
private Money balance;
|
...
Code Block | ||
---|---|---|
| ||
public class CustomTypeConverterFactory extends DefaultTypeConverterFactory { public void init(Configuration configuration) { super.init(configuration); add(Money.class, MoneyTypeConverter.class); } } |
To see how to configure an alternate TypeConverterFactory take a look at the Configuration Reference.