Free Trial - Stylus Studio, The World's Best XML IDE!


com.saxonica.schema
Class IdentityConstraint

java.lang.Object
  |
  +--com.saxonica.schema.SchemaElement
        |
        +--com.saxonica.schema.IdentityConstraint
All Implemented Interfaces:
java.io.Serializable, javax.xml.transform.SourceLocator
Direct Known Subclasses:
Key, KeyRef, Unique

public abstract class IdentityConstraint
extends SchemaElement

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

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.saxonica.schema.SchemaElement
ANNOTATION, ANYTYPE, APPINFO, ATTRIBUTE, ATTRIBUTE_GROUP, COMPLEX_CONTENT, COMPLEX_TYPE, COMPOSITOR, DOCUMENTATION, ELEMENT, FACET, GROUP, IDENTITY_FIELD, IDENTITY_SELECTOR, KEY, KEYREF, LIST, REDEFINE, SCHEMA, SIMPLE_CONTENT, SIMPLE_TYPE, UNION, UNIQUE, UNKNOWN, WILDCARD_ATTRIBUTE, WILDCARD_ELEMENT
 
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.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 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.
 Schema getSchema()
           
 IdentitySelector getSelector()
          Returns the selector of this IdentityConstraint.
abstract  short getStructureType()
          Returns the type of this Schema Structure
 java.util.Iterator iterateFields()
          Returns an Enumeration of the IdentityFields contained within this IdentityConstraint.
 void setFingerprint(int fp)
          Set the fingerprint of the name of this identity constraint
 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 setSchema(Schema schema)
           
 void setSelector(IdentitySelector selector)
          Sets the selector for this IdentityConstraint.
 boolean validate(Schema schema)
          Checks the validity of this Schema defintion.
 
Methods inherited from class com.saxonica.schema.SchemaElement
getColumnNumber, getLineNumber, getPublicId, getSystemId, setLocator
 
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.
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()
Returns an Enumeration of the IdentityFields 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

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

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 SchemaElement
Returns:
the type of this Schema Structure

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


getSchema

public Schema getSchema()

setSchema

public void setSchema(Schema schema)

validate

public boolean validate(Schema schema)
                 throws javax.xml.transform.TransformerException
Checks the validity of this Schema defintion.

Throws:
javax.xml.transform.TransformerException


Stylus Studio features integrated development and debugging support for Saxon in the XQuery editor and XSLT editor.