org.apache.xerces.validators.datatype
Interface DatatypeValidator
- All Known Implementing Classes:
- AbstractDatatypeValidator
- 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:
- $Id: DatatypeValidator.java,v 1.6 2000/06/02 23:04:23 jeffreyr Exp $
- Author:
- Jeffrey Rodriguez-
Method Summary |
int |
compare(java.lang.String value1,
java.lang.String value2)
Compares content in the Domain value vs. |
java.util.Hashtable |
getFacets()
returns the datatype facet if any is set as a
Hashtable |
java.lang.Object |
validate(java.lang.String content,
java.lang.Object state)
Checks that "content" string is valid
datatype. |
FACET_LENGTH
public static final int FACET_LENGTH
FACET_MINLENGTH
public static final int FACET_MINLENGTH
FACET_MAXLENGTH
public static final int FACET_MAXLENGTH
FACET_PATTERN
public static final int FACET_PATTERN
FACET_ENUMERATION
public static final int FACET_ENUMERATION
FACET_MAXINCLUSIVE
public static final int FACET_MAXINCLUSIVE
FACET_MAXEXCLUSIVE
public static final int FACET_MAXEXCLUSIVE
FACET_MININCLUSIVE
public static final int FACET_MININCLUSIVE
FACET_MINEXCLUSIVE
public static final int FACET_MINEXCLUSIVE
FACET_PRECISSION
public static final int FACET_PRECISSION
FACET_SCALE
public static final int FACET_SCALE
FACET_ENCODING
public static final int FACET_ENCODING
FACET_DURATION
public static final int FACET_DURATION
FACET_PERIOD
public static final int FACET_PERIOD
validate
public java.lang.Object 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.
- Parameters:
content
- A string containing the content to be validatedderivedBylist
- Flag which is true when type
is derived by list otherwise it
it is derived by extension.- Throws:
- throws - InvalidDatatypeException if the content is
invalid according to the rules for the validators
- InvalidDatatypeValueException -
- See Also:
InvalidDatatypeValueException
getFacets
public java.util.Hashtable getFacets()
- returns the datatype facet if any is set as a
Hashtable
- Returns:
-
compare
public int compare(java.lang.String value1,
java.lang.String value2)
- Compares content in the Domain value vs. lexical
value.
e.g. If type is a float then 1.0 may be equivalent
to 1 even tough both are lexically different.
- Parameters:
value1
- valu2
- - Returns:
-
Copyright © 1999-2000 Apache XML Project. All Rights Reserved.