Package org.apache.xerces.impl.dv
Interface XSSimpleType
-
- All Superinterfaces:
org.apache.xerces.xs.XSObject,org.apache.xerces.xs.XSSimpleTypeDefinition,org.apache.xerces.xs.XSTypeDefinition
- All Known Implementing Classes:
XSSimpleTypeDecl,XSSimpleTypeDelegate
public interface XSSimpleType extends org.apache.xerces.xs.XSSimpleTypeDefinitionThis interfaceXSSimpleTyperepresents the simple type definition of schema component and defines methods to query the information contained. Any simple type (atomic, list or union) will implement this interface. It inherits fromXSTypeDecl.INTERNAL:
- Usage of this class is not supported. It may be altered or removed at any time.
- Version:
- $Id: XSSimpleType.java 446751 2006-09-15 21:54:06Z mrglavas $
- Author:
- Sandy Gao, IBM
-
-
Field Summary
Fields Modifier and Type Field Description static shortPRIMITIVE_ANYURI"anyURI" typestatic shortPRIMITIVE_BASE64BINARY"base64Binary" typestatic shortPRIMITIVE_BOOLEAN"boolean" typestatic shortPRIMITIVE_DATE"date" typestatic shortPRIMITIVE_DATETIME"dataTime" typestatic shortPRIMITIVE_DECIMAL"decimal" typestatic shortPRIMITIVE_DOUBLE"double" typestatic shortPRIMITIVE_DURATION"duration" typestatic shortPRIMITIVE_FLOAT"float" typestatic shortPRIMITIVE_GDAY"gDay" typestatic shortPRIMITIVE_GMONTH"gMonth" typestatic shortPRIMITIVE_GMONTHDAY"gMonthDay" typestatic shortPRIMITIVE_GYEAR"gYear" typestatic shortPRIMITIVE_GYEARMONTH"gYearMonth" typestatic shortPRIMITIVE_HEXBINARY"hexBinary" typestatic shortPRIMITIVE_NOTATION"NOTATION" typestatic shortPRIMITIVE_PRECISIONDECIMAL"precisionDecimal" typestatic shortPRIMITIVE_QNAME"QName" typestatic shortPRIMITIVE_STRING"string" typestatic shortPRIMITIVE_TIME"time" typestatic shortWS_COLLAPSEcollapse the white spacesstatic shortWS_PRESERVEpreserve the white spacesstatic shortWS_REPLACEreplace the white spaces-
Fields inherited from interface org.apache.xerces.xs.XSSimpleTypeDefinition
FACET_ENUMERATION, FACET_FRACTIONDIGITS, FACET_LENGTH, FACET_MAXEXCLUSIVE, FACET_MAXINCLUSIVE, FACET_MAXLENGTH, FACET_MINEXCLUSIVE, FACET_MININCLUSIVE, FACET_MINLENGTH, FACET_NONE, FACET_PATTERN, FACET_TOTALDIGITS, FACET_WHITESPACE, ORDERED_FALSE, ORDERED_PARTIAL, ORDERED_TOTAL, VARIETY_ABSENT, VARIETY_ATOMIC, VARIETY_LIST, VARIETY_UNION
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapplyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context)If this type is created from restriction, then some facets can be applied to the simple type.shortgetPrimitiveKind()return an ID representing the built-in primitive base type.shortgetWhitespace()Return the whitespace corresponding to this datatype.booleanisEqual(java.lang.Object value1, java.lang.Object value2)Check whether two actual values are equal.booleanisIDType()Check whether this type is or is derived from ID.java.lang.Objectvalidate(java.lang.Object content, ValidationContext context, ValidatedInfo validatedInfo)validate a given string value, represented by content.toString().java.lang.Objectvalidate(java.lang.String content, ValidationContext context, ValidatedInfo validatedInfo)validate a given string against this simple type.voidvalidate(ValidationContext context, ValidatedInfo validatedInfo)Validate an actual value against this simple type.-
Methods inherited from interface org.apache.xerces.xs.XSObject
getName, getNamespace, getNamespaceItem, getType
-
Methods inherited from interface org.apache.xerces.xs.XSSimpleTypeDefinition
getAnnotations, getBounded, getBuiltInKind, getDefinedFacets, getFacet, getFacets, getFinite, getFixedFacets, getItemType, getLexicalEnumeration, getLexicalFacetValue, getLexicalPattern, getMemberTypes, getMultiValueFacets, getNumeric, getOrdered, getPrimitiveType, getVariety, isDefinedFacet, isFixedFacet
-
-
-
-
Field Detail
-
WS_PRESERVE
static final short WS_PRESERVE
preserve the white spaces- See Also:
- Constant Field Values
-
WS_REPLACE
static final short WS_REPLACE
replace the white spaces- See Also:
- Constant Field Values
-
WS_COLLAPSE
static final short WS_COLLAPSE
collapse the white spaces- See Also:
- Constant Field Values
-
PRIMITIVE_STRING
static final short PRIMITIVE_STRING
"string" type- See Also:
- Constant Field Values
-
PRIMITIVE_BOOLEAN
static final short PRIMITIVE_BOOLEAN
"boolean" type- See Also:
- Constant Field Values
-
PRIMITIVE_DECIMAL
static final short PRIMITIVE_DECIMAL
"decimal" type- See Also:
- Constant Field Values
-
PRIMITIVE_FLOAT
static final short PRIMITIVE_FLOAT
"float" type- See Also:
- Constant Field Values
-
PRIMITIVE_DOUBLE
static final short PRIMITIVE_DOUBLE
"double" type- See Also:
- Constant Field Values
-
PRIMITIVE_DURATION
static final short PRIMITIVE_DURATION
"duration" type- See Also:
- Constant Field Values
-
PRIMITIVE_DATETIME
static final short PRIMITIVE_DATETIME
"dataTime" type- See Also:
- Constant Field Values
-
PRIMITIVE_TIME
static final short PRIMITIVE_TIME
"time" type- See Also:
- Constant Field Values
-
PRIMITIVE_DATE
static final short PRIMITIVE_DATE
"date" type- See Also:
- Constant Field Values
-
PRIMITIVE_GYEARMONTH
static final short PRIMITIVE_GYEARMONTH
"gYearMonth" type- See Also:
- Constant Field Values
-
PRIMITIVE_GYEAR
static final short PRIMITIVE_GYEAR
"gYear" type- See Also:
- Constant Field Values
-
PRIMITIVE_GMONTHDAY
static final short PRIMITIVE_GMONTHDAY
"gMonthDay" type- See Also:
- Constant Field Values
-
PRIMITIVE_GDAY
static final short PRIMITIVE_GDAY
"gDay" type- See Also:
- Constant Field Values
-
PRIMITIVE_GMONTH
static final short PRIMITIVE_GMONTH
"gMonth" type- See Also:
- Constant Field Values
-
PRIMITIVE_HEXBINARY
static final short PRIMITIVE_HEXBINARY
"hexBinary" type- See Also:
- Constant Field Values
-
PRIMITIVE_BASE64BINARY
static final short PRIMITIVE_BASE64BINARY
"base64Binary" type- See Also:
- Constant Field Values
-
PRIMITIVE_ANYURI
static final short PRIMITIVE_ANYURI
"anyURI" type- See Also:
- Constant Field Values
-
PRIMITIVE_QNAME
static final short PRIMITIVE_QNAME
"QName" type- See Also:
- Constant Field Values
-
PRIMITIVE_PRECISIONDECIMAL
static final short PRIMITIVE_PRECISIONDECIMAL
"precisionDecimal" type- See Also:
- Constant Field Values
-
PRIMITIVE_NOTATION
static final short PRIMITIVE_NOTATION
"NOTATION" type- See Also:
- Constant Field Values
-
-
Method Detail
-
getPrimitiveKind
short getPrimitiveKind()
return an ID representing the built-in primitive base type. REVISIT: This method is (currently) for internal use only. the constants returned from this method are not finalized yet. the names and values might change in the further.- Returns:
- an ID representing the built-in primitive base type
-
validate
java.lang.Object validate(java.lang.String content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueExceptionvalidate a given string against this simple type.- Parameters:
content- the string value that needs to be validatedcontext- the validation contextvalidatedInfo- used to store validation result- Returns:
- the actual value (QName, Boolean) of the string value
- Throws:
InvalidDatatypeValueException
-
validate
java.lang.Object validate(java.lang.Object content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueExceptionvalidate a given string value, represented by content.toString(). note that if content is a StringBuffer, for performance reasons, it's possible that the content of the string buffer is modified.- Parameters:
content- the string value that needs to be validatedcontext- the validation contextvalidatedInfo- used to store validation result- Returns:
- the actual value (QName, Boolean) of the string value
- Throws:
InvalidDatatypeValueException
-
validate
void validate(ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
Validate an actual value against this simple type.- Parameters:
context- the validation contextvalidatedInfo- used to provide the actual value and member types- Throws:
InvalidDatatypeValueException- exception for invalid values.
-
applyFacets
void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context) throws InvalidDatatypeFacetException
If this type is created from restriction, then some facets can be applied to the simple type.XSFacetsis used to pass the value of different facets.- Parameters:
facets- the value of all the facetspresentFacet- bit combination value of the costraining facet constants which are present.fixedFacet- bit combination value of the costraining facet constants which are fixed.context- the validation context- Throws:
InvalidDatatypeFacetException- exception for invalid facet values.
-
isEqual
boolean isEqual(java.lang.Object value1, java.lang.Object value2)Check whether two actual values are equal.- Parameters:
value1- the first valuevalue2- the second value- Returns:
- true if the two value are equal
-
isIDType
boolean isIDType()
Check whether this type is or is derived from ID. REVISIT: this method makes ID special, which is not a good design. but since ID is not a primitive, there doesn't seem to be a clean way of doing it except to define special method like this.- Returns:
- whether this simple type is or is derived from ID.
-
getWhitespace
short getWhitespace() throws DatatypeExceptionReturn the whitespace corresponding to this datatype.- Returns:
- valid values are WS_PRESERVE, WS_REPLACE, WS_COLLAPSE.
- Throws:
DatatypeException- union datatypes don't have whitespace facet associated with them
-
-