|
|||||||
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
public final class 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 |
Fields inherited from interface com.saxonica.schema.SerializableSchemaComponent |
---|
ALL_COMPOSITOR, ATOMIC_TYPE, ATTRIBUTE_DECL, ATTRIBUTE_GROUP, ATTRIBUTE_GROUP_REF, ATTRIBUTE_USE, ATTRIBUTE_WILDCARD, CHOICE_COMPOSITOR, COMPLEX_TYPE, ELEMENT_DECL, ELEMENT_PARTICLE, ELEMENT_WILDCARD, FACET, KEY, KEYREF, LIST_TYPE, MODEL_GROUP, MODEL_GROUP_REF, NOTATION, SEQUENCE_COMPOSITOR, UNION_TYPE, UNIQUE |
Constructor Summary | |
---|---|
AttributeGroupDecl(SchemaAwareConfiguration config)
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(SchemaCompiler compiler)
Check references from this component to other components |
void |
gatherAttributeUses(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. |
Iterator |
getAttributeUses()
Returns an Iterator over all the attribute uses of this attribute group. |
AttributeWildcard |
getAttributeWildcard(SchemaCompiler compiler)
Get the complete attribute wildcard used in this attribute group. |
int |
getComponentTypeCode()
Get a unique number identifying the type of component |
IntHashMap |
getDeclaredAttributes()
Get a HashMap containing all the attributes in this attribute group, expanded recursively. |
String |
getDisplayName()
Return the name of this AttributeGroup, for display purposes |
int |
getFingerprint()
Get the fingerprint of the name of the attribute group |
Iterator |
getLocalAttributeGroupReferences()
Returns the AttributeGroup references contained locally in this attribute group. |
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,
SchemaCompiler compiler)
Test whether this attribute group is a valid restriction of another attribute group. |
void |
lookForCycles(Stack references,
SchemaCompiler compiler)
Check for cycles in the attribute group. |
void |
serialize(SchemaSerializer serializer)
Serialize the schema component |
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(SchemaCompiler compiler)
Check the validity of this AttributeGroup declaration. |
Methods inherited from class com.saxonica.schema.SchemaStructure |
---|
getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getSystemId, getValidationStatus, setConfiguration, setFixupStatus, setLineNumber, setLocator, setSystemId, setValidationStatus |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.saxon.type.SchemaComponent |
---|
getValidationStatus |
Constructor Detail |
---|
public AttributeGroupDecl(SchemaAwareConfiguration config)
config
- the SchemaAwareConfiguration 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 Iterator getLocalAttributes()
AttributeDecl
public Iterator getLocalAttributeGroupReferences()
AttributeGroupReference
public void lookForCycles(Stack references, SchemaCompiler compiler) throws SchemaException
lookForCycles
in interface UserSchemaComponent
lookForCycles
in class SchemaStructure
references
- The attribute groups that contain direct or indirect references
to this attribute groupcompiler
-
SchemaException
- if a circularity is detected.public AttributeWildcard getLocalAttributeWildcard()
public AttributeWildcard getAttributeWildcard(SchemaCompiler compiler) throws UnresolvedReferenceException
compiler
- Used for error reporting. May be null if used at validation time.
UnresolvedReferenceException
public Iterator getAttributeUses()
AttributeDecl
objects. The iterator does
not include attribute wildcards.public void gatherAttributeUses(List list)
public String getDisplayName()
public void setAnyAttribute(AttributeWildcard wildcard)
public boolean fixup(SchemaCompiler compiler) throws SchemaException
fixup
in interface UserSchemaComponent
compiler
-
SchemaException
public boolean validate(SchemaCompiler compiler) throws SchemaException, ValidationException
validate
in interface UserSchemaComponent
compiler
-
SchemaException
- if this Attribute declaration
is invalid and the error listener chooses to treat the error
as fatal.
ValidationException
public boolean isValidRestriction(AttributeGroupDecl base, SchemaCompiler compiler) throws SchemaException
base
- the other attribute group
SchemaException
- if an error is detected and the error listener
decides to treat the error as fatal.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)
schema
- the owning schemapublic PreparedSchema getSchema()
public IntHashMap getDeclaredAttributes()
public final AttributeUse getAttributeUse(int fingerprint)
fingerprint
- the fingerprint identifying the expanded name of the required
attribute in the name pool.
public void serialize(SchemaSerializer serializer) throws IOException
serialize
in interface SerializableSchemaComponent
IOException
public int getComponentTypeCode()
getComponentTypeCode
in interface SerializableSchemaComponent
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |