org.apache.xerces.impl.dv.xs

Class XSSimpleTypeDecl

public class XSSimpleTypeDecl extends Object implements XSSimpleType, TypeInfo

Version: $Id: XSSimpleTypeDecl.java,v 1.74 2005/06/24 17:19:21 mrglavas Exp $

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

UNKNOWN:

Field Summary
static shortANYATOMICTYPE_DT
static shortDAYTIMEDURATION_DT
XSObjectListenumerationAnnotations
XSAnnotationfractionDigitsAnnotation
XSAnnotationlengthAnnotation
XSAnnotationmaxExclusiveAnnotation
XSAnnotationmaxInclusiveAnnotation
XSAnnotationmaxLengthAnnotation
XSAnnotationminExclusiveAnnotation
XSAnnotationminInclusiveAnnotation
XSAnnotationminLengthAnnotation
XSObjectListImplpatternAnnotations
static shortPRECISIONDECIMAL_DT
XSAnnotationtotalDigitsAnnotation
XSAnnotationwhiteSpaceAnnotation
static shortYEARMONTHDURATION_DT
Constructor Summary
XSSimpleTypeDecl()
protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, short validateDV, short ordered, boolean bounded, boolean finite, boolean numeric, boolean isImmutable, short builtInKind)
protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, XSObjectList annotations, short builtInKind)
protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, XSObjectList annotations)
protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, boolean isImmutable, XSObjectList annotations)
protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, XSObjectList annotations)
Method Summary
voidapplyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context)
If is chosen
booleanderivedFrom(String ancestorNS, String ancestorName, short derivation)
booleanderivedFromType(XSTypeDefinition ancestor, short derivation)
ObjectListgetActualEnumeration()
A list of actual enumeration values if it exists, otherwise an empty ObjectList.
XSObjectListgetAnnotations()
[annotations]: a set of annotations for this simple type component if it exists, otherwise an empty XSObjectList.
booleangetAnonymous()
XSTypeDefinitiongetBaseType()
booleangetBounded()
Fundamental Facet: bounded.
shortgetBuiltInKind()
Returns the closest built-in type category this type represents or derived from.
shortgetDefinedFacets()
[facets]: all facets defined on this type.
ObjectListgetEnumerationItemTypeList()
A list of enumeration type values (as a list of ShortList objects) if it exists, otherwise returns null
ShortListgetEnumerationTypeList()
XSObjectListgetFacets()
A list of constraining facets if it exists, otherwise an empty XSObjectList.
shortgetFinal()
booleangetFinite()
Fundamental Facet: cardinality.
shortgetFixedFacets()
[facets]: all defined facets for this type which are fixed.
XSSimpleTypeDefinitiongetItemType()
If variety is list the item type definition (an atomic or union simple type definition) is available, otherwise null.
StringListgetLexicalEnumeration()
A list of enumeration values if it exists, otherwise an empty StringList.
StringgetLexicalFacetValue(short facetName)
Convenience method.
StringListgetLexicalPattern()
A list of pattern values if it exists, otherwise an empty StringList.
ObjectgetMaxExclusiveValue()
ObjectgetMaxInclusiveValue()
XSObjectListgetMemberTypes()
If variety is union the list of member type definitions (a non-empty sequence of simple type definitions) is available, otherwise an empty XSObjectList.
ObjectgetMinExclusiveValue()
ObjectgetMinInclusiveValue()
XSObjectListgetMultiValueFacets()
A list of enumeration and pattern constraining facets if it exists, otherwise an empty XSObjectList.
StringgetName()
StringgetNamespace()
XSNamespaceItemgetNamespaceItem()
booleangetNumeric()
Fundamental Facet: numeric.
shortgetOrdered()
Fundamental Facet: ordered.
shortgetPrimitiveKind()
XSSimpleTypeDefinitiongetPrimitiveType()
If variety is atomic the primitive type definition (a built-in primitive datatype definition or the simple ur-type definition) is available, otherwise null.
shortgetType()
shortgetTypeCategory()
StringgetTypeName()
StringgetTypeNamespace()
shortgetVariety()
shortgetWhitespace()
booleanisDefinedFacet(short facetName)
Convenience method.
booleanisDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)
booleanisDOMDerivedFrom(String ancestorNS, String ancestorName, int derivationMethod)
Checks if a type is derived from another by restriction, given the name and namespace.
booleanisEqual(Object value1, Object value2)
booleanisFinal(short derivation)
booleanisFixedFacet(short facetName)
Convenience method.
booleanisIdentical(Object value1, Object value2)
booleanisIDType()
static Stringnormalize(String content, short ws)
protected Stringnormalize(Object content, short ws)
voidreset()
voidsetAnonymous(boolean anon)
protected XSSimpleTypeDeclsetListValues(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, XSObjectList annotations)
protected XSSimpleTypeDeclsetRestrictionValues(XSSimpleTypeDecl base, String name, String uri, short finalSet, XSObjectList annotations)
protected XSSimpleTypeDeclsetUnionValues(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, XSObjectList annotations)
StringtoString()
Objectvalidate(String content, ValidationContext context, ValidatedInfo validatedInfo)
validate a value, and return the compiled form
Objectvalidate(Object content, ValidationContext context, ValidatedInfo validatedInfo)
validate a value, and return the compiled form
voidvalidate(ValidationContext context, ValidatedInfo validatedInfo)
validate an actual value against this DV
ValidatedInfovalidateWithInfo(String content, ValidationContext context, ValidatedInfo validatedInfo)
validate a value, and return the compiled form

Field Detail

ANYATOMICTYPE_DT

public static final short ANYATOMICTYPE_DT

DAYTIMEDURATION_DT

public static final short DAYTIMEDURATION_DT

enumerationAnnotations

public XSObjectList enumerationAnnotations

fractionDigitsAnnotation

public XSAnnotation fractionDigitsAnnotation

lengthAnnotation

public XSAnnotation lengthAnnotation

maxExclusiveAnnotation

public XSAnnotation maxExclusiveAnnotation

maxInclusiveAnnotation

public XSAnnotation maxInclusiveAnnotation

maxLengthAnnotation

public XSAnnotation maxLengthAnnotation

minExclusiveAnnotation

public XSAnnotation minExclusiveAnnotation

minInclusiveAnnotation

public XSAnnotation minInclusiveAnnotation

minLengthAnnotation

public XSAnnotation minLengthAnnotation

patternAnnotations

public XSObjectListImpl patternAnnotations

PRECISIONDECIMAL_DT

public static final short PRECISIONDECIMAL_DT

totalDigitsAnnotation

public XSAnnotation totalDigitsAnnotation

whiteSpaceAnnotation

public XSAnnotation whiteSpaceAnnotation

YEARMONTHDURATION_DT

public static final short YEARMONTHDURATION_DT

Constructor Detail

XSSimpleTypeDecl

public XSSimpleTypeDecl()

XSSimpleTypeDecl

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

XSSimpleTypeDecl

protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, XSObjectList annotations, short builtInKind)

XSSimpleTypeDecl

protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, XSObjectList annotations)

XSSimpleTypeDecl

protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, boolean isImmutable, XSObjectList annotations)

XSSimpleTypeDecl

protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, XSObjectList annotations)

Method Detail

applyFacets

public void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context)
If is chosen

derivedFrom

public boolean derivedFrom(String ancestorNS, String ancestorName, short derivation)

derivedFromType

public boolean derivedFromType(XSTypeDefinition ancestor, short derivation)

getActualEnumeration

public ObjectList getActualEnumeration()
A list of actual enumeration values if it exists, otherwise an empty ObjectList.

getAnnotations

public XSObjectList getAnnotations()
[annotations]: a set of annotations for this simple type component if it exists, otherwise an empty XSObjectList.

getAnonymous

public boolean getAnonymous()

getBaseType

public XSTypeDefinition getBaseType()

getBounded

public boolean getBounded()
Fundamental Facet: bounded.

getBuiltInKind

public short getBuiltInKind()
Returns the closest built-in type category this type represents or derived from. For example, if this simple type is a built-in derived type integer the INTEGER_DV is returned.

getDefinedFacets

public short getDefinedFacets()
[facets]: all facets defined on this type. The value is a bit combination of FACET_XXX constants of all defined facets.

getEnumerationItemTypeList

public ObjectList getEnumerationItemTypeList()
A list of enumeration type values (as a list of ShortList objects) if it exists, otherwise returns null

getEnumerationTypeList

public ShortList getEnumerationTypeList()

getFacets

public XSObjectList getFacets()
A list of constraining facets if it exists, otherwise an empty XSObjectList. Note: This method must not be used to retrieve values for enumeration and pattern facets.

getFinal

public short getFinal()

getFinite

public boolean getFinite()
Fundamental Facet: cardinality.

getFixedFacets

public short getFixedFacets()
[facets]: all defined facets for this type which are fixed.

getItemType

public XSSimpleTypeDefinition getItemType()
If variety is list the item type definition (an atomic or union simple type definition) is available, otherwise null.

getLexicalEnumeration

public StringList getLexicalEnumeration()
A list of enumeration values if it exists, otherwise an empty StringList.

getLexicalFacetValue

public String getLexicalFacetValue(short facetName)
Convenience method. Returns a value of a single constraining facet for this simple type definition. This method must not be used to retrieve values for enumeration and pattern facets.

Parameters: facetName The name of the facet, i.e. FACET_LENGTH, FACET_TOTALDIGITS (see XSConstants). To retrieve the value for a pattern or an enumeration, see enumeration and pattern.

Returns: A value of the facet specified in facetName for this simple type definition or null.

getLexicalPattern

public StringList getLexicalPattern()
A list of pattern values if it exists, otherwise an empty StringList.

getMaxExclusiveValue

public Object getMaxExclusiveValue()

getMaxInclusiveValue

public Object getMaxInclusiveValue()

getMemberTypes

public XSObjectList getMemberTypes()
If variety is union the list of member type definitions (a non-empty sequence of simple type definitions) is available, otherwise an empty XSObjectList.

getMinExclusiveValue

public Object getMinExclusiveValue()

getMinInclusiveValue

public Object getMinInclusiveValue()

getMultiValueFacets

public XSObjectList getMultiValueFacets()
A list of enumeration and pattern constraining facets if it exists, otherwise an empty XSObjectList.

getName

public String getName()

getNamespace

public String getNamespace()

getNamespaceItem

public XSNamespaceItem getNamespaceItem()

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

getNumeric

public boolean getNumeric()
Fundamental Facet: numeric.

getOrdered

public short getOrdered()
Fundamental Facet: ordered.

getPrimitiveKind

public short getPrimitiveKind()

getPrimitiveType

public XSSimpleTypeDefinition getPrimitiveType()
If variety is atomic the primitive type definition (a built-in primitive datatype definition or the simple ur-type definition) is available, otherwise null.

getType

public short getType()

getTypeCategory

public short getTypeCategory()

getTypeName

public String getTypeName()

getTypeNamespace

public String getTypeNamespace()

getVariety

public short getVariety()

getWhitespace

public short getWhitespace()

isDefinedFacet

public boolean isDefinedFacet(short facetName)
Convenience method. [Facets]: check whether a facet is defined on this type.

Parameters: facetName The name of the facet.

Returns: True if the facet is defined, false otherwise.

isDerivedFrom

public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)

isDOMDerivedFrom

public boolean isDOMDerivedFrom(String ancestorNS, String ancestorName, int derivationMethod)
Checks if a type is derived from another by restriction, given the name and namespace. See: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom

Parameters: ancestorNS The namspace of the ancestor type declaration ancestorName The name of the ancestor type declaration derivationMethod The derivation method

Returns: boolean True if the ancestor type is derived from the reference type by the specifiied derivation method.

isEqual

public boolean isEqual(Object value1, Object value2)

isFinal

public boolean isFinal(short derivation)

isFixedFacet

public boolean isFixedFacet(short facetName)
Convenience method. [Facets]: check whether a facet is defined and fixed on this type.

Parameters: facetName The name of the facet.

Returns: True if the facet is fixed, false otherwise.

isIdentical

public boolean isIdentical(Object value1, Object value2)

isIDType

public boolean isIDType()

normalize

public static String normalize(String content, short ws)

normalize

protected String normalize(Object content, short ws)

reset

public void reset()

setAnonymous

public void setAnonymous(boolean anon)

setListValues

protected XSSimpleTypeDecl setListValues(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, XSObjectList annotations)

setRestrictionValues

protected XSSimpleTypeDecl setRestrictionValues(XSSimpleTypeDecl base, String name, String uri, short finalSet, XSObjectList annotations)

setUnionValues

protected XSSimpleTypeDecl setUnionValues(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, XSObjectList annotations)

toString

public String toString()

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

validate

public Object validate(String content, ValidationContext context, ValidatedInfo validatedInfo)
validate a value, and return the compiled form

validate

public Object validate(Object content, ValidationContext context, ValidatedInfo validatedInfo)
validate a value, and return the compiled form

validate

public void validate(ValidationContext context, ValidatedInfo validatedInfo)
validate an actual value against this DV

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

validateWithInfo

public ValidatedInfo validateWithInfo(String content, ValidationContext context, ValidatedInfo validatedInfo)
validate a value, and return the compiled form
Copyright B) 1999-2005 Apache XML Project. All Rights Reserved.