Package com.saxonica.ee.schema
Class TypeReference
- java.lang.Object
-
- com.saxonica.ee.schema.SchemaStructure
-
- com.saxonica.ee.schema.TypeReference
-
- All Implemented Interfaces:
ComponentReference
,UserSchemaComponent
,javax.xml.transform.SourceLocator
,Location
,SchemaComponent
,org.xml.sax.Locator
public class TypeReference extends SchemaStructure implements ComponentReference
A reference to a simple or complex type
-
-
Constructor Summary
Constructors Constructor Description TypeReference(int fingerprint, EnterpriseConfiguration config, javax.xml.transform.SourceLocator locator)
Creates a new Type reference
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getSymbolSpace()
Get the symbol space of the target of this referenceSchemaComponent
getTarget()
Returns the type that this type reference is a reference toStructuredQName
getTargetComponentName()
Get the name of the target of this referenceint
getTargetFingerprint()
boolean
isAnonymousType()
Test whether this is a reference to an anonymous typeboolean
isDangling()
Ask whether this is known to be a dangling referenceboolean
isResolved()
Determine whether this reference has been resolvedvoid
setTarget(SchemaType target)
void
tryToResolve(SchemaCompiler compiler, boolean fatal)
Try to resolve the reference if possible, relative to components present 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, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.saxonica.ee.schema.ComponentReference
getConfiguration
-
Methods inherited from interface net.sf.saxon.s9api.Location
getColumnNumber, getLineNumber, getPublicId, getSystemId, saveLocation
-
-
-
-
Constructor Detail
-
TypeReference
public TypeReference(int fingerprint, EnterpriseConfiguration config, javax.xml.transform.SourceLocator locator)
Creates a new Type reference- Parameters:
fingerprint
- the Name Pool fingerprint of the name of the type being referencedconfig
- identifies the XML Schema in which this type reference appears.locator
- the SourceLocator identifying the location of the reference. May be null if the reference is in a built-in type
-
-
Method Detail
-
isResolved
public boolean isResolved()
Determine whether this reference has been resolved- Specified by:
isResolved
in interfaceComponentReference
- Returns:
- true if the reference has been resolved to a schema component
-
setTarget
public void setTarget(SchemaType target)
-
getTargetFingerprint
public int getTargetFingerprint()
-
getTargetComponentName
public StructuredQName getTargetComponentName()
Description copied from interface:ComponentReference
Get the name of the target of this reference- Specified by:
getTargetComponentName
in interfaceComponentReference
- Returns:
- the component name of the target component
-
isDangling
public boolean isDangling()
Ask whether this is known to be a dangling reference- Specified by:
isDangling
in 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
-
getSymbolSpace
public int getSymbolSpace()
Get the symbol space of the target of this reference- Specified by:
getSymbolSpace
in interfaceComponentReference
- Returns:
- an integer code identifying the symbol space
-
isAnonymousType
public boolean isAnonymousType()
Test whether this is a reference to an anonymous type- Returns:
- true if this SchemaType is an anonymous type
-
getTarget
public SchemaComponent getTarget()
Returns the type that this type reference is a reference to- Specified by:
getTarget
in interfaceComponentReference
- Returns:
- the schema component if the reference has been resolved, or null otherwise
-
tryToResolve
public void tryToResolve(SchemaCompiler compiler, boolean fatal) throws SchemaException
Try to resolve the reference if possible, relative to components present in a given schema. If the reference cannot be resolved, the action depends on whether the compiler service allows dangling references to absent components. If it does, we try to patch the schema up with a dummy component (where possible). If not, the method throws an exception- Specified by:
tryToResolve
in interfaceComponentReference
- Parameters:
compiler
- The compiler being used to compile the referring component.fatal
- true if a failure to resolve the reference is to be treated as fatal- Throws:
SchemaException
- if the reference cannot be resolved or repaired.
-
-