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


com.saxonica.schema
Class AttributeGroup

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

public abstract class AttributeGroup
extends SchemaElement
implements CircularityChecker

An XML Schema Attribute Group Definition. This is either a named global attribute definition (see AttributeGroupDecl), or a reference to a global attribute group definition (see AttributeGroupReference).

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
AttributeGroup()
           
 
Method Summary
abstract  java.util.Iterator getAttributes()
          Returns an Iterator over all the attributes of this attribute group.
 AttributeDecl getAttributeUse(int fingerprint)
          Get the attribute use with a specific name, if there is one.
abstract  AttributeWildcard getAttributeWildcard()
          Returns the anyAttribute defined in this attribute group if any.
 java.util.HashMap getDeclaredAttributes()
          Get a HashMap containing all the attributes in this attribute group, expanded recursively.
 int getFingerprint()
          Get the fingerprint of the name of the attribute group
 java.lang.String getId()
          Returns the id of this AttributeGroup, that is, the value of the 'id' attribute in the schema.
 Schema getSchema()
          Get the schema in which this attribute group is defined.
 short getStructureType()
          Returns the type of this Schema Structure
 void lookForCycles(Schema schema, java.util.Stack references)
          Check for cycles in the attribute group.
 void setFingerprint(int fingerprint)
          Set the fingerprint of the name of this attribute group.
 void setId(java.lang.String id)
          Sets the id of this AttributeGroup.
 void setSchema(Schema schema)
          Set the schema that this attribute group belongs to.
 
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

AttributeGroup

public AttributeGroup()
Method Detail

getFingerprint

public int getFingerprint()
Get the fingerprint of the name of the attribute group

Returns:
the NamePool fingerprint of the attribute group's expanded name

setFingerprint

public void setFingerprint(int fingerprint)
Set the fingerprint of the name of this attribute group. For internal use only.

Parameters:
fingerprint - the fingerprint of the name, in the NamePool

setSchema

public void setSchema(Schema schema)
Set the schema that this attribute group belongs to. For internal use only.

Parameters:
schema - the owning schema

getSchema

public Schema getSchema()
Get the schema in which this attribute group is defined. May return null in the case of a synthetic attribute group that is not actually defined in a schema

Returns:
the containing schema

getAttributeWildcard

public abstract AttributeWildcard getAttributeWildcard()
Returns the anyAttribute defined in this attribute group if any.

Returns:
the anyAttribute defined in this attribute group if there is one, or null otherwise.

getAttributes

public abstract java.util.Iterator getAttributes()
Returns an Iterator over all the attributes of this attribute group. The iteration includes attributes from all AttributeGroupReferences contained in this AttributeGroup.

Returns:
an Iterator over all the attributes of this attribute group, expanded transitively. If this attribute group is a reference, then the attributes from the referenced attribute group are returned.

getDeclaredAttributes

public java.util.HashMap getDeclaredAttributes()
Get a HashMap containing all the attributes in this attribute group, expanded recursively. The key is the integer fingerprint identifying the name of the attribute. The value is an AttributeDecl object identifying the attribute declaration.


getAttributeUse

public final AttributeDecl getAttributeUse(int fingerprint)
Get the attribute use with a specific name, if there is one. Otherwise return null.

Parameters:
fingerprint - the fingerprint identifying the expanded name of the required attribute in the name pool.
Returns:
the attribute with a given name, from among the transitively-expanded definition of this attribute group.

getId

public java.lang.String getId()
Returns the id of this AttributeGroup, that is, the value of the 'id' attribute in the schema.

Returns:
the id of this AttributeGroup, or null if no id was defined.

getStructureType

public short getStructureType()
Returns the type of this Schema Structure

Specified by:
getStructureType in class SchemaElement
Returns:
the type of this Schema Structure: always SchemaElement.ATTRIBUTE_GROUP

setId

public void setId(java.lang.String id)
Sets the id of this AttributeGroup. For internal use only.

Parameters:
id - the id of this AttributeGroup

lookForCycles

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

Specified by:
lookForCycles in interface CircularityChecker
Parameters:
schema - the containing schema, used for error reporting
references - a list of attributes that contain references to this attribute group, directly or indirectly.
Throws:
SchemaException


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