public void setPropertyElementType ( Class type , String propertyName , Class elementType ) { if ( type == null ) throw new IllegalArgumentException ( "type cannot be null." ) ; if ( propertyName == null ) throw new IllegalArgumentException ( "propertyName cannot be null." ) ; if ( elementType == null ) throw new IllegalArgumentException ( "propertyType cannot be null." ) ; Property property = Beans . getProperty ( type , propertyName , beanProperties , privateFields , this ) ; if ( property == null ) throw new IllegalArgumentException ( "The class " + type . getName ( ) + " does not have a property named: " + propertyName ) ; if ( ! Collection . class . isAssignableFrom ( property . getType ( ) ) && ! Map . class . isAssignableFrom ( property . getType ( ) ) ) { throw new IllegalArgumentException ( "The '" + propertyName + "' property on the " + type . getName ( ) + " class must be a Collection or Map: " + property . getType ( ) ) ; } propertyToElementType . put ( property , elementType ) ; }
Sets the default type of elements in a Collection or Map property . No tag will be output for elements of this type . This type will be used for each element if no tag is found .