Package org.exolab.castor.xml.schema
Class IdentityConstraint
java.lang.Object
org.exolab.castor.xml.schema.Structure
org.exolab.castor.xml.schema.Annotated
org.exolab.castor.xml.schema.IdentityConstraint
- All Implemented Interfaces:
Serializable
The base class for the XML Schema Identity Constraints (key, keyref, unique).
- Version:
- $Revision$ $Date: 2006-04-14 04:14:43 -0600 (Fri, 14 Apr 2006) $
- Author:
- Keith Visco
- See Also:
-
Field Summary
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
ConstructorsModifierConstructorDescriptionprotected
IdentityConstraint
(String name) Constructor used by sub-classes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addField
(IdentityField field) Adds the given IdentityField to this IdentityConstraintReturns an Enumeration of the IdentityFields contained within this IdentityConstraint.getId()
Returns the Id of this IdentityConstraint, or null if no Id has been set.getName()
Returns the name of this IdentityConstraint.Returns the selector of this IdentityConstraint.abstract short
Returns the type of this Schema Structureboolean
removeField
(IdentityField field) Removes the given IdentityField from this IdentityConstraint.void
Sets the Id for this IdentityConstraint.void
Sets the name for this IdentityConstraint.void
setSelector
(IdentitySelector selector) Sets the selector for this IdentityConstraint.void
validate()
Checks the validity of this Schema defintion.Methods inherited from class org.exolab.castor.xml.schema.Annotated
addAnnotation, getAnnotations, removeAnnotation
-
Constructor Details
-
IdentityConstraint
Constructor used by sub-classes. Creates a new IdentityConstraint.- Parameters:
name
- the name for the IdentityConstraint. Must not be null.- Throws:
SchemaException
-
-
Method Details
-
addField
Adds the given IdentityField to this IdentityConstraint- Parameters:
field
- the IdentityField to add.
-
getFields
Returns an Enumeration of the IdentityFields contained within this IdentityConstraint.- Returns:
- an Enumeration of the IdentityField objects contain within this IdentityConstraint.
-
getId
Returns the Id of this IdentityConstraint, or null if no Id has been set.- Returns:
- the Id of this IdentityConstraint, or null if no Id has been set.
-
getName
Returns the name of this IdentityConstraint. This value will never be null.- Returns:
- the name of this IdentityConstraint
-
getSelector
Returns the selector of this IdentityConstraint.- Returns:
- the IdentitySelector of this IdentityConstraint
-
removeField
Removes the given IdentityField from this IdentityConstraint.- Returns:
- true if the IdentityField was contained within this IdentityConstraint, otherwise false.
-
setId
Sets the Id for this IdentityConstraint.- Parameters:
id
- the Id for this IdentityConstraint.
-
setName
Sets the name for this IdentityConstraint.- Parameters:
name
- the name for this IdentityConstraint. Must not be null.- Throws:
SchemaException
- if name is null.
-
setSelector
Sets the selector for this IdentityConstraint.- Parameters:
selector
- the Selector for this IdentityConstraint. Must not be null.- Throws:
SchemaException
- if selector is null.
-
getStructureType
public abstract short getStructureType()Returns the type of this Schema Structure- Specified by:
getStructureType
in classStructure
- Returns:
- the type of this Schema Structure
-
validate
Checks the validity of this Schema defintion.- Specified by:
validate
in classStructure
- Throws:
ValidationException
- when this Schema definition is invalid.
-