org.apache.xerces.impl.dv.dtd
Class ENTITYDatatypeValidator

java.lang.Object
  |
  +--org.apache.xerces.impl.dv.dtd.AbstractDatatypeValidator
        |
        +--org.apache.xerces.impl.dv.dtd.ENTITYDatatypeValidator
All Implemented Interfaces:
DatatypeValidator, StatefullDatatypeValidator

public class ENTITYDatatypeValidator
extends AbstractDatatypeValidator
implements StatefullDatatypeValidator

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.

This is a statefull datatype validator and it needs access to a valid Grammar structure to being able to validate entities.

Version:
$Id: ENTITYDatatypeValidator.java,v 1.5 2002/01/29 01:15:11 lehors Exp $
Author:
Jeffrey Rodriguez-
See Also:
AbstractDTDGrammar, DTDGrammar, SchemaGrammar

Fields inherited from class org.apache.xerces.impl.dv.dtd.AbstractDatatypeValidator
fFacets
 
Fields inherited from interface org.apache.xerces.impl.dv.dtd.DatatypeValidator
FACET_DURATION, FACET_ENCODING, FACET_ENUMERATION, FACET_LENGTH, FACET_MAXEXCLUSIVE, FACET_MAXINCLUSIVE, FACET_MAXLENGTH, FACET_MINEXCLUSIVE, FACET_MININCLUSIVE, FACET_MINLENGTH, FACET_PATTERN, FACET_PERIOD, FACET_PRECISSION, FACET_SCALE, FACET_WHITESPACE, WHITESPACE_COLLAPSE, WHITESPACE_NONE, WHITESPACE_PRESERVE, WHITESPACE_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
 java.util.Hashtable getFacets()
          getFacets
 java.lang.Object getInternalStateInformation()
          A no-op method in this validator
 void initialize(java.lang.Object grammar)
          Initializes internal Grammar reference This method is unique to ENTITYDatatypeValidator.
 void validate()
          A no-op method in this Datatype
 void validate(java.lang.String content, java.lang.Object state)
          Checks that "content" string is valid datatype.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ENTITYDatatypeValidator

public ENTITYDatatypeValidator()
                        throws InvalidDatatypeFacetException

ENTITYDatatypeValidator

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

validate

public void 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.

The following constrain is checked: ENTITY values must match an unparsed entity name that is declared in the schema.

Overrides:
validate in class AbstractDatatypeValidator
Parameters:
content - A string containing the content to be validated
state -  
Throws:
throws - InvalidDatatypeException if the content is invalid according to the rules for the validators
InvalidDatatypeValueException -  
See Also:
InvalidDatatypeValueException

validate

public void validate()
A no-op method in this Datatype
Specified by:
validate in interface StatefullDatatypeValidator

initialize

public void initialize(java.lang.Object grammar)

Initializes internal Grammar reference This method is unique to ENTITYDatatypeValidator.

This method should be called before calling the validate method

Specified by:
initialize in interface StatefullDatatypeValidator
Parameters:
grammar -  

compare

public int compare(java.lang.String content1,
                   java.lang.String content2)
REVISIT Compares two Datatype for order
Overrides:
compare in class AbstractDatatypeValidator
Returns:
0 if value1 and value2 are equal, a value less than 0 if value1 is less than value2, a value greater than 0 if value1 is greater than value2

getFacets

public java.util.Hashtable getFacets()
Description copied from class: AbstractDatatypeValidator
getFacets
Overrides:
getFacets in class AbstractDatatypeValidator
Following copied from class: org.apache.xerces.impl.dv.dtd.AbstractDatatypeValidator
Returns:
A Hashtable containing the facets for this datatype.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a copy of this object.
Overrides:
clone in class java.lang.Object

getInternalStateInformation

public java.lang.Object getInternalStateInformation()
A no-op method in this validator
Specified by:
getInternalStateInformation in interface StatefullDatatypeValidator


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