Class IdentityConstraint

All Implemented Interfaces:
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: 6230 $ $Date: 2006-04-14 04:14:43 -0600 (Fri, 14 Apr 2006) $
Author:
Keith Visco
See Also:
  • Constructor Details

    • IdentityConstraint

      protected IdentityConstraint(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 Details

    • addField

      public void addField(IdentityField field)
      Adds the given IdentityField to this IdentityConstraint
      Parameters:
      field - the IdentityField to add.
    • getFields

      public 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 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 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(String id)
      Sets the Id for this IdentityConstraint.
      Parameters:
      id - the Id for this IdentityConstraint.
    • setName

      public void setName(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.