org.exolab.castor.xml.schema
Class IdentityConstraint

java.lang.Object
  extended by org.exolab.castor.xml.schema.Structure
      extended by org.exolab.castor.xml.schema.Annotated
          extended by org.exolab.castor.xml.schema.IdentityConstraint
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Key, KeyRef, Unique

public abstract class IdentityConstraint
extends Annotated

The base class for the XML Schema Identity Constraints (key, keyref, unique).

Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:09:32 $
Author:
Keith Visco
See Also:
Serialized Form

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
protected IdentityConstraint(java.lang.String name)
          Constructor used by sub-classes.
 
Method Summary
 void addField(IdentityField field)
          Adds the given IdentityField to this IdentityConstraint
 java.util.Enumeration getFields()
          Returns an Enumeration of the IdentityFields contained within this IdentityConstraint.
 java.lang.String getId()
          Returns the Id of this IdentityConstraint, or null if no Id has been set.
 java.lang.String getName()
          Returns the name of this IdentityConstraint.
 IdentitySelector getSelector()
          Returns the selector of this IdentityConstraint.
abstract  short getStructureType()
          Returns the type of this Schema Structure
 boolean removeField(IdentityField field)
          Removes the given IdentityField from this IdentityConstraint.
 void setId(java.lang.String id)
          Sets the Id for this IdentityConstraint.
 void setName(java.lang.String name)
          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
 
Methods inherited from class org.exolab.castor.xml.schema.Structure
isValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityConstraint

protected IdentityConstraint(java.lang.String name)
                      throws SchemaException
Constructor used by sub-classes. Creates a new IdentityConstraint.

Parameters:
name, - the name for the IdentityConstraint. Must not be null.
Throws:
SchemaException
Method Detail

addField

public void addField(IdentityField field)
Adds the given IdentityField to this IdentityConstraint

Parameters:
field - the IdentityField to add.

getFields

public java.util.Enumeration getFields()
Returns an Enumeration of the IdentityFields contained within this IdentityConstraint.

Returns:
an Enumeration of the IdentityField objects contain within this IdentityConstraint.

getId

public java.lang.String 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

public java.lang.String getName()
Returns the name of this IdentityConstraint. This value will never be null.

Returns:
the name of this IdentityConstraint

getSelector

public IdentitySelector getSelector()
Returns the selector of this IdentityConstraint.

Returns:
the IdentitySelector of this IdentityConstraint

removeField

public boolean removeField(IdentityField field)
Removes the given IdentityField from this IdentityConstraint.

Returns:
true if the IdentityField was contained within this IdentityConstraint, otherwise false.

setId

public void setId(java.lang.String id)
Sets the Id for this IdentityConstraint.

Parameters:
id - the Id for this IdentityConstraint.

setName

public void setName(java.lang.String name)
             throws SchemaException
Sets the name for this IdentityConstraint.

Parameters:
name - the name for this IdentityConstraint. Must not be null.
Throws:
SchemaException - if name is null.

setSelector

public void setSelector(IdentitySelector selector)
                 throws SchemaException
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 class Structure
Returns:
the type of this Schema Structure

validate

public void validate()
              throws ValidationException
Checks the validity of this Schema defintion.

Specified by:
validate in class Structure
Throws:
ValidationException - when this Schema definition is invalid.


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