Package com.saxonica.ee.schema
Class IdentityConstraintReference
java.lang.Object
com.saxonica.ee.schema.SchemaStructure
com.saxonica.ee.schema.IdentityConstraintReference
- All Implemented Interfaces:
ComponentReference,UserSchemaComponent,SourceLocator,Location,SchemaComponent,Locator
A reference to an identity constraint
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new uninitialized IdentityConstraint reference (used during schema model loading)IdentityConstraintReference(StructuredQName targetQName, int kind, EnterpriseConfiguration config, SourceLocator locator) Creates a new IdentityConstraint reference -
Method Summary
Modifier and TypeMethodDescriptionintGet the expected kind of constraintintGet the symbol space of the target of this referenceReturns the identity constraint that this type reference is a reference toGet the name of the target of this referencebooleanAsk whether this is known to be a dangling referencebooleanDetermine whether this reference has been resolvedvoidsetTarget(IdentityConstraint target) Set the target of this reference.voidtryToResolve(SchemaCompiler compiler, boolean fatal) Attempt to resolve this reference using the constraints defined in a given schema.Methods inherited from class com.saxonica.ee.schema.SchemaStructure
elaborate, fixup, getColumnNumber, getComponentAsFunction, getConfiguration, getFixupStatus, getGeneratedId, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, hasSameLocation, isValidationNeeded, lookForCycles, makeXPathExpressionPropertyRecord, saveLocation, setConfiguration, setFixupStatus, setGeneratedId, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.saxonica.ee.schema.ComponentReference
getConfigurationMethods inherited from interface net.sf.saxon.s9api.Location
getColumnNumber, getLineNumber, getPublicId, getSystemId, saveLocation
-
Constructor Details
-
IdentityConstraintReference
public IdentityConstraintReference()Create a new uninitialized IdentityConstraint reference (used during schema model loading) -
IdentityConstraintReference
public IdentityConstraintReference(StructuredQName targetQName, int kind, EnterpriseConfiguration config, SourceLocator locator) Creates a new IdentityConstraint reference- Parameters:
targetQName- the name of the constraint being referencedkind- the name pool fingerprint of the kind of constraint being referenced, e.g. xs:uniqueconfig- identifies the XML Schema in which this type reference appears. May be null if the reference is in a built-in typelocator- the SourceLocator identifying the location of the reference. May be null if the reference is in a built-in type
-
-
Method Details
-
getExpectedKindOfConstraint
public int getExpectedKindOfConstraint()Get the expected kind of constraint- Returns:
- one of
StandardNames.XS_UNIQUE,StandardNames.XS_KEY,StandardNames.XS_KEYREF
-
isResolved
public boolean isResolved()Determine whether this reference has been resolved- Specified by:
isResolvedin interfaceComponentReference- Returns:
- true if the reference has been resolved to a schema component
-
isDangling
public boolean isDangling()Ask whether this is known to be a dangling reference- Specified by:
isDanglingin interfaceComponentReference- 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
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
Get the name of the target of this reference- Specified by:
getTargetComponentNamein interfaceComponentReference- Returns:
- the component name of the target component
-
getSymbolSpace
public int getSymbolSpace()Get the symbol space of the target of this reference- Specified by:
getSymbolSpacein interfaceComponentReference- Returns:
- an integer code identifying the symbol space
-
getTarget
Returns the identity constraint that this type reference is a reference to- Specified by:
getTargetin interfaceComponentReference- Returns:
- the schema component if the reference has been resolved.
- Throws:
MissingComponentException- if the reference has not been resolved.
-
tryToResolve
Attempt to resolve this reference using the constraints defined in a given schema. No error results if the reference cannot be resolved.- Specified by:
tryToResolvein interfaceComponentReference- 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
-