Class PatternFacet

All Implemented Interfaces:
DatabindableDatatype, XSDatatype, Serializable, org.relaxng.datatype.Datatype

public final class PatternFacet extends DataTypeWithFacet
"pattern" facet validator "pattern" is a constraint facet which is applied against lexical space. See http://www.w3.org/TR/xmlschema-2/#dt-pattern for the spec
Author:
Kohsuke KAWAGUCHI
See Also:
  • Field Details

    • patterns

      public final String[] patterns
      string representations of the above RegularExpressions. this representation is usually human friendly than the one generated by RegularExpression.toString method.
  • Constructor Details

    • PatternFacet

      public PatternFacet(String nsUri, String typeName, XSDatatypeImpl baseType, TypeIncubator facets) throws org.relaxng.datatype.DatatypeException
      Throws:
      org.relaxng.datatype.DatatypeException
  • Method Details

    • getRegExps

      public RegExp[] getRegExps()
    • diagnoseByFacet

      protected void diagnoseByFacet(String content, org.relaxng.datatype.ValidationContext context) throws org.relaxng.datatype.DatatypeException
      Specified by:
      diagnoseByFacet in class DataTypeWithFacet
      Throws:
      org.relaxng.datatype.DatatypeException
    • checkLexicalConstraint

      protected final boolean checkLexicalConstraint(String literal)
    • checkFormat

      protected final boolean checkFormat(String literal, org.relaxng.datatype.ValidationContext context)
      Specified by:
      checkFormat in class XSDatatypeImpl
    • _createValue

      public final Object _createValue(String literal, org.relaxng.datatype.ValidationContext context)
      Description copied from class: XSDatatypeImpl
      converts a whitespace-processed lexical value into the corresponding value object
      Specified by:
      _createValue in class XSDatatypeImpl