public class

XSSimpleTypeDecl

extends Object
implements XSSimpleType TypeInfo
java.lang.Object
   ↳ org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl

Class Overview

@xerces.internal

Summary

Constants
short ANYATOMICTYPE_DT
short DAYTIMEDURATION_DT
short PRECISIONDECIMAL_DT
short YEARMONTHDURATION_DT
[Expand]
Inherited Constants
From interface org.apache.xerces.impl.dv.XSSimpleType
From interface org.apache.xerces.xs.XSSimpleTypeDefinition
From interface org.apache.xerces.xs.XSTypeDefinition
From interface org.w3c.dom.TypeInfo
Fields
public XSObjectList enumerationAnnotations
public XSAnnotation fractionDigitsAnnotation
public XSAnnotation lengthAnnotation
public XSAnnotation maxExclusiveAnnotation
public XSAnnotation maxInclusiveAnnotation
public XSAnnotation maxLengthAnnotation
public XSAnnotation minExclusiveAnnotation
public XSAnnotation minInclusiveAnnotation
public XSAnnotation minLengthAnnotation
public XSObjectListImpl patternAnnotations
public XSAnnotation totalDigitsAnnotation
public XSAnnotation whiteSpaceAnnotation
Public Constructors
XSSimpleTypeDecl()
Protected Constructors
XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, short validateDV, short ordered, boolean bounded, boolean finite, boolean numeric, boolean isImmutable, short builtInKind)
XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, XSObjectList annotations, short builtInKind)
XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, XSObjectList annotations)
XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, boolean isImmutable, XSObjectList annotations)
XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, XSObjectList annotations)
Public Methods
void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context)
If is chosen
boolean derivedFrom(String ancestorNS, String ancestorName, short derivation)
Convenience method which checks if this type is derived from the given ancestor type.
boolean derivedFromType(XSTypeDefinition ancestor, short derivation)
Convenience method which checks if this type is derived from the given ancestorType.
ObjectList getActualEnumeration()
A list of actual enumeration values if it exists, otherwise an empty ObjectList.
XSObjectList getAnnotations()
[annotations]: a set of annotations for this simple type component if it exists, otherwise an empty XSObjectList.
boolean getAnonymous()
Convenience attribute.
XSTypeDefinition getBaseType()
{base type definition}: either a simple type definition or a complex type definition.
boolean getBounded()
Fundamental Facet: bounded.
short getBuiltInKind()
Returns the closest built-in type category this type represents or derived from.
short getDefinedFacets()
[facets]: all facets defined on this type.
ObjectList getEnumerationItemTypeList()
A list of enumeration type values (as a list of ShortList objects) if it exists, otherwise returns null
ShortList getEnumerationTypeList()
XSObjectList getFacets()
A list of constraining facets if it exists, otherwise an empty XSObjectList.
short getFinal()
For complex types the returned value is a bit combination of the subset of {DERIVATION_EXTENSION, DERIVATION_RESTRICTION} corresponding to final set of this type or DERIVATION_NONE.
boolean getFinite()
Fundamental Facet: cardinality.
short getFixedFacets()
[facets]: all defined facets for this type which are fixed.
XSSimpleTypeDefinition getItemType()
If variety is list the item type definition (an atomic or union simple type definition) is available, otherwise null.
StringList getLexicalEnumeration()
A list of enumeration values if it exists, otherwise an empty StringList.
String getLexicalFacetValue(short facetName)
Convenience method.
StringList getLexicalPattern()
A list of pattern values if it exists, otherwise an empty StringList.
Object getMaxExclusiveValue()
Object getMaxInclusiveValue()
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.
Object getMinExclusiveValue()
Object getMinInclusiveValue()
XSObjectList getMultiValueFacets()
A list of enumeration and pattern constraining facets if it exists, otherwise an empty XSObjectList.
String getName()
The name of type NCName, as defined in XML Namespaces, of this declaration specified in the {name} property of the component or null if the definition of this component does not have a {name} property.
String getNamespace()
The [target namespace] of this object, or null if it is unspecified.
XSNamespaceItem getNamespaceItem()
A namespace schema information item corresponding to the target namespace of the component, if it is globally declared; or null otherwise.
boolean getNumeric()
Fundamental Facet: numeric.
short getOrdered()
Fundamental Facet: ordered.
short getPrimitiveKind()
return an ID representing the built-in primitive base type.
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.
short getType()
The type of this object, i.e.
short getTypeCategory()
Return whether this type definition is a simple type or complex type.
String getTypeName()
String getTypeNamespace()
short getVariety()
[variety]: one of {atomic, list, union} or absent.
short getWhitespace()
Return the whitespace corresponding to this datatype.
boolean isDOMDerivedFrom(String ancestorNS, String ancestorName, int derivationMethod)
Checks if a type is derived from another by restriction, given the name and namespace.
boolean isDefinedFacet(short facetName)
Convenience method.
boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)
boolean isEqual(Object value1, Object value2)
Check whether two actual values are equal.
boolean isFinal(short derivation)
{final}.
boolean isFixedFacet(short facetName)
Convenience method.
boolean isIDType()
Check whether this type is or is derived from ID.
boolean isIdentical(Object value1, Object value2)
static String normalize(String content, short ws)
void reset()
void setAnonymous(boolean anon)
String toString()
void validate(ValidationContext context, ValidatedInfo validatedInfo)
validate an actual value against this DV
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
ValidatedInfo validateWithInfo(String content, ValidationContext context, ValidatedInfo validatedInfo)
validate a value, and return the compiled form
Protected Methods
String normalize(Object content, short ws)
XSSimpleTypeDecl setListValues(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, XSObjectList annotations)
XSSimpleTypeDecl setRestrictionValues(XSSimpleTypeDecl base, String name, String uri, short finalSet, XSObjectList annotations)
XSSimpleTypeDecl setUnionValues(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, XSObjectList annotations)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.xerces.impl.dv.XSSimpleType
From interface org.apache.xerces.xs.XSObject
From interface org.apache.xerces.xs.XSSimpleTypeDefinition
From interface org.apache.xerces.xs.XSTypeDefinition
From interface org.w3c.dom.TypeInfo

Constants

public static final short ANYATOMICTYPE_DT

Constant Value: 49 (0x00000031)

public static final short DAYTIMEDURATION_DT

Constant Value: 47 (0x0000002f)

public static final short PRECISIONDECIMAL_DT

Constant Value: 48 (0x00000030)

public static final short YEARMONTHDURATION_DT

Constant Value: 46 (0x0000002e)

Fields

public XSObjectList enumerationAnnotations

public XSAnnotation fractionDigitsAnnotation

public XSAnnotation lengthAnnotation

public XSAnnotation maxExclusiveAnnotation

public XSAnnotation maxInclusiveAnnotation

public XSAnnotation maxLengthAnnotation

public XSAnnotation minExclusiveAnnotation

public XSAnnotation minInclusiveAnnotation

public XSAnnotation minLengthAnnotation

public XSObjectListImpl patternAnnotations

public XSAnnotation totalDigitsAnnotation

public XSAnnotation whiteSpaceAnnotation

Public Constructors

public XSSimpleTypeDecl ()

Protected Constructors

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)

Public Methods

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

If is chosen

Parameters
facets the value of all the facets
presentFacet 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

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

Convenience method which checks if this type is derived from the given ancestor type.

Parameters
ancestorNS An ancestor type namespace.
ancestorName An ancestor type name.
derivation A bit combination representing a subset of { DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST }.
Returns
  • True if this type is derived from ancestorType using only derivation methods from the derivationMethod .

public boolean derivedFromType (XSTypeDefinition ancestor, short derivation)

Convenience method which checks if this type is derived from the given ancestorType.

Parameters
ancestor An ancestor type definition.
derivation A bit combination representing a subset of { DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST }.
Returns
  • True if this type is derived from ancestorType using only derivation methods from the derivationMethod .

public ObjectList getActualEnumeration ()

A list of actual enumeration values if it exists, otherwise an empty ObjectList.

public XSObjectList getAnnotations ()

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

public boolean getAnonymous ()

Convenience attribute. A boolean that specifies if the type definition is anonymous.

public XSTypeDefinition getBaseType ()

{base type definition}: either a simple type definition or a complex type definition.

public boolean getBounded ()

Fundamental Facet: bounded.

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.

public short getDefinedFacets ()

[facets]: all facets defined on this type. The value is a bit combination of FACET_XXX constants of all defined facets.

public ObjectList getEnumerationItemTypeList ()

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

public ShortList getEnumerationTypeList ()

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.

public short getFinal ()

For complex types the returned value is a bit combination of the subset of {DERIVATION_EXTENSION, DERIVATION_RESTRICTION} corresponding to final set of this type or DERIVATION_NONE. For simple types the returned value is a bit combination of the subset of { DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST } corresponding to final set of this type or DERIVATION_NONE.

public boolean getFinite ()

Fundamental Facet: cardinality.

public short getFixedFacets ()

[facets]: all defined facets for this type which are fixed.

public XSSimpleTypeDefinition getItemType ()

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

public StringList getLexicalEnumeration ()

A list of enumeration values if it exists, otherwise an empty StringList.

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.

public StringList getLexicalPattern ()

A list of pattern values if it exists, otherwise an empty StringList.

public Object getMaxExclusiveValue ()

public Object getMaxInclusiveValue ()

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.

public Object getMinExclusiveValue ()

public Object getMinInclusiveValue ()

public XSObjectList getMultiValueFacets ()

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

public String getName ()

The name of type NCName, as defined in XML Namespaces, of this declaration specified in the {name} property of the component or null if the definition of this component does not have a {name} property. For anonymous types, the processor must construct and expose an anonymous type name that is distinct from the name of every named type and the name of every other anonymous type.

public String getNamespace ()

The [target namespace] of this object, or null if it is unspecified.

public XSNamespaceItem getNamespaceItem ()

A namespace schema information item corresponding to the target namespace of the component, if it is globally declared; or null otherwise.

public boolean getNumeric ()

Fundamental Facet: numeric.

public short getOrdered ()

Fundamental Facet: ordered.

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.

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

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.

public short getType ()

The type of this object, i.e. ELEMENT_DECLARATION.

public short getTypeCategory ()

Return whether this type definition is a simple type or complex type.

public String getTypeName ()

public String getTypeNamespace ()

public short getVariety ()

[variety]: one of {atomic, list, union} or absent.

public short getWhitespace ()

Return the whitespace corresponding to this datatype.

Returns
  • valid values are WS_PRESERVE, WS_REPLACE, WS_COLLAPSE.

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.

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.

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

public boolean isEqual (Object value1, Object value2)

Check whether two actual values are equal.

Parameters
value1 the first value
value2 the second value
Returns
  • true if the two value are equal

public boolean isFinal (short derivation)

{final}. For a complex type definition it is a subset of {extension, restriction}. For a simple type definition it is a subset of {extension, list, restriction, union}.

Parameters
derivation Extension, restriction, list, union constants (defined in XSConstants).
Returns
  • True if restriction is in the final set, otherwise false.

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.

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.

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

public boolean isIdentical (Object value1, Object value2)

public static String normalize (String content, short ws)

public void reset ()

public void setAnonymous (boolean anon)

public String toString ()

See Also

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

public Object validate (Object content, ValidationContext context, ValidatedInfo validatedInfo)

validate a value, and return the compiled form

Parameters
content the string value that needs to be validated
context the validation context
validatedInfo used to store validation result
Returns
  • the actual value (QName, Boolean) of the string value

public Object validate (String content, ValidationContext context, ValidatedInfo validatedInfo)

validate a value, and return the compiled form

Parameters
content the string value that needs to be validated
context the validation context
validatedInfo used to store validation result
Returns
  • the actual value (QName, Boolean) of the string value

public ValidatedInfo validateWithInfo (String content, ValidationContext context, ValidatedInfo validatedInfo)

validate a value, and return the compiled form

Protected Methods

protected String normalize (Object content, short ws)

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

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

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