com.saxonica.schema
Class IdentityConstraint

java.lang.Object
  extended by com.saxonica.schema.SchemaStructure
      extended by com.saxonica.schema.IdentityConstraint
All Implemented Interfaces:
SerializableSchemaComponent, UserSchemaComponent, Serializable, SourceLocator, SchemaComponent
Direct Known Subclasses:
Key, KeyRef, Unique

public abstract class IdentityConstraint
extends SchemaStructure
implements UserSchemaComponent, SerializableSchemaComponent

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
 
Method Summary
 void addField(IdentityField field)
          Adds the given IdentityField to this IdentityConstraint
 void elaborate()
          Elaborate the schema component: after reloading a serialized schema component model, this expands the component with derived information needed during validation episodes.
 boolean fixup(SchemaCompiler compiler)
          Check references from this component to other components
 List getFields()
          Returns the List of Fields contained within this IdentityConstraint.
 int getFingerprint()
          Get the fingerprint of the name of this identity constraint
 String getName()
          Return the name of this IdentityConstraint.
 IdentitySelector getSelector()
          Returns the selector of this IdentityConstraint.
 String getTargetNamespace()
          Return the target namespace of this IdentityConstraint.
 Iterator iterateFields()
          Iterate over the fields contained within this IdentityConstraint.
 void serialize(SchemaModelSerializer serializer)
          Serialize the identity constraint as part of the serialized Schema Component Model
 void setNameCode(int nc)
          Set the fingerprint of the name of this identity constraint
 void setSelector(IdentitySelector selector)
          Sets the selector for this IdentityConstraint.
 void typeCheck(SchemaCompiler compiler, SchemaType contextType)
          Typecheck the selector and the fields
 boolean validate(SchemaCompiler compiler)
          Checks the validity of this Schema defintion.
 
Methods inherited from class com.saxonica.schema.SchemaStructure
getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getSystemId, getValidationStatus, lookForCycles, setConfiguration, setFixupStatus, setLineNumber, setLocator, setSystemId, setValidationStatus
 
Methods inherited from class java.lang.Object
equals, 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
 

Method Detail

addField

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

Parameters:
field - the IdentityField to add.

iterateFields

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

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

getFields

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

Returns:
the List of fields

getName

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

Returns:
the name of this IdentityConstraint

getTargetNamespace

public String getTargetNamespace()
Return the target namespace of this IdentityConstraint.

Returns:
the target namespace of this IdentityConstraint. Return null if the target namespace is "absent".

getSelector

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

Returns:
the IdentitySelector of this IdentityConstraint

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.

setNameCode

public void setNameCode(int nc)
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(SchemaCompiler compiler)
              throws SchemaException
Check references from this component to other components

Specified by:
fixup in interface UserSchemaComponent
Overrides:
fixup in class SchemaStructure
Parameters:
compiler -
Returns:
true if all is well, false if errors found
Throws:
SchemaException

validate

public boolean validate(SchemaCompiler compiler)
                 throws SchemaException
Checks the validity of this Schema defintion.

Specified by:
validate in interface UserSchemaComponent
Returns:
true when this Schema definition is valid, otherwise false.
Throws:
SchemaException

typeCheck

public void typeCheck(SchemaCompiler compiler,
                      SchemaType contextType)
Typecheck the selector and the fields


elaborate

public void elaborate()
               throws SchemaException
Elaborate the schema component: after reloading a serialized schema component model, this expands the component with derived information needed during validation episodes. The model is assumed to be valid.

Specified by:
elaborate in interface UserSchemaComponent
Overrides:
elaborate in class SchemaStructure
Throws:
SchemaException

serialize

public void serialize(SchemaModelSerializer serializer)
               throws XPathException
Serialize the identity constraint as part of the serialized Schema Component Model

Specified by:
serialize in interface SerializableSchemaComponent
Throws:
XPathException


Copyright (C) Michael H. Kay. All rights reserved.