|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.saxonica.schema.SchemaStructure
com.saxonica.schema.AttributeGroupDecl
An XML Schema Attribute Group Declaration. This represents a named attribute group, but not an attribute group reference. As well as attribute groups explicitly written in the schema using xsl:attributeGroup, this class is also used to represent any collection of attributes defined using xsl:attribute elements as part of a complex type definition.
In contrast with the Attribute Group Definition schema component as defined in the
W3C specification, the model retains explicit references to subsidiary attribute group
definitions. However, the method getAttributeUses()
performs the transitive
closure of these references, returning all the attributes at the leaves of the tree.
Field Summary |
Fields inherited from interface net.sf.saxon.type.SchemaComponent |
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING |
Constructor Summary | |
AttributeGroupDecl(PreparedSchema schema)
Creates a new AttributeGroup definition. |
Method Summary | |
void |
addAttribute(AttributeUse attrDecl)
Adds the given attribute definition to this AttributeGroup. |
void |
addReference(AttributeGroupReference attrGroup)
Adds the given AttributeGroupReference to this AttributeGroup. |
boolean |
fixup(PreparedSchema schema)
Check references from this component to other components |
void |
gatherAttributeUses(java.util.List list)
Append all attribute declarations contained directly or indirectly in this attribute group to a supplied List. |
AttributeUse |
getAttributeUse(int fingerprint)
Get the attribute use with a specific name, if there is one. |
java.util.Iterator |
getAttributeUses()
Returns an Iterator over all the attribute uses of this attribute group. |
AttributeWildcard |
getAttributeWildcard(PreparedSchema schema)
Get the complete attribute wildcard used in this attribute group. |
IntHashMap |
getDeclaredAttributes()
Get a HashMap containing all the attributes in this attribute group, expanded recursively. |
java.lang.String |
getDisplayName()
Returns the name of this AttributeGroup |
int |
getFingerprint()
Get the fingerprint of the name of the attribute group |
java.util.Iterator |
getLocalAttributeGroupReferences()
Returns the AttributeGroup references contained locally in this attribute group. |
java.util.Iterator |
getLocalAttributes()
Returns the attributes defined locally in this attribute group. |
AttributeWildcard |
getLocalAttributeWildcard()
Get the local attribute wildcard used in this attribute group |
PreparedSchema |
getSchema()
Get the schema in which this attribute group is defined. |
boolean |
isSameDeclaration(AttributeGroupDecl other)
Test whether this is the same type as another type. |
boolean |
isValidRestriction(AttributeGroupDecl base,
PreparedSchema schema)
Test whether this attribute group is a valid restriction of another attribute group. |
void |
lookForCycles(PreparedSchema schema,
java.util.Stack references)
Check for cycles in the attribute group. |
void |
setAnyAttribute(AttributeWildcard wildcard)
Sets the wildcard (anyAttribute) of this attribute Group. |
void |
setNameCode(int nameCode)
Set the nameCode of the name of this attribute group. |
void |
setRedefinedAttributeGroupDecl(AttributeGroupDecl other)
Set the attribute group that this attribute group redefines. |
void |
setSchema(PreparedSchema schema)
Set the schema that this attribute group belongs to. |
boolean |
validate(PreparedSchema schema)
Checks the validity of this AttributeGroup declaration. |
Methods inherited from class com.saxonica.schema.SchemaStructure |
getColumnNumber, getFixupStatus, getLineNumber, getPublicId, getSystemId, getValidationStatus, setFixupStatus, setLineNumber, setLocator, setSystemId, setValidationStatus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.saxon.type.SchemaComponent |
getValidationStatus |
Constructor Detail |
public AttributeGroupDecl(PreparedSchema schema)
schema
- the Schema that this AttributeGroup
belongs to.Method Detail |
public void addAttribute(AttributeUse attrDecl)
attrDecl
- the Attribute Declaration to addpublic void addReference(AttributeGroupReference attrGroup)
attrGroup
- the AttributeGroupReference to addpublic void setRedefinedAttributeGroupDecl(AttributeGroupDecl other)
public java.util.Iterator getLocalAttributes()
AttributeDecl
public java.util.Iterator getLocalAttributeGroupReferences()
AttributeGroupReference
public void lookForCycles(PreparedSchema schema, java.util.Stack references) throws SchemaException
lookForCycles
in interface UserSchemaComponent
lookForCycles
in class SchemaStructure
schema
- references
- The attribute groups that contain direct or indirect references
to this attribute group
SchemaException
- if a circularity is detected.public AttributeWildcard getLocalAttributeWildcard()
public AttributeWildcard getAttributeWildcard(PreparedSchema schema) throws UnresolvedReferenceException
schema
-
UnresolvedReferenceException
public java.util.Iterator getAttributeUses()
AttributeDecl
objects. The iterator does
not include attribute wildcards.public void gatherAttributeUses(java.util.List list)
public java.lang.String getDisplayName()
public void setAnyAttribute(AttributeWildcard wildcard)
public boolean fixup(PreparedSchema schema) throws SchemaException
fixup
in interface UserSchemaComponent
schema
- The schema is used for reporting errors
SchemaException
public boolean validate(PreparedSchema schema) throws SchemaException, ValidationException
validate
in interface UserSchemaComponent
schema
- the containing schema, used for error reporting
SchemaException
- if this Attribute declaration
is invalid and the error listener chooses to treat the error
as fatal.
ValidationException
public boolean isValidRestriction(AttributeGroupDecl base, PreparedSchema schema) throws SchemaException, ValidationException
base
- the other attribute groupschema
- the containing schema (used for reporting errors)
SchemaException
- if an error is detected and the error listener
decides to treat the error as fatal.
ValidationException
public boolean isSameDeclaration(AttributeGroupDecl other)
public int getFingerprint()
public void setNameCode(int nameCode)
nameCode
- the fingerprint of the name, in the NamePoolpublic void setSchema(PreparedSchema schema)
setSchema
in class SchemaStructure
schema
- the owning schemapublic PreparedSchema getSchema()
getSchema
in class SchemaStructure
public IntHashMap getDeclaredAttributes()
public final AttributeUse getAttributeUse(int fingerprint)
fingerprint
- the fingerprint identifying the expanded name of the required
attribute in the name pool.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |