|
|
@@ -50,31 +50,32 @@ public class RBeanModel implements BeanModel, Serializable {
|
|
|
fluentGet = new OpenMap<>();
|
|
|
fluentSet = new OpenMap<>();
|
|
|
|
|
|
- for(IMethod m : type.methods()) {
|
|
|
- if(m.parent().equals(IClass.OBJECT) && !OBJECT_METHODS.contains(m.name())) {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- if( isVGetter(m) ) {
|
|
|
- pinfo.get(MemberUtils.asPropertyName(m.name())).vgetter(m);
|
|
|
- }
|
|
|
- else if( isIGetter(m) ) {
|
|
|
- pinfo.get(MemberUtils.asPropertyName(m.name())).igetter(m);
|
|
|
- }
|
|
|
- else if( isVSetter(m) ) {
|
|
|
- pinfo.get(MemberUtils.asPropertyName(m.name())).vsetter(m);
|
|
|
- }
|
|
|
- else if( isISetter(m) ) {
|
|
|
- pinfo.get(MemberUtils.asPropertyName(m.name())).isetter(m);
|
|
|
- }
|
|
|
- else {
|
|
|
- minfo.put(m.name(), m);
|
|
|
- if(m.arguments().count() == 0 && !m.parent().equals(IClass.OBJECT)) {
|
|
|
- fluentGet.put(m.name(), new RBeanMethod(m));
|
|
|
+ // @todo better lazy initialization of the model
|
|
|
+ if(type.isPublic()) {
|
|
|
+ for (IMethod m : type.methods()) {
|
|
|
+ if (m.parent().equals(IClass.OBJECT) && !OBJECT_METHODS.contains(m.name())) {
|
|
|
+ continue;
|
|
|
}
|
|
|
|
|
|
- if(m.arguments().count() == 1 && !m.parent().equals(IClass.OBJECT) && (m.returns().isVoid() || m.returns().isSuper(m.parent())) ) {
|
|
|
- fluentSet.put(m.name(), new RBeanMethod(m));
|
|
|
+ if (isVGetter(m)) {
|
|
|
+ pinfo.get(MemberUtils.asPropertyName(m.name())).vgetter(m);
|
|
|
+ } else if (isIGetter(m)) {
|
|
|
+ pinfo.get(MemberUtils.asPropertyName(m.name())).igetter(m);
|
|
|
+ } else if (isVSetter(m)) {
|
|
|
+ pinfo.get(MemberUtils.asPropertyName(m.name())).vsetter(m);
|
|
|
+ } else if (isISetter(m)) {
|
|
|
+ pinfo.get(MemberUtils.asPropertyName(m.name())).isetter(m);
|
|
|
+ } else {
|
|
|
+ minfo.put(m.name(), m);
|
|
|
+ if (m.arguments().count() == 0 && !m.parent().equals(IClass.OBJECT)) {
|
|
|
+ fluentGet.put(m.name(), new RBeanMethod(m));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (m.arguments().count() == 1 && !m.parent().equals(IClass.OBJECT) && (m.returns().isVoid() || m
|
|
|
+ .returns()
|
|
|
+ .isSuper(m.parent()))) {
|
|
|
+ fluentSet.put(m.name(), new RBeanMethod(m));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|