private String getConfigPropertyName ( Annotation annotation ) throws ClassNotFoundException , NoSuchFieldException , NoSuchMethodException { if ( annotation . isOnField ( ) ) { return annotation . getMemberName ( ) ; } else if ( annotation . isOnMethod ( ) ) { String name = annotation . getMemberName ( ) ; if ( name . startsWith ( "set" ) ) { name = name . substring ( 3 ) ; } else if ( name . startsWith ( "get" ) ) { name = name . substring ( 3 ) ; } else if ( name . startsWith ( "is" ) ) { name = name . substring ( 2 ) ; } if ( name . length ( ) > 1 ) { return Character . toLowerCase ( name . charAt ( 0 ) ) + name . substring ( 1 ) ; } else { return Character . toString ( Character . toLowerCase ( name . charAt ( 0 ) ) ) ; } } throw new IllegalArgumentException ( bundle . unknownAnnotation ( annotation ) ) ; }
Get the config - property - name for an annotation