=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ReflectionUtils.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ReflectionUtils.java 2014-02-13 05:51:55 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ReflectionUtils.java 2014-02-13 06:55:35 +0000 @@ -548,8 +548,6 @@ private boolean identifiableObject; - private Map objects; - private PropertyDescriptor( Method method ) { this.method = method; @@ -652,40 +650,16 @@ { this.identifiableObject = identifiableObject; } - - @JsonProperty - public Map getObjects() - { - return objects; - } - - public void setObjects( Map objects ) - { - this.objects = objects; - } } public static Map getJacksonClassMap( Class clazz ) { - return getJacksonClassMap( clazz, 2 ); - } - - public static Map getJacksonClassMap( Class clazz, int level ) - { // this short-circuits the level stuff for now, need to fix this properly if ( classMapCache.containsKey( clazz ) ) { return classMapCache.get( clazz ); } - boolean deep = false; - level--; - - if ( level > 0 ) - { - deep = true; - } - Map output = Maps.newLinkedHashMap(); List allMethods = getAllMethods( clazz ); @@ -726,7 +700,16 @@ if ( method.isAnnotationPresent( JacksonXmlProperty.class ) ) { JacksonXmlProperty jacksonXmlProperty = method.getAnnotation( JacksonXmlProperty.class ); - descriptor.setXmlName( jacksonXmlProperty.localName() ); + + if ( jacksonXmlProperty.localName().isEmpty() ) + { + descriptor.setXmlName( name ); + } + else + { + descriptor.setXmlName( jacksonXmlProperty.localName() ); + } + descriptor.setXmlAttribute( jacksonXmlProperty.isAttribute() ); } @@ -745,12 +728,6 @@ if ( IdentifiableObject.class.isAssignableFrom( returnType ) ) { descriptor.setIdentifiableObject( true ); - - if ( deep ) - { - Map classMap = getJacksonClassMap( returnType, level ); - descriptor.setObjects( classMap ); - } } else if ( Collection.class.isAssignableFrom( returnType ) ) { @@ -765,12 +742,6 @@ { descriptor.setCollection( true ); descriptor.setIdentifiableObject( true ); - - if ( deep ) - { - Map classMap = getJacksonClassMap( returnType, level ); - descriptor.setObjects( classMap ); - } } } }