public class KeyRef extends IdentityConstraint implements ComponentReference
COMPONENT_FUNCTION_TYPE, FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING
Constructor and Description |
---|
KeyRef()
Create a KeyRef object representing an xs:keyref constraints
|
KeyRef(EnterpriseConfiguration config,
StructuredQName refer)
Create a new KeyRef Identity-Constraint.
|
Modifier and Type | Method and Description |
---|---|
boolean |
fixup(SchemaCompiler compiler)
Check references from this component to other components
|
int |
getSymbolSpace()
Get the symbol space of the target of this reference
|
SchemaComponent |
getTarget()
Get the schema component identified by this reference.
|
StructuredQName |
getTargetComponentName()
Get the name of the target of this reference
|
boolean |
isDangling()
Ask whether this is known to be a dangling reference
|
boolean |
isResolved()
Determine whether this reference has been resolved
|
void |
setTargetComponentName(StructuredQName target)
Sets the name of the key being referenced.
|
void |
setTargetKey(IdentityConstraint key)
Set the target key or unique constraint
|
void |
tryToResolve(SchemaCompiler compiler)
Try to resolve the reference if possible, relative to components present in a given schema.
|
boolean |
validate(SchemaCompiler compiler)
Checks the validity of this Schema defintion.
|
addField, elaborate, getComponentAsFunction, getConstraintName, getFields, getName, getSelector, getTargetNamespace, isSameDeclaration, serialize, setConstraintName, setSelector, typeCheck
getColumnNumber, getConfiguration, getFixupStatus, getGeneratedId, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, hasSameLocation, lookForCycles, makeXPathExpressionPropertyRecord, saveLocation, setConfiguration, setFixupStatus, setGeneratedId, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConfiguration
getColumnNumber, getLineNumber, getPublicId, getSystemId, saveLocation
lookForCycles
getRedefinitionLevel, getValidationStatus
public KeyRef()
public KeyRef(EnterpriseConfiguration config, StructuredQName refer)
config
- the configurationrefer
- the name of the referenced key.public StructuredQName getTargetComponentName()
getTargetComponentName
in interface ComponentReference
public void setTargetComponentName(StructuredQName target)
target
- the fingerprint of the name of the key to reference.public void setTargetKey(IdentityConstraint key)
key
- the target key definition or unique constraintpublic void tryToResolve(SchemaCompiler compiler)
tryToResolve
in interface ComponentReference
compiler
- The schema containing the candidate target components for the reference. If
null, the schema containing the reference is used.public boolean isResolved()
isResolved
in interface ComponentReference
public boolean isDangling()
isDangling
in interface ComponentReference
public SchemaComponent getTarget() throws MissingComponentException
getTarget
in interface ComponentReference
MissingComponentException
- if the reference has not been resolved. Note that
this is an unchecked exception.public int getSymbolSpace()
getSymbolSpace
in interface ComponentReference
public boolean fixup(SchemaCompiler compiler) throws SchemaException
fixup
in interface UserSchemaComponent
fixup
in class IdentityConstraint
compiler
- used for reporting error messagesSchemaException
public boolean validate(SchemaCompiler compiler) throws SchemaException
validate
in interface UserSchemaComponent
validate
in class IdentityConstraint
SchemaException
- when this Schema definition is invalid.Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.