Class IdentityConstraintReference

java.lang.Object
com.saxonica.ee.schema.SchemaStructure
com.saxonica.ee.schema.IdentityConstraintReference
All Implemented Interfaces:
ComponentReference, UserSchemaComponent, SourceLocator, Location, SchemaComponent, Locator

public class IdentityConstraintReference extends SchemaStructure implements ComponentReference
A reference to an identity constraint
  • Constructor Details Link icon

    • IdentityConstraintReference Link icon

      public IdentityConstraintReference()
      Create a new uninitialized IdentityConstraint reference (used during schema model loading)
    • IdentityConstraintReference Link icon

      public IdentityConstraintReference(StructuredQName targetQName, int kind, EnterpriseConfiguration config, SourceLocator locator)
      Creates a new IdentityConstraint reference
      Parameters:
      targetQName - the name of the constraint being referenced
      kind - the name pool fingerprint of the kind of constraint being referenced, e.g. xs:unique
      config - identifies the XML Schema in which this type reference appears. May be null if the reference is in a built-in type
      locator - the SourceLocator identifying the location of the reference. May be null if the reference is in a built-in type
  • Method Details Link icon

    • getExpectedKindOfConstraint Link icon

      public int getExpectedKindOfConstraint()
      Get the expected kind of constraint
      Returns:
      one of StandardNames.XS_UNIQUE, StandardNames.XS_KEY, StandardNames.XS_KEYREF
    • isResolved Link icon

      public boolean isResolved()
      Determine whether this reference has been resolved
      Specified by:
      isResolved in interface ComponentReference
      Returns:
      true if the reference has been resolved to a schema component
    • isDangling Link icon

      public boolean isDangling()
      Ask whether this is known to be a dangling reference
      Specified by:
      isDangling in interface ComponentReference
      Returns:
      true if the target of this component reference is known to be absent, and if a warning has been issued to this effect
    • setTarget Link icon

      public void setTarget(IdentityConstraint target)
      Set the target of this reference. Caller is responsible for ensuring that the target constraint is of the expected kind
      Parameters:
      target - the target constraint (to which this is a reference)
    • getTargetComponentName Link icon

      public StructuredQName getTargetComponentName()
      Get the name of the target of this reference
      Specified by:
      getTargetComponentName in interface ComponentReference
      Returns:
      the component name of the target component
    • getSymbolSpace Link icon

      public int getSymbolSpace()
      Get the symbol space of the target of this reference
      Specified by:
      getSymbolSpace in interface ComponentReference
      Returns:
      an integer code identifying the symbol space
    • getTarget Link icon

      public IdentityConstraint getTarget() throws MissingComponentException
      Returns the identity constraint that this type reference is a reference to
      Specified by:
      getTarget in interface ComponentReference
      Returns:
      the schema component if the reference has been resolved.
      Throws:
      MissingComponentException - if the reference has not been resolved.
    • tryToResolve Link icon

      public void tryToResolve(SchemaCompiler compiler, boolean fatal)
      Attempt to resolve this reference using the constraints defined in a given schema. No error results if the reference cannot be resolved.
      Specified by:
      tryToResolve in interface ComponentReference
      Parameters:
      compiler - The compiler being used to compile the referring component.
      fatal - True if a failure to resolve should be treated as fatal, irrespective of any settings in the SchemaCompiler