NIHVIVO-1512 ReadOnlyBeansWrapper exposes getters and not setters, though the identification of a setter is only approximated.
This commit is contained in:
parent
ba11f54394
commit
655d92284c
3 changed files with 21 additions and 11 deletions
|
@ -27,11 +27,13 @@ public class ReadOnlyBeansWrapper extends BeansWrapper {
|
|||
@Override
|
||||
protected void finetuneMethodAppearance(Class cls, Method method, MethodAppearanceDecision decision) {
|
||||
|
||||
if ( method.getName().startsWith("set") ||
|
||||
method.getReturnType() == null ) {
|
||||
// How to define a setter? This is an approximation: a method whose name
|
||||
// starts with "set" or returns void.
|
||||
if ( method.getName().startsWith("set") ) {
|
||||
decision.setExposeMethodAs(null);
|
||||
}
|
||||
|
||||
} else if ( method.getReturnType().getName().equals("void") ) {
|
||||
decision.setExposeMethodAs(null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue