org.apache.xerces.impl.dv.xs

Class XSSimpleTypeDecl

Implemented Interfaces:
org.apache.xerces.xs.XSObject, XSSimpleType, org.apache.xerces.xs.XSSimpleTypeDefinition, org.apache.xerces.xs.XSTypeDefinition

public class XSSimpleTypeDecl
extends java.lang.Object
implements XSSimpleType

Version:
$Id: XSSimpleTypeDecl.java,v 1.48 2004/01/19 15:30:20 sandygao Exp $

Authors:
Sandy Gao, IBM
Neeraj Bajaj, Sun Microsystems, inc.

Field Summary

org.apache.xerces.xs.XSObjectList
enumerationAnnotations
org.apache.xerces.xs.XSAnnotation
fractionDigitsAnnotation
org.apache.xerces.xs.XSAnnotation
lengthAnnotation
org.apache.xerces.xs.XSAnnotation
maxExclusiveAnnotation
org.apache.xerces.xs.XSAnnotation
maxInclusiveAnnotation
org.apache.xerces.xs.XSAnnotation
maxLengthAnnotation
org.apache.xerces.xs.XSAnnotation
minExclusiveAnnotation
org.apache.xerces.xs.XSAnnotation
minInclusiveAnnotation
org.apache.xerces.xs.XSAnnotation
minLengthAnnotation
XSObjectListImpl
patternAnnotations
org.apache.xerces.xs.XSAnnotation
totalDigitsAnnotation
org.apache.xerces.xs.XSAnnotation
whiteSpaceAnnotation

Fields inherited from interface org.apache.xerces.impl.dv.XSSimpleType

PRIMITIVE_ANYURI, PRIMITIVE_BASE64BINARY, PRIMITIVE_BOOLEAN, PRIMITIVE_DATE, PRIMITIVE_DATETIME, PRIMITIVE_DECIMAL, PRIMITIVE_DOUBLE, PRIMITIVE_DURATION, PRIMITIVE_FLOAT, PRIMITIVE_GDAY, PRIMITIVE_GMONTH, PRIMITIVE_GMONTHDAY, PRIMITIVE_GYEAR, PRIMITIVE_GYEARMONTH, PRIMITIVE_HEXBINARY, PRIMITIVE_NOTATION, PRIMITIVE_QNAME, PRIMITIVE_STRING, PRIMITIVE_TIME, WS_COLLAPSE, WS_PRESERVE, WS_REPLACE

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

Fields inherited from interface org.apache.xerces.xs.XSTypeDefinition

COMPLEX_TYPE, SIMPLE_TYPE

Constructor Summary

XSSimpleTypeDecl()
XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, boolean isImmutable, org.apache.xerces.xs.XSObjectList annotations)
XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl memberTypes, org.apache.xerces.xs.XSObjectList annotations)
XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, org.apache.xerces.xs.XSObjectList annotations)
XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, org.apache.xerces.xs.XSObjectList annotations, short builtInKind)
XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, short validateDV, short ordered, boolean bounded, boolean finite, boolean numeric, boolean isImmutable, short builtInKind)

Method Summary

void
applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context)
If is chosen
boolean
derivedFrom(String ancestorNS, String ancestorName, short derivation)
boolean
derivedFromType(org.apache.xerces.xs.XSTypeDefinition ancestor, short derivation)
org.apache.xerces.xs.XSObjectList
getAnnotations()
boolean
getAnonymous()
org.apache.xerces.xs.XSTypeDefinition
getBaseType()
boolean
getBounded()
short
getBuiltInKind()
short
getDefinedFacets()
org.apache.xerces.xs.XSObjectList
getFacets()
short
getFinal()
boolean
getFinite()
short
getFixedFacets()
org.apache.xerces.xs.XSSimpleTypeDefinition
getItemType()
org.apache.xerces.xs.StringList
getLexicalEnumeration()
String
getLexicalFacetValue(short facetName)
org.apache.xerces.xs.StringList
getLexicalPattern()
org.apache.xerces.xs.XSObjectList
getMemberTypes()
org.apache.xerces.xs.XSObjectList
getMultiValueFacets()
String
getName()
String
getNamespace()
org.apache.xerces.xs.XSNamespaceItem
getNamespaceItem()
boolean
getNumeric()
short
getOrdered()
short
getPrimitiveKind()
return an ID representing the built-in primitive base type.
org.apache.xerces.xs.XSSimpleTypeDefinition
getPrimitiveType()
short
getType()
short
getTypeCategory()
short
getVariety()
short
getWhitespace()
Return the whitespace corresponding to this datatype.
boolean
isDefinedFacet(short facetName)
boolean
isEqual(Object value1, Object value2)
Check whether two actual values are equal.
boolean
isFinal(short derivation)
boolean
isFixedFacet(short facetName)
boolean
isIDType()
Check whether this type is or is derived from ID.
protected String
normalize(Object content, short ws)
static String
normalize(String content, short ws)
void
reset()
protected XSSimpleTypeDecl
setListValues(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, org.apache.xerces.xs.XSObjectList annotations)
protected XSSimpleTypeDecl
setRestrictionValues(XSSimpleTypeDecl base, String name, String uri, short finalSet, org.apache.xerces.xs.XSObjectList annotations)
protected XSSimpleTypeDecl
setUnionValues(String name, String uri, short finalSet, XSSimpleTypeDecl memberTypes, org.apache.xerces.xs.XSObjectList annotations)
String
toString()
Object
validate(Object content, ValidationContext context, ValidatedInfo validatedInfo)
validate a value, and return the compiled form
Object
validate(String content, ValidationContext context, ValidatedInfo validatedInfo)
validate a value, and return the compiled form
void
validate(ValidationContext context, ValidatedInfo validatedInfo)
validate an actual value against this DV

Field Details

enumerationAnnotations

public org.apache.xerces.xs.XSObjectList enumerationAnnotations


fractionDigitsAnnotation

public org.apache.xerces.xs.XSAnnotation fractionDigitsAnnotation


lengthAnnotation

public org.apache.xerces.xs.XSAnnotation lengthAnnotation


maxExclusiveAnnotation

public org.apache.xerces.xs.XSAnnotation maxExclusiveAnnotation


maxInclusiveAnnotation

public org.apache.xerces.xs.XSAnnotation maxInclusiveAnnotation


maxLengthAnnotation

public org.apache.xerces.xs.XSAnnotation maxLengthAnnotation


minExclusiveAnnotation

public org.apache.xerces.xs.XSAnnotation minExclusiveAnnotation


minInclusiveAnnotation

public org.apache.xerces.xs.XSAnnotation minInclusiveAnnotation


minLengthAnnotation

public org.apache.xerces.xs.XSAnnotation minLengthAnnotation


patternAnnotations

public XSObjectListImpl patternAnnotations


totalDigitsAnnotation

public org.apache.xerces.xs.XSAnnotation totalDigitsAnnotation


whiteSpaceAnnotation

public org.apache.xerces.xs.XSAnnotation whiteSpaceAnnotation

Constructor Details

XSSimpleTypeDecl

public XSSimpleTypeDecl()


XSSimpleTypeDecl

protected XSSimpleTypeDecl(String name,
                           String uri,
                           short finalSet,
                           XSSimpleTypeDecl itemType,
                           boolean isImmutable,
                           org.apache.xerces.xs.XSObjectList annotations)


XSSimpleTypeDecl

protected XSSimpleTypeDecl(String name,
                           String uri,
                           short finalSet,
                           XSSimpleTypeDecl memberTypes,
                           org.apache.xerces.xs.XSObjectList annotations)


XSSimpleTypeDecl

protected XSSimpleTypeDecl(XSSimpleTypeDecl base,
                           String name,
                           String uri,
                           short finalSet,
                           boolean isImmutable,
                           org.apache.xerces.xs.XSObjectList annotations)


XSSimpleTypeDecl

protected XSSimpleTypeDecl(XSSimpleTypeDecl base,
                           String name,
                           String uri,
                           short finalSet,
                           boolean isImmutable,
                           org.apache.xerces.xs.XSObjectList annotations,
                           short builtInKind)


XSSimpleTypeDecl

protected XSSimpleTypeDecl(XSSimpleTypeDecl base,
                           String name,
                           short validateDV,
                           short ordered,
                           boolean bounded,
                           boolean finite,
                           boolean numeric,
                           boolean isImmutable,
                           short builtInKind)

Method Details

applyFacets

public void applyFacets(XSFacets facets,
                        short presentFacet,
                        short fixedFacet,
                        ValidationContext context)
            throws InvalidDatatypeFacetException
If is chosen
Specified by:
applyFacets in interface XSSimpleType


derivedFrom

public boolean derivedFrom(String ancestorNS,
                           String ancestorName,
                           short derivation)
Specified by:
derivedFrom in interface org.apache.xerces.xs.XSTypeDefinition


derivedFromType

public boolean derivedFromType(org.apache.xerces.xs.XSTypeDefinition ancestor,
                               short derivation)
Specified by:
derivedFromType in interface org.apache.xerces.xs.XSTypeDefinition


getAnnotations

public org.apache.xerces.xs.XSObjectList getAnnotations()
Specified by:
getAnnotations in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getAnonymous

public boolean getAnonymous()
Specified by:
getAnonymous in interface org.apache.xerces.xs.XSTypeDefinition


getBaseType

public org.apache.xerces.xs.XSTypeDefinition getBaseType()
Specified by:
getBaseType in interface org.apache.xerces.xs.XSTypeDefinition


getBounded

public boolean getBounded()
Specified by:
getBounded in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getBuiltInKind

public short getBuiltInKind()
Specified by:
getBuiltInKind in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getDefinedFacets

public short getDefinedFacets()
Specified by:
getDefinedFacets in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getFacets

public org.apache.xerces.xs.XSObjectList getFacets()
Specified by:
getFacets in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getFinal

public short getFinal()
Specified by:
getFinal in interface org.apache.xerces.xs.XSTypeDefinition


getFinite

public boolean getFinite()
Specified by:
getFinite in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getFixedFacets

public short getFixedFacets()
Specified by:
getFixedFacets in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getItemType

public org.apache.xerces.xs.XSSimpleTypeDefinition getItemType()
Specified by:
getItemType in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getLexicalEnumeration

public org.apache.xerces.xs.StringList getLexicalEnumeration()
Specified by:
getLexicalEnumeration in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getLexicalFacetValue

public String getLexicalFacetValue(short facetName)
Specified by:
getLexicalFacetValue in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getLexicalPattern

public org.apache.xerces.xs.StringList getLexicalPattern()
Specified by:
getLexicalPattern in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getMemberTypes

public org.apache.xerces.xs.XSObjectList getMemberTypes()
Specified by:
getMemberTypes in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getMultiValueFacets

public org.apache.xerces.xs.XSObjectList getMultiValueFacets()
Specified by:
getMultiValueFacets in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getName

public String getName()
Specified by:
getName in interface org.apache.xerces.xs.XSObject


getNamespace

public String getNamespace()
Specified by:
getNamespace in interface org.apache.xerces.xs.XSObject


getNamespaceItem

public org.apache.xerces.xs.XSNamespaceItem getNamespaceItem()
Specified by:
getNamespaceItem in interface org.apache.xerces.xs.XSObject

See Also:
org.apache.xerces.xs.XSObject.getNamespaceItem()


getNumeric

public boolean getNumeric()
Specified by:
getNumeric in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getOrdered

public short getOrdered()
Specified by:
getOrdered in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getPrimitiveKind

public 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.
Specified by:
getPrimitiveKind in interface XSSimpleType

Returns:
an ID representing the built-in primitive base type


getPrimitiveType

public org.apache.xerces.xs.XSSimpleTypeDefinition getPrimitiveType()
Specified by:
getPrimitiveType in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getType

public short getType()
Specified by:
getType in interface org.apache.xerces.xs.XSObject


getTypeCategory

public short getTypeCategory()
Specified by:
getTypeCategory in interface org.apache.xerces.xs.XSTypeDefinition


getVariety

public short getVariety()
Specified by:
getVariety in interface org.apache.xerces.xs.XSSimpleTypeDefinition


getWhitespace

public short getWhitespace()
            throws DatatypeException
Return the whitespace corresponding to this datatype.
Specified by:
getWhitespace in interface XSSimpleType

Returns:
valid values are WS_PRESERVE, WS_REPLACE, WS_COLLAPSE.

Throws:
DatatypeException - union datatypes don't have whitespace facet associated with them


isDefinedFacet

public boolean isDefinedFacet(short facetName)
Specified by:
isDefinedFacet in interface org.apache.xerces.xs.XSSimpleTypeDefinition


isEqual

public boolean isEqual(Object value1,
                       Object value2)
Check whether two actual values are equal.
Specified by:
isEqual in interface XSSimpleType

Parameters:
value1 - the first value
value2 - the second value

Returns:
true if the two value are equal


isFinal

public boolean isFinal(short derivation)
Specified by:
isFinal in interface org.apache.xerces.xs.XSTypeDefinition


isFixedFacet

public boolean isFixedFacet(short facetName)
Specified by:
isFixedFacet in interface org.apache.xerces.xs.XSSimpleTypeDefinition


isIDType

public 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.
Specified by:
isIDType in interface XSSimpleType

Returns:
whether this simple type is or is derived from ID.


normalize

protected String normalize(Object content,
                           short ws)


normalize

public static String normalize(String content,
                               short ws)


reset

public void reset()


setListValues

protected XSSimpleTypeDecl setListValues(String name,
                                         String uri,
                                         short finalSet,
                                         XSSimpleTypeDecl itemType,
                                         org.apache.xerces.xs.XSObjectList annotations)


setRestrictionValues

protected XSSimpleTypeDecl setRestrictionValues(XSSimpleTypeDecl base,
                                                String name,
                                                String uri,
                                                short finalSet,
                                                org.apache.xerces.xs.XSObjectList annotations)


setUnionValues

protected XSSimpleTypeDecl setUnionValues(String name,
                                          String uri,
                                          short finalSet,
                                          XSSimpleTypeDecl memberTypes,
                                          org.apache.xerces.xs.XSObjectList annotations)


toString

public String toString()

See Also:
java.lang.Object.toString()


validate

public Object validate(Object content,
                       ValidationContext context,
                       ValidatedInfo validatedInfo)
            throws InvalidDatatypeValueException
validate a value, and return the compiled form
Specified by:
validate in interface XSSimpleType


validate

public Object validate(String content,
                       ValidationContext context,
                       ValidatedInfo validatedInfo)
            throws InvalidDatatypeValueException
validate a value, and return the compiled form
Specified by:
validate in interface XSSimpleType


validate

public void validate(ValidationContext context,
                     ValidatedInfo validatedInfo)
            throws InvalidDatatypeValueException
validate an actual value against this DV
Specified by:
validate in interface XSSimpleType

Parameters:
context - the validation context
validatedInfo - used to provide the actual value and member types


Copyright B) 1999-2004 Apache XML Project. All Rights Reserved.