Top Inners Fields Constructors Methods
org.apache.xerces.impl.dv.xs

public Class XSSimpleTypeDecl

extends Object
implements XSSimpleType, TypeInfo
Class Inheritance
All Implemented Interfaces
org.w3c.dom.TypeInfo, org.apache.xerces.impl.dv.XSSimpleType, org.apache.xerces.xs.XSSimpleTypeDefinition, org.apache.xerces.xs.XSTypeDefinition, org.apache.xerces.xs.XSObject
Imports
java.math.BigInteger, java.util.AbstractList, .Locale, .StringTokenizer, .Vector, org.apache.xerces.impl.Constants, org.apache.xerces.impl.dv.DatatypeException, .InvalidDatatypeFacetException, .InvalidDatatypeValueException, .ValidatedInfo, .ValidationContext, .XSFacets, .XSSimpleType, org.apache.xerces.impl.xpath.regex.RegularExpression, org.apache.xerces.impl.xs.SchemaSymbols, org.apache.xerces.impl.xs.util.ObjectListImpl, .ShortListImpl, .StringListImpl, .XSObjectListImpl, org.apache.xerces.util.XMLChar, org.apache.xerces.xni.NamespaceContext, org.apache.xerces.xs.ShortList, .StringList, .XSAnnotation, .XSConstants, .XSFacet, .XSMultiValueFacet, .XSNamespaceItem, .XSObject, .XSObjectList, .XSSimpleTypeDefinition, .XSTypeDefinition, org.apache.xerces.xs.datatypes.ObjectList, org.w3c.dom.TypeInfo

Authors
Sandy Gao, IBM, Neeraj Bajaj, Sun Microsystems, inc.
Version
$Id: XSSimpleTypeDecl.java 1891772 2021-07-24 11:51:11Z mukulg $

Nested and Inner Type Summary

Modifier and TypeClass and Description
private abstract static class
pack-priv static class
XSSimpleTypeDecl.ValidationContextImpl

A wrapper of ValidationContext, to provide a way of switching to a different Namespace declaration context.

private static class
private static class

Field Summary

Modifier and TypeField and Description
pack-priv static final String
public static final short
public static final short
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
protected static final short
public XSObjectList
private ObjectList
private XSObjectList
private boolean
pack-priv static final XSSimpleTypeDecl
pack-priv static final XSSimpleTypeDecl
private XSSimpleTypeDecl
private boolean
private short
pack-priv static final ValidationContext
fDummyContext

Validation context used to validate facet values.

pack-priv static final short[]
private TypeValidator[]
pack-priv static final ValidationContext
private ValidatedInfo[]
private ObjectList
private int
private ShortList
private XSObjectListImpl
private short
private short
private boolean
private short
private int
private boolean
private XSSimpleTypeDecl
private int
private StringList
private StringList
private Object
private Object
private int
private XSSimpleTypeDecl[]
private Object
private Object
private int
private XSObjectListImpl
private XSNamespaceItem
private boolean
private short
private Vector<E>
private Vector<E>
private short
public XSAnnotation
private String
private int
private String
private short
private short
private short
private static final TypeValidator[]
public XSAnnotation
public XSAnnotation
public XSAnnotation
public XSAnnotation
public XSAnnotation
public XSAnnotation
public XSAnnotation
pack-priv static final short
pack-priv static final short
pack-priv static final short
public XSObjectListImpl
public static final short
pack-priv static final short
pack-priv static final short
pack-priv static final short
pack-priv static final short
pack-priv static final String[]
public XSAnnotation
pack-priv static final String
public XSAnnotation
pack-priv static final String[]
public static final short

Constructor Summary

AccessConstructor and Description
public
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

Modifier and TypeMethod and Description
private void
public void
applyFacets(XSFacets
the value of all the facets
facets
,
short
bit combination value of the costraining facet constants which are present.
presentFacet
,
short
bit combination value of the costraining facet constants which are fixed.
fixedFacet
,
ValidationContext
the validation context
context
)

Implements org.apache.xerces.impl.dv.XSSimpleType.applyFacets.

If <restriction> is chosen
pack-priv void
applyFacets(XSFacets facets, short presentFacet, short fixedFacet, short patternType, ValidationContext context)

If <restriction> is chosen, or built-in derived types by restriction

pack-priv void
applyFacets1(XSFacets facets, short presentFacet, short fixedFacet)

built-in derived types by restriction

pack-priv void
applyFacets1(XSFacets facets, short presentFacet, short fixedFacet, short patternType)

built-in derived types by restriction

private void
private void
private void
checkFacets(ValidatedInfo validatedInfo)

private short
convertToPrimitiveKind(short valueType)

public boolean
derivedFrom(String
An ancestor type namespace.
ancestorNS
,
String
An ancestor type name.
ancestorName
,
short
A bit combination representing a subset of { DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST }.
derivation
)

Implements org.apache.xerces.xs.XSTypeDefinition.derivedFrom.

Convenience method which checks if this type is derived from the given ancestor type.
public boolean
derivedFromType(XSTypeDefinition
An ancestor type definition.
ancestor
,
short
A bit combination representing a subset of { DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST }.
derivation
)

Implements org.apache.xerces.xs.XSTypeDefinition.derivedFromType.

Convenience method which checks if this type is derived from the given ancestorType.
public ObjectList
getActualEnumeration()

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

protected ValidatedInfo
private Object
getActualValue(Object content, ValidationContext context, ValidatedInfo validatedInfo, boolean needNormalize)

public XSObjectList
getAnnotations()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getAnnotations.

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

Implements org.apache.xerces.xs.XSTypeDefinition.getBaseType.

{base type definition}: either a simple type definition or a complex type definition.
public boolean
getBounded()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getBounded.

Fundamental Facet: bounded.
public short
getBuiltInKind()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getBuiltInKind.

Returns the closest built-in type category this type represents or derived from.
public short
getDefinedFacets()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getDefinedFacets.

[facets]: all facets defined on this type.
public ObjectList
getEnumerationItemTypeList()

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

public ShortList
public XSObject
getFacet(int facetType)

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getFacet.

A constraining facet object.
public XSObjectList
getFacets()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getFacets.

A list of constraining facets if it exists, otherwise an empty XSObjectList.
public short
getFinal()

Implements org.apache.xerces.xs.XSTypeDefinition.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.
public boolean
getFinite()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getFinite.

Fundamental Facet: cardinality.
public short
getFixedFacets()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getFixedFacets.

[facets]: all defined facets for this type which are fixed.
protected static TypeValidator[]
public XSSimpleTypeDefinition
getItemType()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getItemType.

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

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getLexicalEnumeration.

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

Returns:

A value of the facet specified in facetName for this simple type definition or null.
getLexicalFacetValue
(short
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.
facetName
)

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getLexicalFacetValue.

Convenience method.
public StringList
getLexicalPattern()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getLexicalPattern.

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

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.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
public Object
public XSObjectList
getMultiValueFacets()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getMultiValueFacets.

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

Implements org.apache.xerces.xs.XSObject.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.
public String
getNamespace()

Implements org.apache.xerces.xs.XSObject.getNamespace.

The [target namespace] of this object, or null if it is unspecified.
public XSNamespaceItem
getNamespaceItem()

Implements org.apache.xerces.xs.XSObject.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()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getNumeric.

Fundamental Facet: numeric.
public short
getOrdered()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getOrdered.

Fundamental Facet: ordered.
private short
getPrimitiveDV(short validationDV)

public short
getPrimitiveKind()

Implements org.apache.xerces.impl.dv.XSSimpleType.getPrimitiveKind.

return an ID representing the built-in primitive base type.
public XSSimpleTypeDefinition
getPrimitiveType()

Implements org.apache.xerces.xs.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()

Implements org.apache.xerces.xs.XSObject.getType.

The type of this object, i.e. ELEMENT_DECLARATION.
public short
getTypeCategory()

Implements org.apache.xerces.xs.XSTypeDefinition.getTypeCategory.

Return whether this type definition is a simple type or complex type.
public String
getTypeName()

Implements org.w3c.dom.TypeInfo.getTypeName.

The name of a type declared for the associated element or attribute, or null if unknown.
public String
getTypeNamespace()

Implements org.w3c.dom.TypeInfo.getTypeNamespace.

The namespace of the type declared for the associated element or attribute or null if the element does not have declaration or if no namespace information is available.
public short
getVariety()

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.getVariety.

[variety]: one of {atomic, list, union} or absent.
public short
getWhitespace()

Implements org.apache.xerces.impl.dv.XSSimpleType.getWhitespace.

Return the whitespace corresponding to this datatype.
public boolean

Returns:

True if the facet is defined, false otherwise.
isDefinedFacet
(short
The name of the facet.
facetName
)

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.isDefinedFacet.

Convenience method.
private boolean

Returns:

boolean True if the type is derived by restriciton for the reference type
isDerivedByAny
(String
The namspace of the ancestor type declaration
ancestorNS
,
String
The name of the ancestor type declaration
ancestorName
,
XSTypeDefinition
The reference type definition
type
)

Checks if a type is derived from another by any combination of restriction, list ir union.

private boolean

Returns:

boolean True if the type is derived by list for the reference type
isDerivedByList
(String
The namspace of the ancestor type declaration
ancestorNS
,
String
The name of the ancestor type declaration
ancestorName
,
XSTypeDefinition
The reference type definition
type
)

Checks if a type is derived from another by list.

private boolean

Returns:

boolean True if the type is derived by restriciton for the reference type
isDerivedByRestriction
(String
The namspace of the ancestor type declaration
ancestorNS
,
String
The name of the ancestor type declaration
ancestorName
,
XSTypeDefinition
The reference type definition
type
)

DOM Level 3 Checks if a type is derived from another by restriction.

private boolean

Returns:

boolean True if the type is derived by union for the reference type
isDerivedByUnion
(String
The namspace of the ancestor type declaration
ancestorNS
,
String
The name of the ancestor type declaration
ancestorName
,
XSTypeDefinition
The reference type definition
type
)

Checks if a type is derived from another by union.

public boolean
isDerivedFrom(String
the namespace of the other type definition.
typeNamespaceArg
,
String
the name of the other type definition.
typeNameArg
,
int
the type of derivation and conditions applied between two types, as described in the list of constants provided in this interface.
derivationMethod
)

Implements org.w3c.dom.TypeInfo.isDerivedFrom.

This method returns if there is a derivation between the reference type definition, i.e. the TypeInfo on which the method is being called, and the other type definition, i.e. the one passed as parameters.
public boolean

Returns:

boolean True if the ancestor type is derived from the reference type by the specifiied derivation method.
isDOMDerivedFrom
(String
The namspace of the ancestor type declaration
ancestorNS
,
String
The name of the ancestor type declaration
ancestorName
,
int
The derivation method
derivationMethod
)

Checks if a type is derived from another by restriction, given the name and namespace.

public boolean
isEqual(Object
the first value
value1
,
Object
the second value
value2
)

Implements org.apache.xerces.impl.dv.XSSimpleType.isEqual.

Check whether two actual values are equal.
public boolean
isFinal(short
Extension, restriction, list, union constants (defined in XSConstants).
derivation
)

Implements org.apache.xerces.xs.XSTypeDefinition.isFinal.

{final}.
public boolean

Returns:

True if the facet is fixed, false otherwise.
isFixedFacet
(short
The name of the facet.
facetName
)

Implements org.apache.xerces.xs.XSSimpleTypeDefinition.isFixedFacet.

Convenience method.
public boolean
isIdentical(Object value1, Object value2)

public boolean
isIDType()

Implements org.apache.xerces.impl.dv.XSSimpleType.isIDType.

Check whether this type is or is derived from ID. REVISIT: this method makes ID special, which is not a good design.
public static String
normalize(String content, short ws)

protected String
normalize(Object content, short ws)

pack-priv void
reportError(String key, Object[] args)

public void
public void
setAnonymous(boolean anon)

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

public void
private void
private void
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)

private boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public Object
validate(String
the string value that needs to be validated
content
,
ValidationContext
the validation context
context
,
ValidatedInfo
used to store validation result
validatedInfo
)

Implements org.apache.xerces.impl.dv.XSSimpleType.validate.

validate a value, and return the compiled form
public Object
validate(Object
the string value that needs to be validated
content
,
ValidationContext
the validation context
context
,
ValidatedInfo
used to store validation result
validatedInfo
)

Implements org.apache.xerces.impl.dv.XSSimpleType.validate.

validate a value, and return the compiled form
public void
validate(ValidationContext
the validation context
context
,
ValidatedInfo
used to provide the actual value and member types
validatedInfo
)

Implements org.apache.xerces.impl.dv.XSSimpleType.validate.

validate an actual value against this DV
public ValidatedInfo
validateWithInfo(String content, ValidationContext context, ValidatedInfo validatedInfo)

validate a value, and return the compiled form

private String
whiteSpaceValue(short ws)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait