org.exolab.castor.xml.schema

Class SimpleType

Implemented Interfaces:
Referable, java.io.Serializable
Known Direct Subclasses:
AtomicType, DeferredSimpleType, ListType, SimpleTypeReference, Union, UrType

public abstract class SimpleType
extends XMLType
implements Referable

An XML Schema SimpleType
Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:09:34 $
Author:
Keith Visco
See Also:
Serialized Form

Field Summary

static String
FINAL_ALL
The value of the final attribute used for blocking all types of derivation
static String
FINAL_LIST
The value of the final attribute used for blocking list derivation
static String
FINAL_RESTRICTION
The value of the final attribute used for blocking restriction derivation
static String
FINAL_UNION
The value of the final attribute used for blocking union derivation

Fields inherited from class org.exolab.castor.xml.schema.XMLType

NULL_ARGUMENT

Fields 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

SimpleType()
Default constructor

Method Summary

void
addFacet(Facet facet)
Adds the given Facet to this Simpletype.
protected void
copyFacets(SimpleType target)
Copy this type's facets to the target type.
protected SimpleType
createReference(String name)
A helper method for classes which extend SimpleType.
SimpleType
getBuiltInBaseType()
Returns the built in type this type is derived from.
Facet
getFacet(String name)
Returns the first facet associated with the given name
Enumeration
getFacets()
Returns an Enumeration of all the Facets (including inherited) facets for this type.
Enumeration
getFacets(String name)
Returns the facets associated with the given name
String
getFinal()
Returns the value of the 'final' property, indicating which types of derivation are not allowed, or null if the final property has not been set.
Long
getLength()
Returns the value of the length facet result can be null
Enumeration
getLocalFacets()
Returns the facets of this type (without the parent's facets)
Long
getMaxLength()
Returns the value of the maxlength facet result can be null
Long
getMinLength()
Returns the value of the minlength facet result can be null
Structure
getParent()
Returns the parent Structure that contains this SimpleType.
String
getReferenceId()
Returns the Id used to Refer to this Object.
short
getStructureType()
Returns the type of this Schema Structure
int
getTypeCode()
Gets the code for this simple type (as defined in SimpleTypesFactory)
boolean
hasFacet(String name)
Returns true if this Simpletype has a specified Facet with the given name.
boolean
isBuiltInType()
Returns true if this SimpleType is a built in type
protected static SimpleType
resolveReference(SimpleType simpleType)
A helper method for classes which extend SimpleType.
void
setFinal(String finalValue)
Sets the value of the 'final' property, indicating which types of derivation are not allowed.
protected void
setParent(Structure parent)
Sets the parent for this SimpleType
(package private) void
setTypeCode(int code)
Package private setter of the code for this simple type *
void
validate()
Checks the validity of this SimpleType defintion.

Methods inherited from class org.exolab.castor.xml.schema.XMLType

getBaseType, getDerivationMethod, getId, getName, getSchema, getType, isAnyType, isComplexType, isSimpleType, setBaseType, setDerivationMethod, setId, setName, setParent, setSchema

Methods 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

FINAL_ALL

public static final String FINAL_ALL
The value of the final attribute used for blocking all types of derivation

FINAL_LIST

public static final String FINAL_LIST
The value of the final attribute used for blocking list derivation

FINAL_RESTRICTION

public static final String FINAL_RESTRICTION
The value of the final attribute used for blocking restriction derivation

FINAL_UNION

public static final String FINAL_UNION
The value of the final attribute used for blocking union derivation

Constructor Details

SimpleType

public SimpleType()
Default constructor

Method Details

addFacet

public void addFacet(Facet facet)
Adds the given Facet to this Simpletype.
Parameters:
facet - the Facet to add to this Simpletype

copyFacets

protected void copyFacets(SimpleType target)
Copy this type's facets to the target type.
Parameters:
target - the SimpleType to copy facets to

createReference

protected SimpleType createReference(String name)
A helper method for classes which extend SimpleType. This method allows creating a reference to a SimpleType.
Returns:
the reference to the SimpleType.

getBuiltInBaseType

public SimpleType getBuiltInBaseType()
Returns the built in type this type is derived from.

getFacet

public Facet getFacet(String name)
Returns the first facet associated with the given name
Returns:
the first facet associated with the given name

getFacets

public Enumeration getFacets()
Returns an Enumeration of all the Facets (including inherited) facets for this type.
Returns:
an Enumeration of all the Facets for this type

getFacets

public Enumeration getFacets(String name)
Returns the facets associated with the given name
Returns:
the facets associated with the given name

getFinal

public String getFinal()
Returns the value of the 'final' property, indicating which types of derivation are not allowed, or null if the final property has not been set.
Returns:
the value of the final property or null if no value has been set

getLength

public Long getLength()
Returns the value of the length facet result can be null

getLocalFacets

public Enumeration getLocalFacets()
Returns the facets of this type (without the parent's facets)

getMaxLength

public Long getMaxLength()
Returns the value of the maxlength facet result can be null

getMinLength

public Long getMinLength()
Returns the value of the minlength facet result can be null

getParent

public Structure getParent()
Returns the parent Structure that contains this SimpleType. This can be either a Schema, AttributeDecl or ElementDecl.
Returns:
the parent of this SimpleType

getReferenceId

public String getReferenceId()
Returns the Id used to Refer to this Object.
Specified by:
getReferenceId in interface Referable
Returns:
the Id used to Refer to this Object
See Also:
Referable

getStructureType

public short getStructureType()
Returns the type of this Schema Structure
Overrides:
getStructureType in interface Structure
Returns:
the type of this Schema Structure

getTypeCode

public int getTypeCode()
Gets the code for this simple type (as defined in SimpleTypesFactory)
Returns:
the type code for this simple type

hasFacet

public boolean hasFacet(String name)
Returns true if this Simpletype has a specified Facet with the given name.
Parameters:
name - the name of the Facet to look for
Returns:
true if this Simpletype has a specified Facet with the given name

isBuiltInType

public boolean isBuiltInType()
Returns true if this SimpleType is a built in type
Returns:
true if this SimpleType is a built in type

resolveReference

protected static SimpleType resolveReference(SimpleType simpleType)
A helper method for classes which extend SimpleType. This method allows resolving a SimpleType reference to a SimpleType.
Returns:
the resolved SimpleType.
See Also:
createReference

setFinal

public void setFinal(String finalValue)
Sets the value of the 'final' property, indicating which types of derivation are not allowed. A null value will indicate all types of derivation (list, restriction, union) are allowed.
Parameters:
finalValue - the value of the final property.

setParent

protected void setParent(Structure parent)
Sets the parent for this SimpleType
Overrides:
setParent in interface XMLType
Parameters:
parent - the Structure that contains this SimpleType. Currently this should only be Schema, ElementDecl or AttributeDecl.

setTypeCode

(package private)  void setTypeCode(int code)
Package private setter of the code for this simple type *

validate

public void validate()
            throws ValidationException
Checks the validity of this SimpleType defintion.
Overrides:
validate in interface Structure
Throws:
ValidationException - when this SimpleType definition is invalid.

Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com