org.exolab.castor.xml.schema

Class SimpleType

public abstract class SimpleType extends XMLType implements Referable

An XML Schema SimpleType

Version: $Revision: 1.3 $ $Date: 2004/09/21 14:04:05 $

Author: Keith Visco

Field Summary
static StringFINAL_ALL
The value of the final attribute used for blocking all types of derivation
static StringFINAL_LIST
The value of the final attribute used for blocking list derivation
static StringFINAL_RESTRICTION
The value of the final attribute used for blocking restriction derivation
static StringFINAL_UNION
The value of the final attribute used for blocking union derivation
Constructor Summary
SimpleType()
Default constructor
Method Summary
voidaddFacet(Facet facet)
Adds the given Facet to this Simpletype.
protected voidcopyFacets(SimpleType target)
Copy this type's facets to the target type.
protected SimpleTypecreateReference(String name)
A helper method for classes which extend SimpleType.
SimpleTypegetBuiltInBaseType()
Returns the built in type this type is derived from.
FacetgetFacet(String name)
Returns the first facet associated with the given name
EnumerationgetFacets(String name)
Returns the facets associated with the given name
EnumerationgetFacets()
Returns an Enumeration of all the Facets (including inherited) facets for this type.
StringgetFinal()
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.
LonggetLength()
Returns the value of the length facet result can be null
EnumerationgetLocalFacets()
Returns the facets of this type (without the parent's facets)
LonggetMaxLength()
Returns the value of the maxlength facet result can be null
LonggetMinLength()
Returns the value of the minlength facet result can be null
StructuregetParent()
Returns the parent Structure that contains this SimpleType.
StringgetReferenceId()
Returns the Id used to Refer to this Object.
shortgetStructureType()
Returns the type of this Schema Structure
intgetTypeCode()
Gets the code for this simple type (as defined in SimpleTypesFactory)
booleanhasFacet(String name)
Returns true if this Simpletype has a specified Facet with the given name.
booleanisBuiltInType()
Returns true if this SimpleType is a built in type
booleanisRedefined()
Returns true if this simpleType is a redefinition.
booleanremoveFacet(Facet facet)
Removes the given Facet from this SimpleType.
booleanremoveFacet(String name)
Removes the facet with the given name from this SimpleType.
protected static SimpleTyperesolveReference(SimpleType simpleType)
A helper method for classes which extend SimpleType.
voidsetFinal(String finalValue)
Sets the value of the 'final' property, indicating which types of derivation are not allowed.
protected voidsetParent(Structure parent)
Sets the parent for this SimpleType
voidsetRedefined()
Sets this Group has redefined.
voidsetTypeCode(int code)
Package private setter of the code for this simple type *
voidvalidate()
Checks the validity of this SimpleType defintion.

Field Detail

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 Detail

SimpleType

public SimpleType()
Default constructor

Method Detail

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(String name)
Returns the facets associated with the given name

Returns: the facets 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

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.

Returns: the Id used to Refer to this Object

See Also:

getStructureType

public short getStructureType()
Returns the type of this Schema 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

isRedefined

public boolean isRedefined()
Returns true if this simpleType is a redefinition.

Returns: true if this simpleType is a redefinition.

removeFacet

public boolean removeFacet(Facet facet)
Removes the given Facet from this SimpleType. Returns true if this SimpleType actually contains the given facet.

Removes only local facets.

Parameters: facet the Facet to remove

Returns: true if the specified Facet has been removed

removeFacet

public boolean removeFacet(String name)
Removes the facet with the given name from this SimpleType. Returns true if this Simpletype has a facet with the given name and it is successfully removed.

Removes only local facets.

Parameters: name the name of the Facet to remove

Returns: true if the specified Facet has been removed

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.

Throws: IllegalArgumentException when the value is not a valid value.

setParent

protected void setParent(Structure parent)
Sets the parent for this SimpleType

Parameters: parent the Structure that contains this SimpleType. Currently this should only be Schema, ElementDecl or AttributeDecl.

setRedefined

public void setRedefined()
Sets this Group has redefined.

setTypeCode

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

validate

public void validate()
Checks the validity of this SimpleType defintion.

Throws: ValidationException when this SimpleType definition is invalid.

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