Closed krzysiekbr closed 8 years ago
Yes, this is possible. You can implement your own version of ClassInfoStrategy or extend AbstractClassInfoStrategy overriding ClassInfoStrategy.getClassInfo(Class<?> pojoClass) and feed this strategy to a Podam factory.
Thanks for quick reaction. I wrote my own strategy implementation and it works like a charm.
Thank you for pointing this out. I've changed AbstractClassInfoStrategy implementation so it's a bit easier to override:
ClassInfoStrategy classInfoStrategy = new AbstractClassInfoStrategy() {
@Override
protected Pattern getGetterPattern() {
return Pattern.compile("^whatIs");
}
@Override
protected Pattern getSetterPattern() {
return Pattern.compile("^with");
}
};
PodamFactory factory = new PodamFactoryImpl();
factory.setClassStrategy(classInfoStrategy);
That makes everything much easier for me, thanks. When these changes can be released?
Now Podam 7.0.1 is released, it will appear at some point at Maven repository.
Most of classes I'm using in my project have setters starting with "with" keyword and returning "this". For now, if I understand it correctly, it's not possible for me to use Podam because it searches methods starting by "set" keyword and returning void (as per PodamUtils.java)
Is it possible to make Podam search for both of these method prefixes ("set" and "with") or make this prefix configurable?