Interface ComponentReference

All Superinterfaces:
Location, Locator, SourceLocator
All Known Implementing Classes:
AttributeGroupReference, AttributeUse, Edge.MaxOccursParticle, ElementParticle, ElementWildcard, IdentityConstraintReference, KeyRef, ModelGroupParticle, Particle, SimpleComponentReference, TypeReference

public interface ComponentReference extends Location
A reference to a schema component. The reference may have been resolved to a specific component, or may be as yet unresolved. Any attempt to use a reference that has not yet been resolved causes an unchecked exception.
  • Method Details

    • getConfiguration

      EnterpriseConfiguration getConfiguration()
      Determine the configuration containing this reference (and its target)
      Returns:
      the Saxon configuration
    • tryToResolve

      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 schema compiler 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
      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.
    • isResolved

      boolean isResolved()
      Ask whether this reference has been resolved
      Returns:
      true if the reference has been resolved to a schema component
    • isDangling

      boolean isDangling()
      Ask whether this is known to be a dangling reference
      Returns:
      true if the target of this component reference is known to be absent, and if a warning has been issued to this effect
    • getTarget

      Get the schema component identified by this reference.
      Returns:
      the schema component if the reference has been resolved.
      Throws:
      MissingComponentException - if the reference has not been resolved.
    • getTargetComponentName

      StructuredQName getTargetComponentName()
      Get the name of the target of this reference
      Returns:
      the component name of the target component
    • getSymbolSpace

      int getSymbolSpace()
      Get the symbol space of the target of this reference
      Returns:
      an integer code identifying the symbol space