public String getAsText ( ) { Object value = getValue ( ) ; if ( value == null ) { return "" ; } String propertyName = null ; // used in error handling below try { StringBuffer label = new StringBuffer ( ) ; for ( int i = 0 ; i < properties . length ; i ++ ) { propertyName = properties [ i ] ; Class < ? > propertyType = PropertyUtils . getPropertyType ( value , propertyName ) ; Object propertyValue = PropertyUtils . getNestedProperty ( value , propertyName ) ; PropertyEditor editor = registry . findCustomEditor ( propertyType , registryPropertyNamePrefix + propertyName ) ; if ( editor == null ) { label . append ( propertyValue ) ; } else { editor . setValue ( propertyValue ) ; label . append ( editor . getAsText ( ) ) ; editor . setValue ( null ) ; } if ( i < ( properties . length - 1 ) ) { label . append ( separator ) ; } } return label . toString ( ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( "Couldn't access " + propertyName + " of " + value . getClass ( ) . getName ( ) + " : " + e . getMessage ( ) , e ) ; } }
Format the Object as String of concatenated properties .