org.apache.xerces.xs

Interface XSTypeDefinition

All Superinterfaces:
XSObject
Known Subinterfaces:
XSComplexTypeDefinition, XSSimpleTypeDefinition

public interface XSTypeDefinition
extends XSObject

This interface represents a complex or simple type definition.

Field Summary

static short
COMPLEX_TYPE
The object describes a complex type.
static short
SIMPLE_TYPE
The object describes a simple type.

Method Summary

boolean
derivedFrom(String namespace, String name, short derivationMethod)
Convenience method which checks if this type is derived from the given ancestor type.
boolean
derivedFromType(XSTypeDefinition ancestorType, short derivationMethod)
Convenience method which checks if this type is derived from the given ancestorType.
boolean
getAnonymous()
Convenience attribute.
XSTypeDefinition
getBaseType()
{base type definition}: either a simple type definition or a complex type definition.
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.
short
getTypeCategory()
Return whether this type definition is a simple type or complex type.
boolean
isFinal(short restriction)
{final}.

Methods inherited from interface org.apache.xerces.xs.XSObject

getName, getNamespace, getNamespaceItem, getType

Field Details

COMPLEX_TYPE

public static final short COMPLEX_TYPE
The object describes a complex type.
Field Value:
15

SIMPLE_TYPE

public static final short SIMPLE_TYPE
The object describes a simple type.
Field Value:
16

Method Details

derivedFrom

public boolean derivedFrom(String namespace,
                           String name,
                           short derivationMethod)
Convenience method which checks if this type is derived from the given ancestor type.
Parameters:
namespace - An ancestor type namespace.
name - An ancestor type name.
derivationMethod - 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 .

derivedFromType

public boolean derivedFromType(XSTypeDefinition ancestorType,
                               short derivationMethod)
Convenience method which checks if this type is derived from the given ancestorType.
Parameters:
ancestorType - An ancestor type definition.
derivationMethod - 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 .

getAnonymous

public boolean getAnonymous()
Convenience attribute. A boolean that specifies if the type definition is anonymous.

getBaseType

public XSTypeDefinition getBaseType()
{base type definition}: either a simple type definition or a complex type definition.

getFinal

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.

getTypeCategory

public short getTypeCategory()
Return whether this type definition is a simple type or complex type.

isFinal

public boolean isFinal(short restriction)
{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:
restriction - Extension, restriction, list, union constants (defined in XSConstants).
Returns:
True if restriction is in the final set, otherwise false.

Copyright B) 1999-2006 The Apache Software Foundation. All Rights Reserved.