org.apache.xerces.validators.datatype
Class TimeDurationValidator

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

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

TimeDurationValidator validates that XML content is a W3C timeDuration.

Version:
 
Author:
Ted Leung, George Joseph

Field Summary
static int CACHE_INITIAL_SIZE
           
static int CACHE_LIMIT
           
 
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
TimeDurationValidator()
           
 
Method Summary
static long normalizeDuration(char[] value, int start, int length)
           
 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 timeDuration type validate returns true or false depending on whether the string content is an instance of the W3C timeDuration datatype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_LIMIT

public static final int CACHE_LIMIT

CACHE_INITIAL_SIZE

public static final int CACHE_INITIAL_SIZE
Constructor Detail

TimeDurationValidator

public TimeDurationValidator()
Method Detail

validate

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

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

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

normalizeDuration

public static long normalizeDuration(char[] value,
                                     int start,
                                     int length)
                              throws InvalidDatatypeValueException


Copyright © 1999 Apache XML Project. All Rights Reserved.