Top Description Fields Methods
com.sun.xml.xsom

public Interface XSSimpleType

extends XSType, XSContentType
Known Direct Subinterfaces
com.sun.xml.xsom.XSUnionSimpleType, com.sun.xml.xsom.XSListSimpleType, com.sun.xml.xsom.XSRestrictionSimpleType
Known Direct Implementers
com.sun.xml.xsom.impl.SimpleTypeImpl
Imports
com.sun.xml.xsom.visitor.XSSimpleTypeFunction, .XSSimpleTypeVisitor, java.util.List

Simple type.
Author
Kohsuke Kawaguchi ([email protected])

Field Summary

Inherited from com.sun.xml.xsom.XSType:
EXTENSIONRESTRICTIONSUBSTITUTION

Method Summary

Modifier and TypeMethod and Description
public <T> T
public XSListSimpleType
public XSRestrictionSimpleType
public XSUnionSimpleType
public XSListSimpleType

Returns:

otherwise return null
getBaseListType
()

Gets the nearest ancestor XSListSimpleType (including itself) if the variety of this type is list.

public XSUnionSimpleType

Returns:

otherwise return null
getBaseUnionType
()

Gets the nearest ancestor XSUnionSimpleType (including itself) if the variety of this type is union.

public XSFacet

Returns:

If this datatype has a facet of the given name, return that object. If the facet is not specified anywhere in its derivation chain, null will be returned.
getFacet
(String name)

Gets the effective facet object of the given name.

public List<XSFacet>

Returns:

can be empty but never null.
getFacets
(String name)

For multi-valued facets (enumeration and pattern), obtain all values.

public XSSimpleType

Returns:

null otherwise.
getPrimitiveType
()

Gets the ancestor primitive if this type is atomic.

public XSSimpleType

Returns:

null if this component has not been redefined.
getRedefinedBy
()

Redeclares com.sun.xml.xsom.XSType.getRedefinedBy.

If this is redefined by another simple type, return that component.

public XSSimpleType

Returns:

null if this is xs:anySimpleType. Otherwise non-null.
getSimpleBaseType
()

Gets the base type as XSSimpleType.

public XSVariety
getVariety()

Gets the variety of this simple type.

public boolean

Returns:

true if the type is marked final.
isFinal
(XSVariety v)

Returns true if this type definition is marked as 'final' with respect to the given XSVariety.

public boolean
isList()

Returns true if this instanceof XSListSimpleType.

public boolean
isPrimitive()

Returns true if this is a primitive built-in simple type (that directly derives from xs:anySimpleType, by definition.)

public boolean
isRestriction()

Returns true if this instanceof XSRestrictionSimpleType.

public boolean
isUnion()

Returns true if this instanceof XSUnionSimpleType.

public void
Inherited from com.sun.xml.xsom.XSContentType:
applyasEmptyasParticleasSimpleTypevisit
Inherited from com.sun.xml.xsom.XSType:
asComplexTypeasSimpleTypegetBaseTypegetDerivationMethodgetRedefinedCountisComplexTypeisDerivedFromisSimpleTypelistSubstitutables

Method Detail

applyback to summary
public <T> T apply(XSSimpleTypeFunction<T> function)
asListback to summary
public XSListSimpleType asList()
asRestrictionback to summary
public XSRestrictionSimpleType asRestriction()
asUnionback to summary
public XSUnionSimpleType asUnion()
getBaseListTypeback to summary
public XSListSimpleType getBaseListType()

Gets the nearest ancestor XSListSimpleType (including itself) if the variety of this type is list.

Returns:XSListSimpleType

otherwise return null

getBaseUnionTypeback to summary
public XSUnionSimpleType getBaseUnionType()

Gets the nearest ancestor XSUnionSimpleType (including itself) if the variety of this type is union.

Returns:XSUnionSimpleType

otherwise return null

getFacetback to summary
public XSFacet getFacet(String name)

Gets the effective facet object of the given name.

For example, if a simple type "foo" is derived from xs:string by restriction with the "maxLength" facet and another simple type "bar" is derived from "foo" by restriction with another "maxLength" facet, this method will return the latter one, because that is the most restrictive, effective facet.

For those facets that can have multiple values (pattern facets and enumeration facets), this method will return only the first one.

Todo

allow clients to access all of them by some means.

Returns:XSFacet

If this datatype has a facet of the given name, return that object. If the facet is not specified anywhere in its derivation chain, null will be returned.

getFacetsback to summary
public List<XSFacet> getFacets(String name)

For multi-valued facets (enumeration and pattern), obtain all values.

Returns:List<XSFacet>

can be empty but never null.

See Also
getFacet(String)
getPrimitiveTypeback to summary
public XSSimpleType getPrimitiveType()

Gets the ancestor primitive if this type is atomic.

Returns:XSSimpleType

null otherwise.

getRedefinedByback to summary
public XSSimpleType getRedefinedBy()

Redeclares com.sun.xml.xsom.XSType.getRedefinedBy.

If this is redefined by another simple type, return that component.

Returns:XSSimpleType

null if this component has not been redefined.

getSimpleBaseTypeback to summary
public XSSimpleType getSimpleBaseType()

Gets the base type as XSSimpleType. Equivalent to (XSSimpleType)getBaseType() Since this is a simple type, we know that the base type is also a simple type. The only exception is xs:anySimpleType, which has xs:anyType as the base type.

Returns:XSSimpleType

null if this is xs:anySimpleType. Otherwise non-null.

getVarietyback to summary
public XSVariety getVariety()

Gets the variety of this simple type.

isFinalback to summary
public boolean isFinal(XSVariety v)

Returns true if this type definition is marked as 'final' with respect to the given XSVariety.

Returns:boolean

true if the type is marked final.

isListback to summary
public boolean isList()

Returns true if this instanceof XSListSimpleType.

isPrimitiveback to summary
public boolean isPrimitive()

Returns true if this is a primitive built-in simple type (that directly derives from xs:anySimpleType, by definition.)

isRestrictionback to summary
public boolean isRestriction()

Returns true if this instanceof XSRestrictionSimpleType.

isUnionback to summary
public boolean isUnion()

Returns true if this instanceof XSUnionSimpleType.

visitback to summary
public void visit(XSSimpleTypeVisitor visitor)