org.apache.xerces.validators.datatype
Class StringValidator

java.lang.Object
  |
  +--org.apache.xerces.validators.datatype.StringValidator

public class StringValidator
extends java.lang.Object
implements org.apache.xerces.validators.datatype.InternalDatatypeValidator

StringValidator validates that XML content is a W3C string type.

Version:
 
Author:
Ted Leung

Fields inherited from interface org.apache.xerces.validators.datatype.DatatypeValidator
ENCODING, ENUMERATION, LENGTH, LEXICAL, LEXICALREPRESENTATION, LITERAL, MAXEXCLUSIVE, MAXINCLUSIVE, MAXLENGTH, MINEXCLUSIVE, MININCLUSIVE, MINLENGTH, PATTERN, PERIOD, PRECISION, SCALE
 
Constructor Summary
StringValidator()
           
 
Method Summary
 void setBasetype(DatatypeValidator base)
          set the base type for this datatype
 void setFacets(java.util.Hashtable facets)
          set the facets for this datatype setFacets is responsible for ensuring that the supplied facets do not contradict each other
 void setFacets(int[] facets)
          set the facets for this datatype
 void setLocale(java.util.Locale locale)
          set the locate to be used for error messages
 void validate(int contentIndex)
          validate that a string matches a datatype validate returns true or false depending on whether the string content is an instance of the data type represented by this validator.
 void validate(java.lang.String content)
          validate that a string is a W3C string type validate returns true or false depending on whether the string content is an instance of the W3C string datatype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringValidator

public StringValidator()
Method Detail

validate

public void validate(java.lang.String content)
              throws InvalidDatatypeValueException
validate that a string is a W3C string type validate returns true or false depending on whether the string content is an instance of the W3C string datatype
Parameters:
content - A string containing the content to be validated
Throws:
throws - InvalidDatatypeException if the content is not a W3C string type

validate

public void validate(int contentIndex)
              throws InvalidDatatypeValueException
Description copied from interface: org.apache.xerces.validators.datatype.InternalDatatypeValidator
validate that a string matches a datatype validate returns true or false depending on whether the string content is an instance of the data type represented by this validator.
Specified by:
validate in interface org.apache.xerces.validators.datatype.InternalDatatypeValidator
Tags copied from interface: org.apache.xerces.validators.datatype.InternalDatatypeValidator
Parameters:
content - A string containing the content to be validated
Throws:
throws - InvalidDatatypeException if the content is invalid according to the rules for the validators

setFacets

public void setFacets(java.util.Hashtable facets)
               throws UnknownFacetException,
                      IllegalFacetException,
                      IllegalFacetValueException
Description copied from interface: DatatypeValidator
set the facets for this datatype setFacets is responsible for ensuring that the supplied facets do not contradict each other
Tags copied from interface: DatatypeValidator
Parameters:
facets - A hashtable where facet names are keys and facet values are stored in the hashtable. Usually facet values are strings, except for the enumeration facet. The value for this facet is a Vector of strings, one per enumeration value
Throws:
throws - UnknownFacetException
throws - IllegalFacetException
throws - IllegalFacetValueException

setFacets

public void setFacets(int[] facets)
               throws UnknownFacetException,
                      IllegalFacetException,
                      IllegalFacetValueException
Description copied from interface: org.apache.xerces.validators.datatype.InternalDatatypeValidator
set the facets for this datatype
Specified by:
setFacets in interface org.apache.xerces.validators.datatype.InternalDatatypeValidator

setBasetype

public void setBasetype(DatatypeValidator base)
Description copied from interface: DatatypeValidator
set the base type for this datatype
Tags copied from interface: DatatypeValidator
Parameters:
base - the validator for this type's base type

setLocale

public void setLocale(java.util.Locale locale)
set the locate to be used for error messages


Copyright © 1999 Apache XML Project. All Rights Reserved.