Class CssTypesValidationUtils


  • public final class CssTypesValidationUtils
    extends java.lang.Object
    Utilities class for CSS types validating operations.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean containsInitialOrInheritOrUnset​(java.lang.String value)
      Checks if value contains initial, inherit or unset.
      static boolean isAngleValue​(java.lang.String valueArgument)
      Checks whether a string contains an allowed metric unit in HTML/CSS; rad, deg and grad.
      static boolean isBase64Data​(java.lang.String data)
      Checks if a data is base 64 encoded.
      static boolean isColorProperty​(java.lang.String value)
      Checks if a value is a color property.
      static boolean isEmValue​(java.lang.String valueArgument)
      Checks whether a string contains an allowed value relative to parent value.
      static boolean isExValue​(java.lang.String valueArgument)
      Checks whether a string contains an allowed value relative to element font height.
      static boolean isInitialOrInheritOrUnset​(java.lang.String value)
      Checks if value is initial, inherit or unset.
      static boolean isIntegerNumber​(java.lang.String value)
      Checks whether a string matches an integer numeric value (e.g.
      static boolean isMetricValue​(java.lang.String valueArgument)
      Checks whether a string contains an allowed metric unit in HTML/CSS; px, in, cm, mm, pc, Q or pt.
      (package private) static boolean isMetricZeroValue​(java.lang.String valueArgument)  
      static boolean isNegativeValue​(java.lang.String value)
      Checks whether a string matches a negative value (e.g.
      static boolean isNumber​(java.lang.String value)
      Checks whether a string matches a numeric value (e.g.
      (package private) static boolean isNumericZeroValue​(java.lang.String value)  
      static boolean isPercentageValue​(java.lang.String valueArgument)
      Checks whether a string contains a percentage value
      static boolean isRelativeValue​(java.lang.String valueArgument)
      Checks whether a string contains an allowed value relative to previously set value.
      (package private) static boolean isRelativeZeroValue​(java.lang.String valueArgument)  
      static boolean isRemValue​(java.lang.String valueArgument)
      Checks whether a string contains an allowed value relative to previously set root value.
      static boolean isValidNumericValue​(java.lang.String value)
      Checks if a string is in a valid format.
      static boolean isZero​(java.lang.String value)
      Checks whether a string contains a zero.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ANGLE_MEASUREMENTS_VALUES

        private static final java.lang.String[] ANGLE_MEASUREMENTS_VALUES
      • RELATIVE_MEASUREMENTS_VALUES

        private static final java.lang.String[] RELATIVE_MEASUREMENTS_VALUES
      • BASE64_PATTERN

        private static final java.util.regex.Pattern BASE64_PATTERN
    • Constructor Detail

    • Method Detail

      • isAngleValue

        public static boolean isAngleValue​(java.lang.String valueArgument)
        Checks whether a string contains an allowed metric unit in HTML/CSS; rad, deg and grad.
        Parameters:
        valueArgument - the string that needs to be checked
        Returns:
        boolean true if value contains an allowed angle value
      • isBase64Data

        public static boolean isBase64Data​(java.lang.String data)
        Checks if a data is base 64 encoded.
        Parameters:
        data - the data
        Returns:
        true, if the data is base 64 encoded
      • isColorProperty

        public static boolean isColorProperty​(java.lang.String value)
        Checks if a value is a color property.
        Parameters:
        value - the value
        Returns:
        true, if the value contains a color property
      • isEmValue

        public static boolean isEmValue​(java.lang.String valueArgument)
        Checks whether a string contains an allowed value relative to parent value.
        Parameters:
        valueArgument - the string that needs to be checked
        Returns:
        boolean true if value contains a em value
      • isExValue

        public static boolean isExValue​(java.lang.String valueArgument)
        Checks whether a string contains an allowed value relative to element font height.
        Parameters:
        valueArgument - the string that needs to be checked
        Returns:
        boolean true if value contains a ex value
      • isMetricValue

        public static boolean isMetricValue​(java.lang.String valueArgument)
        Checks whether a string contains an allowed metric unit in HTML/CSS; px, in, cm, mm, pc, Q or pt.
        Parameters:
        valueArgument - the string that needs to be checked
        Returns:
        boolean true if value contains an allowed metric value
      • isNegativeValue

        public static boolean isNegativeValue​(java.lang.String value)
        Checks whether a string matches a negative value (e.g. -123, -2em, -0.123). All these metric values are allowed in HTML/CSS.
        Parameters:
        value - the string that needs to be checked
        Returns:
        true if value is negative
      • isNumber

        public static boolean isNumber​(java.lang.String value)
        Checks whether a string matches a numeric value (e.g. 123, 1.23, .123). All these metric values are allowed in HTML/CSS.
        Parameters:
        value - the string that needs to be checked
        Returns:
        boolean true if value contains an allowed metric value
      • isIntegerNumber

        public static boolean isIntegerNumber​(java.lang.String value)
        Checks whether a string matches an integer numeric value (e.g. 123, 23). All these metric values are allowed in HTML/CSS.
        Parameters:
        value - the string that needs to be checked
        Returns:
        boolean true if value contains an allowed metric value
      • isPercentageValue

        public static boolean isPercentageValue​(java.lang.String valueArgument)
        Checks whether a string contains a percentage value
        Parameters:
        valueArgument - the string that needs to be checked
        Returns:
        boolean true if value contains an allowed percentage value
      • isRelativeValue

        public static boolean isRelativeValue​(java.lang.String valueArgument)
        Checks whether a string contains an allowed value relative to previously set value.
        Parameters:
        valueArgument - the string that needs to be checked
        Returns:
        boolean true if value contains an allowed metric value
      • isRemValue

        public static boolean isRemValue​(java.lang.String valueArgument)
        Checks whether a string contains an allowed value relative to previously set root value.
        Parameters:
        valueArgument - the string that needs to be checked
        Returns:
        boolean true if value contains a rem value
      • isValidNumericValue

        public static boolean isValidNumericValue​(java.lang.String value)
        Checks if a string is in a valid format.
        Parameters:
        value - the string that needs to be checked
        Returns:
        boolean true if value is in a valid format
      • isInitialOrInheritOrUnset

        public static boolean isInitialOrInheritOrUnset​(java.lang.String value)
        Checks if value is initial, inherit or unset.
        Parameters:
        value - value to check
        Returns:
        true if value is initial, inherit or unset. false otherwise
      • containsInitialOrInheritOrUnset

        public static boolean containsInitialOrInheritOrUnset​(java.lang.String value)
        Checks if value contains initial, inherit or unset.
        Parameters:
        value - value to check
        Returns:
        true if value contains initial, inherit or unset. False otherwise
      • isZero

        public static boolean isZero​(java.lang.String value)
        Checks whether a string contains a zero.
        Parameters:
        value - the string that needs to be checked
        Returns:
        boolean true if value contains a zero
      • isMetricZeroValue

        static boolean isMetricZeroValue​(java.lang.String valueArgument)
      • isNumericZeroValue

        static boolean isNumericZeroValue​(java.lang.String value)
      • isRelativeZeroValue

        static boolean isRelativeZeroValue​(java.lang.String valueArgument)