java.lang.Object
com.itextpdf.styledxmlparser.css.validate.impl.datatype.CssEnumValidator
All Implemented Interfaces:
ICssDataTypeValidator

public class CssEnumValidator extends Object implements ICssDataTypeValidator
ICssDataTypeValidator implementation for elements in an enumeration.
  • Constructor Details

    • CssEnumValidator

      public CssEnumValidator (String... allowedValues)
      Creates a new CssEnumValidator instance.
      Parameters:
      allowedValues - the allowed values
    • CssEnumValidator

      public CssEnumValidator (Collection<String> allowedValues)
      Creates a new CssEnumValidator instance.
      Parameters:
      allowedValues - the allowed values
    • CssEnumValidator

      public CssEnumValidator (Collection<String> allowedValues, Collection<String> allowedModificators)
      Creates a new CssEnumValidator instance.

      Each allowed value will be added with all the modificators. Each allowed value will be added as well.

      Parameters:
      allowedValues - the allowed values
      allowedModificators - the allowed prefixes
  • Method Details

    • addAllowedValues

      public void addAllowedValues (Collection<String> allowedValues)
      Adds new allowed values to the allowedValues.
      Parameters:
      allowedValues - the allowed values
    • isValid

      public boolean isValid (String objectString)
      Description copied from interface: ICssDataTypeValidator
      Checks if a value is a valid data type (e.g. a color, an identifier,...).
      Specified by:
      isValid in interface ICssDataTypeValidator
      Parameters:
      objectString - the value
      Returns:
      true, if the value is a valid data type