Package com.saxonica.ee.schema
Class SimpleComponentReference
java.lang.Object
com.saxonica.ee.schema.SchemaStructure
com.saxonica.ee.schema.SimpleComponentReference
- All Implemented Interfaces:
ComponentReference,UserSchemaComponent,SourceLocator,Location,SchemaComponent,Locator
- Direct Known Subclasses:
AttributeUse,Particle
A reference to a named schema group within the content model of a complex type
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe symbol space representing the kind of schema component that is referencedprotected SchemaComponentThe corresponding SchemaComponent. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor for use by subclassesSimpleComponentReference(int symbolSpace, StructuredQName name, EnterpriseConfiguration config) Creates a new SimpleComponentReference definition -
Method Summary
Modifier and TypeMethodDescriptionintGet the symbol space of the target of this referenceReturns the schema component that this is a reference toGet the name of the target of this referenceintbooleanAsk whether this is known to be a dangling referencebooleanDetermine whether this reference has been resolvedvoidsetTarget(SchemaComponent target) Set the target componentvoidvoidtryToResolve(SchemaCompiler compiler, boolean fatal) Attempt to resolve this reference using the components 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
-
Field Details
-
target
The corresponding SchemaComponent. This is null until the reference has been resolved. -
symbolSpace
protected int symbolSpaceThe symbol space representing the kind of schema component that is referenced
-
-
Constructor Details
-
SimpleComponentReference
protected SimpleComponentReference()Default constructor for use by subclasses -
SimpleComponentReference
public SimpleComponentReference(int symbolSpace, StructuredQName name, EnterpriseConfiguration config) Creates a new SimpleComponentReference definition- Parameters:
symbolSpace- the symbol space for the component reference, for example elements, attributes, or typesname- the component nameconfig- the configuration to which this component belongs
-
-
Method Details
-
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
-
setTargetComponentName
-
getTargetComponentName
Description copied from interface:ComponentReferenceGet the name of the target of this reference- Specified by:
getTargetComponentNamein interfaceComponentReference- Returns:
- the component name of the target component
-
getTargetFingerprint
public int getTargetFingerprint() -
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 schema component that this 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. Note that this is an unchecked exception.
-
setTarget
Set the target component- Parameters:
target- the component that this reference points to
-
tryToResolve
Attempt to resolve this reference using the components 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- Throws:
SchemaException- if the reference cannot be resolved or repaired.
-
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
-