Free Trial - Stylus Studio, The World's Best XML IDE!


com.saxonica.schema
Class AttributeGroupReference

java.lang.Object
  |
  +--com.saxonica.schema.SchemaElement
        |
        +--com.saxonica.schema.AttributeGroup
              |
              +--com.saxonica.schema.AttributeGroupReference
All Implemented Interfaces:
CircularityChecker, SchemaComponent, SchemaDeclaration, java.io.Serializable, javax.xml.transform.SourceLocator

public final class AttributeGroupReference
extends AttributeGroup
implements SchemaComponent, CircularityChecker

An XML Schema Attribute Group Reference, corresponding to an xs:attributeGroup element with a 'ref' attribute.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.saxonica.schema.SchemaElement
ANNOTATION, ANYTYPE, APPINFO, ATTRIBUTE, ATTRIBUTE_GROUP, COMPLEX_CONTENT, COMPLEX_TYPE, COMPOSITOR, DOCUMENTATION, ELEMENT, FACET, GROUP, IDENTITY_FIELD, IDENTITY_SELECTOR, KEY, KEYREF, LIST, REDEFINE, SCHEMA, SIMPLE_CONTENT, SIMPLE_TYPE, UNION, UNIQUE, UNKNOWN, WILDCARD_ATTRIBUTE, WILDCARD_ELEMENT
 
Constructor Summary
AttributeGroupReference(Schema schema, int fingerprint)
          Creates a new AttributeGroup reference
 
Method Summary
 boolean fixup(Schema schema)
          Fixup the reference to the relevant attribute group.
 java.util.Iterator getAttributes()
          Returns an enumeration of the AttributeDecls and AttributeGroups of this AttributeGroup
 AttributeWildcard getAttributeWildcard()
          Returns the attribute wildcard in the referenced attribute group, if any.
 boolean isEmpty()
          Returns true if this AttributeGroup does not contain any AttributeDecls or any non-empty AttributeGroups
 void lookForCycles(Schema schema, java.util.Stack references)
          Check for cycles in the attribute group.
 AttributeGroupDecl resolveReference()
          Resolves the attribute group reference
 boolean validate(Schema schema)
          Checks the validity of this Schema component.
 
Methods inherited from class com.saxonica.schema.AttributeGroup
getAttributeUse, getDeclaredAttributes, getFingerprint, getId, getSchema, getStructureType, setFingerprint, setId, setSchema
 
Methods inherited from class com.saxonica.schema.SchemaElement
getColumnNumber, getLineNumber, getPublicId, getSystemId, setLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeGroupReference

public AttributeGroupReference(Schema schema,
                               int fingerprint)
Creates a new AttributeGroup reference

Parameters:
schema - the Schema that this AttributeGroup belongs to.
fingerprint - The NamePool fingerprint of the name of the attribute group (that is, the name contained in the 'ref' attribute)
Method Detail

getAttributeWildcard

public AttributeWildcard getAttributeWildcard()
Returns the attribute wildcard in the referenced attribute group, if any.

Specified by:
getAttributeWildcard in class AttributeGroup
Returns:
the the attribute wildcard (xs:anyAttribute element) in the referenced attribute group, if there is one; otherwise null.

fixup

public boolean fixup(Schema schema)
              throws SchemaException
Fixup the reference to the relevant attribute group. For internal use only.

Specified by:
fixup in interface SchemaComponent
Parameters:
schema - The containing schema (for error reporting)
Returns:
true if no errors were found. If there were errors, these are reported to the error listener, and the function returns false.
SchemaException

validate

public boolean validate(Schema schema)
                 throws javax.xml.transform.TransformerException
Checks the validity of this Schema component. For internal use only.

Specified by:
validate in interface SchemaComponent
Parameters:
schema - if this is not null, any errors that are detected should be reported using the error() method of this schema.
Returns:
true when this Schema definition is valid, otherwise false.
Throws:
javax.xml.transform.TransformerException - if the ErrorListener decides that an error is fatal.

lookForCycles

public void lookForCycles(Schema schema,
                          java.util.Stack references)
                   throws SchemaException
Check for cycles in the attribute group. For internal use only.

Specified by:
lookForCycles in interface CircularityChecker
Overrides:
lookForCycles in class AttributeGroup
Parameters:
schema - The containing schema, used for error reporting.
references - A list of attribute groups that reference this one, directly or indirectly.
Throws:
SchemaException - if a circularity is detected.

resolveReference

public AttributeGroupDecl resolveReference()
Resolves the attribute group reference

Returns:
the attribute group defined at the schema level that is refered to by this class. May return null if called on an invalid schema containing a dangling reference.

getAttributes

public java.util.Iterator getAttributes()
Returns an enumeration of the AttributeDecls and AttributeGroups of this AttributeGroup

Specified by:
getAttributes in class AttributeGroup
Returns:
an Enumeration of the AttributeDecls and AttributeGroups of this AttributeGroup

isEmpty

public boolean isEmpty()
Returns true if this AttributeGroup does not contain any AttributeDecls or any non-empty AttributeGroups

Returns:
true if this AttributeGroup does not contain any AttributeDecls or any non-empty AttributeGroups


Stylus Studio features integrated development and debugging support for Saxon in the XQuery editor and XSLT editor.