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

public class SimpleComponentReference extends SchemaStructure implements ComponentReference
A reference to a named schema group within the content model of a complex type
  • Field Details Link icon

    • target Link icon

      protected SchemaComponent target
      The corresponding SchemaComponent. This is null until the reference has been resolved.
    • symbolSpace Link icon

      protected int symbolSpace
      The symbol space representing the kind of schema component that is referenced
  • Constructor Details Link icon

    • SimpleComponentReference Link icon

      protected SimpleComponentReference()
      Default constructor for use by subclasses
    • SimpleComponentReference Link icon

      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 types
      name - the component name
      config - the configuration to which this component belongs
  • Method Details Link icon

    • isResolved Link icon

      public boolean isResolved()
      Determine whether this reference has been resolved
      Specified by:
      isResolved in interface ComponentReference
      Returns:
      true if the reference has been resolved to a schema component
    • setTargetComponentName Link icon

      public void setTargetComponentName(StructuredQName name)
    • getTargetComponentName Link icon

      public StructuredQName getTargetComponentName()
      Description copied from interface: ComponentReference
      Get the name of the target of this reference
      Specified by:
      getTargetComponentName in interface ComponentReference
      Returns:
      the component name of the target component
    • getTargetFingerprint Link icon

      public int getTargetFingerprint()
    • getSymbolSpace Link icon

      public int getSymbolSpace()
      Get the symbol space of the target of this reference
      Specified by:
      getSymbolSpace in interface ComponentReference
      Returns:
      an integer code identifying the symbol space
    • getTarget Link icon

      public SchemaComponent getTarget() throws MissingComponentException
      Returns the schema component that this is a reference to
      Specified by:
      getTarget in interface ComponentReference
      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 Link icon

      public void setTarget(SchemaComponent target)
      Set the target component
      Parameters:
      target - the component that this reference points to
    • tryToResolve Link icon

      public void tryToResolve(SchemaCompiler compiler, boolean fatal) throws SchemaException
      Attempt to resolve this reference using the components defined in a given schema. No error results if the reference cannot be resolved.
      Specified by:
      tryToResolve in interface ComponentReference
      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 Link icon

      public boolean isDangling()
      Ask whether this is known to be a dangling reference
      Specified by:
      isDangling in interface ComponentReference
      Returns:
      true if the target of this component reference is known to be absent, and if a warning has been issued to this effect