|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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 |
Constructor Summary | |
---|---|
AttributeGroupDecl(SchemaAwareConfiguration config)
Creates a new AttributeGroup definition. |
Method Summary | |
---|---|
void |
addAttributeGroupReference(AttributeGroupReference attrGroup)
Adds the given AttributeGroupReference to this AttributeGroup. |
void |
addAttributeUse(AttributeUse use)
Add the given attribute use 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. |
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 |
String |
getName()
Returns the local part of the name of this named AttributeGroup. |
String |
getTargetNamespace()
Returns the namespace URI of the name of this named AttributeGroup. |
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(SchemaModelSerializer serializer)
Serialize the schema component |
void |
serializeContents(SchemaModelSerializer serializer)
Serialize the list of attribute users and wildcard |
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. |
boolean |
validate(SchemaCompiler compiler)
Check the validity of this AttributeGroup declaration. |
Methods inherited from class com.saxonica.schema.SchemaStructure |
---|
elaborate, 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 com.saxonica.schema.UserSchemaComponent |
---|
elaborate |
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 String getName()
public String getTargetNamespace()
public void addAttributeUse(AttributeUse use)
use
- the AttributeUse to addpublic void addAttributeGroupReference(AttributeGroupReference attrGroup)
attrGroup
- the AttributeGroupReference to addpublic void setRedefinedAttributeGroupDecl(AttributeGroupDecl other)
other
- the attribute group declaration that this attribute group redefinespublic 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
- used to report errors and warnings
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)
list
- the list to which the contained attribute declarations should be appendedpublic String getDisplayName()
public void setAnyAttribute(AttributeWildcard wildcard)
wildcard
- the wildcard defining the xs:anyAttribute content of this attribute group,
if any.public boolean fixup(SchemaCompiler compiler) throws SchemaException
fixup
in interface UserSchemaComponent
fixup
in class SchemaStructure
compiler
- used for reporting errors and warnings
SchemaException
public boolean validate(SchemaCompiler compiler) throws SchemaException
validate
in interface UserSchemaComponent
compiler
- used for reporting errors and warnings
SchemaException
- if this Attribute declaration
is invalid and the error listener chooses to treat the error
as fatal.public boolean isValidRestriction(AttributeGroupDecl base, SchemaCompiler compiler) throws SchemaException
base
- the other attribute groupcompiler
- user for reporting errors and warnings
SchemaException
- if an error is detected and the error listener
decides to treat the error as fatal.public boolean isSameDeclaration(AttributeGroupDecl other)
other
- the attribute group declaration that we are comparing with
public int getFingerprint()
public void setNameCode(int nameCode)
nameCode
- the fingerprint of the name, in the NamePoolpublic 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(SchemaModelSerializer serializer) throws XPathException
serialize
in interface SerializableSchemaComponent
XPathException
public void serializeContents(SchemaModelSerializer serializer) throws XPathException
serializer
- the object to which the information is to be sent
XPathException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |