Package org.exolab.castor.xml.schema
Class XMLType
java.lang.Object
org.exolab.castor.xml.schema.Structure
org.exolab.castor.xml.schema.Annotated
org.exolab.castor.xml.schema.XMLType
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AnyType
,ComplexType
,SimpleType
,TypeReference
The base type for XML Schema types, such as complex types and simple types.
- Version:
- $Revision$ $Date: 2006-04-14 04:14:43 -0600 (Fri, 14 Apr 2006) $
- Author:
- Keith Visco
- See Also:
-
Field Summary
FieldsFields inherited from class org.exolab.castor.xml.schema.Structure
ANNOTATION, ANYTYPE, APPINFO, ATTRIBUTE, ATTRIBUTE_GROUP, COMPLEX_CONTENT, COMPLEX_TYPE, DOCUMENTATION, ELEMENT, FACET, GROUP, IDENTITY_FIELD, IDENTITY_SELECTOR, KEY, KEYREF, LIST, MODELGROUP, MODELGROUP_REF, REDEFINE, SCHEMA, SIMPLE_CONTENT, SIMPLE_TYPE, UNION, UNIQUE, UNKNOWN, WILDCARD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the base type that this type inherits from.If this type has a base type, this returns its name.
Returns null otherwise.Gets the name of the derivation method used to derive this type from its parent.getId()
Returns the Id for this ComplexType, or null if no Id has been set.getName()
Returns the name of this type (null if none was defined)Returns the schema to which this type belongsfinal boolean
Returns true if this XMLType is an AnyTypefinal boolean
Returns true if this XMLType is a ComplexTypefinal boolean
Returns true if this XMLType is a SimpleTypevoid
setBaseType
(XMLType baseType) Sets the base type for this datatypevoid
setDerivationMethod
(String derivationMethod) Sets the derivation method namevoid
Sets the Id for this XMLType.void
Sets the name of this typeprotected abstract void
Sets the parent for this XMLTypevoid
Sets the name of this SimpleTypeMethods inherited from class org.exolab.castor.xml.schema.Annotated
addAnnotation, getAnnotations, removeAnnotation
Methods inherited from class org.exolab.castor.xml.schema.Structure
getStructureType, isValid, validate
-
Field Details
-
NULL_ARGUMENT
Error message for a null argument
-
-
Constructor Details
-
XMLType
public XMLType()Default constructor
-
-
Method Details
-
getId
Returns the Id for this ComplexType, or null if no Id has been set.- Returns:
- the Id for this ComplexType, or null if no Id has been set.
-
getName
Returns the name of this type (null if none was defined)- Returns:
- the name of this type (null if none was defined)
-
setName
-
isAnyType
public final boolean isAnyType()Returns true if this XMLType is an AnyType- Returns:
- true if this XMLType is an AnyType
-
isComplexType
public final boolean isComplexType()Returns true if this XMLType is a ComplexType- Returns:
- true if this XMLType is a ComplexType
-
isSimpleType
public final boolean isSimpleType()Returns true if this XMLType is a SimpleType- Returns:
- true if this XMLType is a SimpleType
-
getSchema
Returns the schema to which this type belongs- Returns:
- the Schema to which this type belongs
-
setSchema
Sets the name of this SimpleType- Parameters:
schema
- the Schema to which this Simpletype belongs
-
getBaseType
Returns the base type that this type inherits from. If this type is a Simpletype that is a built in primitive type then null is returned.- Returns:
- the parent type.
-
setBaseType
Sets the base type for this datatype- Parameters:
baseType
- the base type which this datatype inherits from
-
getDerivationMethod
Gets the name of the derivation method used to derive this type from its parent. null for primitive types. -
setDerivationMethod
Sets the derivation method name -
setId
Sets the Id for this XMLType. The Id must be globally unique within the Schema. Use a null value to remove the Id.- Parameters:
id
- the unique Id for this XMLType
-
setParent
Sets the parent for this XMLType- Parameters:
parent
- the parent Structure for this XMLType
-
getBaseTypeName
If this type has a base type, this returns its name.
Returns null otherwise.- Returns:
- Base type's name if available, null otherwise.
-