com.saxonica.schema
Class IdentityConstraint

java.lang.Object
  extended bycom.saxonica.schema.SchemaStructure
      extended bycom.saxonica.schema.IdentityConstraint
All Implemented Interfaces:
SchemaComponent, java.io.Serializable, javax.xml.transform.SourceLocator, UserSchemaComponent
Direct Known Subclasses:
Key, KeyRef, Unique

public abstract class IdentityConstraint
extends SchemaStructure
implements UserSchemaComponent

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

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface net.sf.saxon.type.SchemaComponent
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING
 
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
 boolean fixup(PreparedSchema schema)
          Check references from this component to other components
 java.util.List getFields()
          Returns the List of Fields contained within this IdentityConstraint.
 int getFingerprint()
          Get the fingerprint of the name of this identity constraint
 java.lang.String getName()
          Returns the name of this IdentityConstraint.
 IdentitySelector getSelector()
          Returns the selector of this IdentityConstraint.
 java.util.Iterator iterateFields()
          Iterate over the fields contained within this IdentityConstraint.
 void setFingerprint(int fp)
          Set the fingerprint of the name of this identity constraint
 void setName(java.lang.String name)
          Sets the name for this IdentityConstraint.
 void setSelector(IdentitySelector selector)
          Sets the selector for this IdentityConstraint.
 boolean validate(PreparedSchema schema)
          Checks the validity of this Schema defintion.
 
Methods inherited from class com.saxonica.schema.SchemaStructure
getColumnNumber, getFixupStatus, getLineNumber, getPublicId, getSchema, getSystemId, getValidationStatus, lookForCycles, setFixupStatus, setLineNumber, setLocator, setSchema, setSystemId, setValidationStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.saxonica.schema.UserSchemaComponent
lookForCycles
 
Methods inherited from interface net.sf.saxon.type.SchemaComponent
getValidationStatus
 

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.
Method Detail

addField

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

Parameters:
field - the IdentityField to add.

iterateFields

public java.util.Iterator iterateFields()
Iterate over the fields contained within this IdentityConstraint.

Returns:
an Iterator over the Field objects contained within this IdentityConstraint.

getFields

public java.util.List getFields()
Returns the List of Fields contained within this IdentityConstraint.

Returns:
the List of fields

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

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.

setFingerprint

public void setFingerprint(int fp)
Set the fingerprint of the name of this identity constraint


getFingerprint

public int getFingerprint()
Get the fingerprint of the name of this identity constraint


fixup

public boolean fixup(PreparedSchema schema)
              throws SchemaException
Check references from this component to other components

Specified by:
fixup in interface UserSchemaComponent
Parameters:
schema - The schema is used for reporting errors
Returns:
true if all is well, false if errors found
Throws:
SchemaException

validate

public boolean validate(PreparedSchema schema)
                 throws SchemaException
Checks the validity of this Schema defintion.

Specified by:
validate in interface UserSchemaComponent
Parameters:
schema - if this is not null, any errors that are detected should be reported using the error() method of this schema.
Returns:
true when this Schema definition is valid, otherwise false.
Throws:
SchemaException