src/main/java/org/jboss/loom/utils/as7/AS7CliUtils.java
public static void copyProperties( Object source, CliApiCommandBuilder builder, String props ) {
        String[] parts = StringUtils.split( props );
        for( String prop : parts ) {
            try {
                Method method = source.getClass().getMethod( Property.Utils.convertPropToMethodName(prop) );
                if( String.class != method.getReturnType() )
                    continue;
                String val = (String) method.invoke(source);
                builder.addPropertyIfSet( prop, val );
            }
            catch ( NoSuchMethodException | InvocationTargetException | IllegalAccessException | IllegalArgumentException ex ){
                throw new RuntimeException( ex );
            }
        }
    }
/**
     *  Copies properties using reflection.
     * @param handler  From this object.
     * @param builder  Append to this CLI builder.
     * @param A list of properties, as a space separated string.
     */
Copies properties using reflection.
@param handler  From this object.
@param builder  Append to this CLI builder.
@param A list of properties, as a space separated string.
Copies properties using reflection . @param handler From this object . @param builder Append to this CLI builder . @param A list of properties as a space separated string .
public static void copyProperties( Object source, CliApiCommandBuilder builder, String props ) {
        String[] parts = StringUtils.split( props );
        for( String prop : parts ) {
            try {
                Method method = source.getClass().getMethod( Property.Utils.convertPropToMethodName(prop) );
                if( String.class != method.getReturnType() )
                    continue;
                String val = (String) method.invoke(source);
                builder.addPropertyIfSet( prop, val );
            }
            catch ( NoSuchMethodException | InvocationTargetException | IllegalAccessException | IllegalArgumentException ex ){
                throw new RuntimeException( ex );
            }
        }
    }
public static void copyProperties ( Object source , CliApiCommandBuilder builder , String props ) { String [ ] parts = StringUtils . split ( props ) ; for ( String prop : parts ) { try { Method method = source . getClass ( ) . getMethod ( Property . Utils . convertPropToMethodName ( prop ) ) ; if ( String . class != method . getReturnType ( ) ) continue ; String val = ( String ) method . invoke ( source ) ; builder . addPropertyIfSet ( prop , val ) ; } catch ( NoSuchMethodException | InvocationTargetException | IllegalAccessException | IllegalArgumentException ex ) { throw new RuntimeException ( ex ) ; } } }
Copies properties using reflection.
Copies properties using reflection .