[jboss-dev-forums] [Design of JBossXB] - Re: JBossXB does not assign schema defined attribute default
alesj
do-not-reply at jboss.com
Fri Jul 3 07:28:40 EDT 2009
"alex.loubyansky at jboss.com" wrote :
| The issue is actually with jboss-reflect. Apparently, propertyInfo.getUnderlyingAnnotation(annotationType) doesn't work for 'is'-methods (i.e. it returns null even if the method is annotated).
Nope, not a Reflect issue.
It's by the spec, that only primitive boolean' getter should be isX,
where as in this case - with Boolean - it should be getX.
| public class AbstractBeanInfoFactory implements BeanInfoFactory
| {
| /** The cache */
| protected Map<ClassLoader, Map<ClassInfo, Map<BeanAccessMode, BeanInfo>>> cache = new WeakHashMap<ClassLoader, Map<ClassInfo, Map<BeanAccessMode, BeanInfo>>>();
|
| protected static boolean isGetter(MethodInfo minfo)
| {
| String name = minfo.getName();
| TypeInfo returnType = minfo.getReturnType();
| TypeInfo[] parameters = minfo.getParameterTypes();
| if ((name.length() > 3 && name.startsWith("get")) || (name.length() > 2 && name.startsWith("is")))
| {
| // isBoolean() is not a getter for java.lang.Boolean
| if (name.startsWith("is") && PrimitiveInfo.BOOLEAN.equals(returnType) == false)
| return false;
| if (parameters.length == 0 && PrimitiveInfo.VOID.equals(returnType) == false)
| return true;
| }
| return false;
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241699#4241699
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241699
More information about the jboss-dev-forums
mailing list