public static boolean isValid(final String cssValue) {

        final String trimmedCssValue = TagStringUtil
                .toLowerCase(StringUtil.strip(cssValue));

        if (StringUtil.containsSpace(trimmedCssValue)) {
            return false;
        }

        for (final CssLengthUnit cssLengthUnit : CssLengthUnit.values()) {
            final String unit = cssLengthUnit.getUnit();
            if (trimmedCssValue.endsWith(unit)) {
                final String valueOnly = trimmedCssValue.replaceFirst(unit, "");
                try {
                    // it could be negative
                    Float.parseFloat(valueOnly);
                } catch (final NumberFormatException e) {
                    break;
                }
                return true;
            }
        }

        return PREDEFINED_CONSTANTS.contains(trimmedCssValue);
    }
public static boolean isValid(final String cssValue) {

        final String trimmedCssValue = TagStringUtil
                .toLowerCase(StringUtil.strip(cssValue));

        if (StringUtil.containsSpace(trimmedCssValue)) {
            return false;
        }

        for (final CssLengthUnit cssLengthUnit : CssLengthUnit.values()) {
            final String unit = cssLengthUnit.getUnit();
            if (trimmedCssValue.endsWith(unit)) {
                final String valueOnly = trimmedCssValue.replaceFirst(unit, "");
                try {
                    
                    Float.parseFloat(valueOnly);
                } catch (final NumberFormatException e) {
                    break;
                }
                return true;
            }
        }

        return PREDEFINED_CONSTANTS.contains(trimmedCssValue);
    }
public static boolean isValid ( final String cssValue ) { final String trimmedCssValue = TagStringUtil . toLowerCase ( StringUtil . strip ( cssValue ) ) ; if ( StringUtil . containsSpace ( trimmedCssValue ) ) { return false ; } for ( final CssLengthUnit cssLengthUnit : CssLengthUnit . values ( ) ) { final String unit = cssLengthUnit . getUnit ( ) ; if ( trimmedCssValue . endsWith ( unit ) ) { final String valueOnly = trimmedCssValue . replaceFirst ( unit , "" ) ; try { // it could be negative Float . parseFloat ( valueOnly ) ; } catch ( final NumberFormatException e ) { break ; } return true ; } } return PREDEFINED_CONSTANTS . contains ( trimmedCssValue ) ; }
validates if the given cssValue is valid for this class.

@param cssValue
the value to check.
@return true if valid and false if invalid.
@author WFF
@since 1.0.0
validates if the given cssValue is valid for this class .