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

public Class XSSimpleTypeDecl

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

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

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 List<RegularExpression>
private List<String>
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 com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.xs.XSTypeDefinition.getBaseType.

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

public boolean
public short
getBuiltInKind()

Implements com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition.getBuiltInKind.

Returns the closest built-in type category this type represents or derived from.

public short
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 com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition.getFacet.

A constraining facet object.

public XSObjectList
getFacets()

Implements com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition.getFacets.

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

public short
getFinal()

Implements com.sun.org.apache.xerces.internal.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
public short
getFixedFacets()

Implements com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition.getFixedFacets.

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

protected static TypeValidator[]
public XSSimpleTypeDefinition
getItemType()

Implements com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition.getLexicalFacetValue.

Convenience method.

public StringList
getLexicalPattern()

Implements com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition.getLexicalPattern.

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

public Object
public Object
public XSObjectList
getMemberTypes()

Implements com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition.getMultiValueFacets.

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

public String
getName()

Implements com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.xs.XSObject.getNamespace.

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

public XSNamespaceItem
getNamespaceItem()

Implements com.sun.org.apache.xerces.internal.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
public short
private short
getPrimitiveDV(short validationDV)

public short
getPrimitiveKind()

Implements com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType.getPrimitiveKind.

return an ID representing the built-in primitive base type.

public XSSimpleTypeDefinition
getPrimitiveType()

Implements com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.xs.XSObject.getType.

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

public short
getTypeCategory()

Implements com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition.getVariety.

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

public short
getWhitespace()

Implements com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.xs.XSTypeDefinition.isFinal.

{final}.

public boolean

Returns:

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

Implements com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition.isFixedFacet.

Convenience method.

public boolean
isIdentical(Object value1, Object value2)

public boolean
isIDType()

Implements com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.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 com.sun.org.apache.xerces.internal.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