org.apache.xerces.validators.datatype
Class AbstractStringValidator

java.lang.Object
  |
  +--org.apache.xerces.validators.datatype.AbstractDatatypeValidator
        |
        +--org.apache.xerces.validators.datatype.AbstractStringValidator
All Implemented Interfaces:
java.lang.Cloneable, DatatypeValidator
Direct Known Subclasses:
AnyURIDatatypeValidator, Base64BinaryDatatypeValidator, HexBinaryDatatypeValidator, NOTATIONDatatypeValidator, QNameDatatypeValidator, StringDatatypeValidator

public abstract class AbstractStringValidator
extends AbstractDatatypeValidator

AbstractStringValidator is a base class for anyURI, string, hexBinary, base64Binary, QName and Notation datatypes.

Version:
$Id: AbstractStringValidator.java 317570 2001-09-12 21:04:51Z sandygao $
Author:
Elena Litani

Field Summary
static java.lang.String FACET_SPECIAL_TOKEN
           
protected  java.util.Vector fEnumeration
           
protected  int fLength
           
protected  int fMaxLength
           
protected  int fMinLength
           
protected  java.lang.String fTokenType
           
static java.lang.String SPECIAL_TOKEN_ENTITY
           
static java.lang.String SPECIAL_TOKEN_IDNAME
           
static java.lang.String SPECIAL_TOKEN_IDNCNAME
           
static java.lang.String SPECIAL_TOKEN_IDREFNAME
           
static java.lang.String SPECIAL_TOKEN_IDREFNCNAME
           
static java.lang.String SPECIAL_TOKEN_NAME
           
static java.lang.String SPECIAL_TOKEN_NCNAME
           
static java.lang.String SPECIAL_TOKEN_NMTOKEN
           
static java.lang.String 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
AbstractStringValidator()
           
AbstractStringValidator(DatatypeValidator base, java.util.Hashtable facets, boolean derivedByList)
           
 
Method Summary
protected abstract  void assignAdditionalFacets(java.lang.String key, java.util.Hashtable facets)
           
protected  void checkBaseFacetConstraints()
           
protected  void checkValueSpace(java.lang.String content)
           
 java.lang.Object clone()
          Returns a copy of this object.
protected  boolean derivationList(boolean derivedByList)
           
protected  int getLength(java.lang.String content)
           
protected  void inheritAdditionalFacets()
           
 void setTokenType(java.lang.String tokenType)
           
 java.lang.Object validate(java.lang.String content, java.lang.Object state)
          validate that a string is a W3C string type
protected static void validateToken(java.lang.String tokenType, java.lang.String content)
           
 
Methods inherited from class org.apache.xerces.validators.datatype.AbstractDatatypeValidator
getBaseValidator, getErrorString, getWSFacet, setLocale
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.xerces.validators.datatype.DatatypeValidator
compare
 

Field Detail

fLength

protected int fLength

fMaxLength

protected int fMaxLength

fMinLength

protected int fMinLength

fEnumeration

protected java.util.Vector fEnumeration

FACET_SPECIAL_TOKEN

public static final java.lang.String FACET_SPECIAL_TOKEN

SPECIAL_TOKEN_NONE

public static final java.lang.String SPECIAL_TOKEN_NONE

SPECIAL_TOKEN_NMTOKEN

public static final java.lang.String SPECIAL_TOKEN_NMTOKEN

SPECIAL_TOKEN_NAME

public static final java.lang.String SPECIAL_TOKEN_NAME

SPECIAL_TOKEN_IDNAME

public static final java.lang.String SPECIAL_TOKEN_IDNAME

SPECIAL_TOKEN_IDREFNAME

public static final java.lang.String SPECIAL_TOKEN_IDREFNAME

SPECIAL_TOKEN_NCNAME

public static final java.lang.String SPECIAL_TOKEN_NCNAME

SPECIAL_TOKEN_IDNCNAME

public static final java.lang.String SPECIAL_TOKEN_IDNCNAME

SPECIAL_TOKEN_IDREFNCNAME

public static final java.lang.String SPECIAL_TOKEN_IDREFNCNAME

SPECIAL_TOKEN_ENTITY

public static final java.lang.String SPECIAL_TOKEN_ENTITY

fTokenType

protected java.lang.String fTokenType
Constructor Detail

AbstractStringValidator

public AbstractStringValidator()
                        throws InvalidDatatypeFacetException

AbstractStringValidator

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

assignAdditionalFacets

protected abstract void assignAdditionalFacets(java.lang.String key,
                                               java.util.Hashtable facets)
                                        throws InvalidDatatypeFacetException

inheritAdditionalFacets

protected void inheritAdditionalFacets()

checkBaseFacetConstraints

protected void checkBaseFacetConstraints()
                                  throws InvalidDatatypeFacetException

derivationList

protected boolean derivationList(boolean derivedByList)

validate

public java.lang.Object validate(java.lang.String content,
                                 java.lang.Object state)
                          throws InvalidDatatypeValueException
validate that a string is a W3C string type
Overrides:
validate in class AbstractDatatypeValidator
Parameters:
content - A string containing the content to be validated
list -  
Throws:
throws - InvalidDatatypeException if the content is not a W3C string type
InvalidDatatypeValueException -  

getLength

protected int getLength(java.lang.String content)

checkValueSpace

protected void checkValueSpace(java.lang.String content)
                        throws InvalidDatatypeValueException

clone

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

setTokenType

public void setTokenType(java.lang.String tokenType)

validateToken

protected static void validateToken(java.lang.String tokenType,
                                    java.lang.String content)
                             throws InvalidDatatypeValueException


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