org.apache.xerces.validators.datatype
Interface DatatypeValidator


public interface DatatypeValidator

DataTypeValidator defines the interface that data type validators must obey. These validators can be supplied by the application writer and may be useful as standalone code as well as plugins to the validator architecture. Note: there is no support for facets in this API, since we are trying to convince W3C to remove facets from the data type spec.

Version:
 
Author:
Ted Leung

Field Summary
static java.lang.String ENCODING
           
static java.lang.String ENUMERATION
           
static java.lang.String LENGTH
           
static java.lang.String LEXICAL
           
static java.lang.String LEXICALREPRESENTATION
           
static java.lang.String LITERAL
           
static java.lang.String MAXEXCLUSIVE
           
static java.lang.String MAXINCLUSIVE
           
static java.lang.String MAXLENGTH
           
static java.lang.String MINEXCLUSIVE
           
static java.lang.String MININCLUSIVE
           
static java.lang.String MINLENGTH
           
static java.lang.String PATTERN
           
static java.lang.String PERIOD
           
static java.lang.String PRECISION
           
static java.lang.String SCALE
           
 
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 setLocale(java.util.Locale locale)
          set the locate to be used for error messages
 void validate(java.lang.String content)
          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.
 

Field Detail

MININCLUSIVE

public static final java.lang.String MININCLUSIVE

MINEXCLUSIVE

public static final java.lang.String MINEXCLUSIVE

MAXINCLUSIVE

public static final java.lang.String MAXINCLUSIVE

MAXEXCLUSIVE

public static final java.lang.String MAXEXCLUSIVE

PRECISION

public static final java.lang.String PRECISION

SCALE

public static final java.lang.String SCALE

LENGTH

public static final java.lang.String LENGTH

MINLENGTH

public static final java.lang.String MINLENGTH

MAXLENGTH

public static final java.lang.String MAXLENGTH

ENUMERATION

public static final java.lang.String ENUMERATION

LITERAL

public static final java.lang.String LITERAL

LEXICALREPRESENTATION

public static final java.lang.String LEXICALREPRESENTATION

LEXICAL

public static final java.lang.String LEXICAL

ENCODING

public static final java.lang.String ENCODING

PERIOD

public static final java.lang.String PERIOD

PATTERN

public static final java.lang.String PATTERN
Method Detail

validate

public void validate(java.lang.String content)
              throws InvalidDatatypeValueException
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.
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
set the facets for this datatype setFacets is responsible for ensuring that the supplied facets do not contradict each other
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

setBasetype

public void setBasetype(DatatypeValidator base)
set the base type for this datatype
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.