/** * Creates an object based on this description. * * @return The object. */ public Object createObject() { final String value = (String) getParameter( "value" ); if ( value == null ) { return null; } try { return valueConverter.toPropertyValue( value.trim() ); } catch ( BeanException e ) { return null; } }
/** * Parses a color entry. If the entry is in hexadecimal or octal notation, the color is created using Color.decode(). * If the string denotes a constant name of one of the color constants defined in java.awt.Color, this constant is * used. * <p/> * As fallback the supplied default value is returned if no color can be parsed. * * @param color * the color (as a string). * @param defaultValue * the default value (returned if no color can be parsed). * @return the paint. */ public static Color parseColor( final String color, final Color defaultValue ) { if ( color == null ) { return defaultValue; } try { // get color by hex or octal value return (Color) new ColorValueConverter().toPropertyValue( color ); } catch ( Exception nfe ) { return defaultValue; } }