org.apache.xerces.validators.datatype
Class ENTITYDatatypeValidator

java.lang.Object
  |
  +--org.apache.xerces.validators.datatype.AbstractDatatypeValidator
        |
        +--org.apache.xerces.validators.datatype.AbstractStringValidator
              |
              +--org.apache.xerces.validators.datatype.StringDatatypeValidator
                    |
                    +--org.apache.xerces.validators.datatype.ENTITYDatatypeValidator
All Implemented Interfaces:
java.lang.Cloneable, DatatypeValidator

public class ENTITYDatatypeValidator
extends StringDatatypeValidator

ENTITYDatatypeValidator implements the DatattypeValidator interface. This validator embodies the ENTITY attribute type from XML1.0 recommendation. The Value space of ENTITY is the set of all strings that match the NCName production and have been declared as an unparsed entity in a document type definition. The Lexical space of Entity is the set of all strings that match the NCName production. The value space of ENTITY is scoped to a specific instance document. Some caveats: Because of the Xerces Architecture, where all symbols are stored in a StringPool and Strings are referenced by int then this datatype needs to know about StringPool. The first time that this datatype is invoked we pass a message containing 2 references needed by this validator: - a reference to the DefaultEntityHandler used by the XMLValidator. - a reference to the StringPool. This validator extends also the XML1.0 validation provided in DTD by providing "only on Schemas" facet validation. This validator also embodies the Derived datatype ENTITIES which is an ENTITY derived by list. These validators can be supplied by the application writer and may be useful as standalone code as well as plugins to the validator architecture.

Version:
$Id: ENTITYDatatypeValidator.java 317277 2001-06-20 18:37:39Z sandygao $
Author:
Jeffrey Rodriguez-, Mark Swinkles - List Validation refactoring
See Also:
DatatypeValidator, DatatypeValidatorFactoryImpl, DatatypeValidatorFactory, XMLValidator

Field Summary
static int ENTITY_VALIDATE
           
 
Fields inherited from class org.apache.xerces.validators.datatype.AbstractStringValidator
FACET_SPECIAL_TOKEN, fEnumeration, fLength, fMaxLength, fMinLength, fTokenType, SPECIAL_TOKEN_ENTITY, SPECIAL_TOKEN_IDNAME, SPECIAL_TOKEN_IDNCNAME, SPECIAL_TOKEN_IDREFNAME, SPECIAL_TOKEN_IDREFNCNAME, SPECIAL_TOKEN_NAME, SPECIAL_TOKEN_NCNAME, SPECIAL_TOKEN_NMTOKEN, SPECIAL_TOKEN_NONE
 
Fields inherited from class org.apache.xerces.validators.datatype.AbstractDatatypeValidator
fBaseValidator, fFacetsDefined, fFlags, fLocale, fMessageProvider, fPattern, fRegex
 
Fields inherited from interface org.apache.xerces.validators.datatype.DatatypeValidator
COLLAPSE, FACET_DURATION, FACET_ENCODING, FACET_ENUMERATION, FACET_FIXED, FACET_FRACTIONDIGITS, FACET_LENGTH, FACET_MAXEXCLUSIVE, FACET_MAXINCLUSIVE, FACET_MAXLENGTH, FACET_MINEXCLUSIVE, FACET_MININCLUSIVE, FACET_MINLENGTH, FACET_PATTERN, FACET_PERIOD, FACET_TOTALDIGITS, FACET_WHITESPACE, PRESERVE, REPLACE
 
Constructor Summary
ENTITYDatatypeValidator()
           
ENTITYDatatypeValidator(DatatypeValidator base, java.util.Hashtable facets, boolean derivedByList)
           
 
Method Summary
 java.lang.Object clone()
          Returns a copy of this object.
 int compare(java.lang.String content1, java.lang.String content2)
          REVISIT Compares two Datatype for order
 short getWSFacet()
          return value of whiteSpace facet
 java.lang.Object validate(java.lang.String content, java.lang.Object state)
          Checks that "content" string is valid datatype.
 
Methods inherited from class org.apache.xerces.validators.datatype.StringDatatypeValidator
assignAdditionalFacets, checkBaseFacetConstraints, inheritAdditionalFacets
 
Methods inherited from class org.apache.xerces.validators.datatype.AbstractStringValidator
checkValueSpace, derivationList, getLength, setTokenType, validateToken
 
Methods inherited from class org.apache.xerces.validators.datatype.AbstractDatatypeValidator
getBaseValidator, getErrorString, setLocale
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTITY_VALIDATE

public static final int ENTITY_VALIDATE
Constructor Detail

ENTITYDatatypeValidator

public ENTITYDatatypeValidator()
                        throws InvalidDatatypeFacetException

ENTITYDatatypeValidator

public ENTITYDatatypeValidator(DatatypeValidator base,
                               java.util.Hashtable facets,
                               boolean derivedByList)
                        throws InvalidDatatypeFacetException
Method Detail

getWSFacet

public short getWSFacet()
return value of whiteSpace facet
Overrides:
getWSFacet in class StringDatatypeValidator

validate

public java.lang.Object validate(java.lang.String content,
                                 java.lang.Object state)
                          throws InvalidDatatypeValueException
Checks that "content" string is valid datatype. If invalid a Datatype validation exception is thrown.
Overrides:
validate in class AbstractStringValidator
Parameters:
content - A string containing the content to be validated
derivedBylist - Flag which is true when type is derived by list otherwise it it is derived by extension.
Throws:
throws - InvalidDatatypeException if the content is invalid according to the rules for the validators
InvalidDatatypeValueException -  
See Also:
InvalidDatatypeValueException

compare

public int compare(java.lang.String content1,
                   java.lang.String content2)
REVISIT Compares two Datatype for order
Overrides:
compare in class StringDatatypeValidator
Returns:
 

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a copy of this object.
Overrides:
clone in class StringDatatypeValidator
Following copied from class: org.apache.xerces.validators.datatype.AbstractStringValidator
Returns:
 
Throws:
java.lang.CloneNotSupportedException -  


Copyright 1999-2001 Apache XML Project. All Rights Reserved.