Class AttributeGroupReference

  • All Implemented Interfaces:
    ComponentReference, javax.xml.transform.SourceLocator, Location, org.xml.sax.Locator

    public final class AttributeGroupReference
    extends SchemaStructure
    implements ComponentReference
    An XML Schema Attribute Group Reference, corresponding to an xs:attributeGroup element with a 'ref' attribute.
    • Constructor Detail

      • AttributeGroupReference

        public AttributeGroupReference​(EnterpriseConfiguration config,
                                       StructuredQName target)
        Creates a new AttributeGroup reference
        Parameters:
        config - the Configuration that this AttributeGroup belongs to.
        target - The name of the referenced attribute group (that is, the name contained in the 'ref' attribute)
    • Method Detail

      • isResolved

        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
      • isDangling

        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
      • getSymbolSpace

        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
      • setTargetComponentName

        public void setTargetComponentName​(StructuredQName target)
        Set the fingerprint of the target of this reference
        Parameters:
        target - the the name of the referenced attribute group
      • getAttributeWildcard

        protected AttributeWildcard getAttributeWildcard​(SchemaCompiler compiler,
                                                         java.util.Stack<AttributeGroupDecl> stack)
        Returns the attribute wildcard in the referenced attribute group, if any.
        Parameters:
        compiler - May be null if used at validation time.
        Returns:
        the the attribute wildcard (xs:anyAttribute element) in the referenced attribute group, if there is one; otherwise null.
        Throws:
        MissingComponentException - if the reference to the attribute group declaration cannot be resolved
      • fixup

        public boolean fixup​(SchemaCompiler compiler)
                      throws SchemaException
        Fix up references to other elements in the schema.
        Overrides:
        fixup in class SchemaStructure
        Parameters:
        compiler - the schema compiler
        Returns:
        true if fixup succeeds, false if it fails.
        Throws:
        SchemaException - if a fatal error occurs
      • validate

        public boolean validate​(SchemaCompiler compiler)
                         throws SchemaException
        Checks the validity of this Schema component. For internal use only.
        Parameters:
        compiler - the schema compiler
        Returns:
        true when this Schema definition is valid, otherwise false.
        Throws:
        SchemaException
      • lookForCycles

        public void lookForCycles​(java.util.Stack references,
                                  SchemaCompiler compiler)
                           throws SchemaException
        Check for cycles in the attribute group. For internal use only.
        Overrides:
        lookForCycles in class SchemaStructure
        Parameters:
        references - A list of attribute groups that reference this one, directly or indirectly.
        compiler - the schema compiler
        Throws:
        SchemaException - if a circularity is detected.
      • 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 interface ComponentReference
        Parameters:
        compiler - The compiler being used to compile the referring component.
        fatal -
        Throws:
        SchemaException - if the reference cannot be resolved or repaired.
      • elaborate

        public void elaborate​(SchemaCompiler compiler)
        Elaborate the schema component: after reloading a serialized schema component model, this expands the component with derived information needed during validation episodes. The model is assumed to be valid.
        Overrides:
        elaborate in class SchemaStructure
        Parameters:
        compiler - the schema compiler