Class CssTypesValidationUtils

java.lang.Object
com.itextpdf.styledxmlparser.css.util.CssTypesValidationUtils

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

    Modifier and Type
    Method
    Description
    static boolean
    Checks if value contains initial, inherit or unset.
    static boolean
    isAngleValue(String valueArgument)
    Checks whether a string contains an allowed metric unit in HTML/CSS; rad, deg and grad.
    static boolean
    Deprecated.
    static boolean
    Checks if a value is a color property.
    static boolean
    isEmValue(String valueArgument)
    Checks whether a string contains an allowed value relative to parent value.
    static boolean
    isExValue(String valueArgument)
    Checks whether a string contains an allowed value relative to element font height.
    static boolean
    Checks if value is initial, inherit or unset.
    static boolean
    Checks if the string represent inline data in format `data:{FORMAT};{ENCODING},{DATA}`.
    static boolean
    Checks whether a string matches an integer numeric value (e.g. 123, 23).
    static boolean
    isMetricValue(String valueArgument)
    Checks whether a string contains an allowed metric unit in HTML/CSS; px, in, cm, mm, pc, Q or pt.
    static boolean
    Checks whether a string matches a negative value (e.g. -123, -2em, -0.123).
    static boolean
    Checks whether a string matches a numeric value (e.g. 123, 1.23, .123).
    static boolean
    isPercentageValue(String valueArgument)
    Checks whether a string contains a percentage value
    static boolean
    isRelativeValue(String valueArgument)
    Checks whether a string contains an allowed value relative to previously set value.
    static boolean
    isRemValue(String valueArgument)
    Checks whether a string contains an allowed value relative to previously set root value.
    static boolean
    Checks if a string is in a valid format.
    static boolean
    isZero(String value)
    Checks whether a string contains a zero.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isAngleValue

      public static boolean isAngleValue(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

      @Deprecated public static boolean isBase64Data(String data)
      Deprecated.
      Checks if a data is base 64 encoded.
      Parameters:
      data - the data
      Returns:
      true, if the data is base 64 encoded
    • isInlineData

      public static boolean isInlineData(String data)
      Checks if the string represent inline data in format `data:{FORMAT};{ENCODING},{DATA}`.
      Parameters:
      data - the string to check
      Returns:
      true, if the string is inline data
    • isColorProperty

      public static boolean isColorProperty(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(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(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(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(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(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(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(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(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(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(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(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(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(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