public final class AttributeGroupDecl extends SchemaStructure implements UserSchemaComponent, SerializableSchemaComponent
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.
COMPONENT_FUNCTION_TYPE, FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING
Constructor and Description |
---|
AttributeGroupDecl(EnterpriseConfiguration config)
Creates a new AttributeGroup definition.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeGroupReference(AttributeGroupReference attrGroup)
Adds the given AttributeGroupReference to this AttributeGroup.
|
void |
addAttributeUse(AttributeUse use)
Add the given attribute use to this AttributeGroup.
|
void |
buildCounterMap()
Build the counter map
|
void |
elaborate(SchemaCompiler compiler)
Elaborate the schema component: after reloading a serialized schema component model,
this expands the component with derived information needed during validation episodes.
|
boolean |
fixup(SchemaCompiler compiler)
Check references from this component to other components
|
StructuredQName |
getAttributeGroupName()
Get the name of this attribute group, as a qualified name
|
AttributeUse |
getAttributeUse(StructuredQName attributeName)
Get the attribute use with a specific name, if there
is one.
|
List<AttributeUse> |
getAttributeUses()
Returns a list of all the attribute uses of this
attribute group.
|
AttributeWildcard |
getAttributeWildcard(SchemaCompiler compiler)
Get the complete attribute wildcard used in this attribute group.
|
protected AttributeWildcard |
getAttributeWildcard(SchemaCompiler compiler,
Stack<AttributeGroupDecl> stack) |
Function |
getComponentAsFunction()
Get the schema component in the form of a function item.
|
IntToIntMap |
getCounterMap()
Get the counter map used to map attribute names to positions in an array of
counters used during instance validation
|
IntHashMap<AttributeUse> |
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
|
List<AttributeGroupReference> |
getLocalAttributeGroupReferences()
Returns the AttributeGroup references contained locally in this attribute group.
|
List<AttributeUse> |
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 attribute group as another.
|
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 |
setAttributeGroupName(StructuredQName name)
Set 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.
|
getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, makeXPathExpressionPropertyRecord, saveLocation, setConfiguration, setFixupStatus, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRedefinitionLevel, getValidationStatus
public AttributeGroupDecl(EnterpriseConfiguration config)
config
- the EnterpriseConfiguration that this AttributeGroup
belongs to.public StructuredQName getAttributeGroupName()
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 List<AttributeUse> getLocalAttributes()
public List<AttributeGroupReference> getLocalAttributeGroupReferences()
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 warningsSchemaException
- if a circularity is detected.public AttributeWildcard getLocalAttributeWildcard()
public AttributeWildcard getAttributeWildcard(SchemaCompiler compiler) throws MissingComponentException
compiler
- Used for error reporting. May be null if used at validation time.MissingComponentException
- if a required component contains a reference
to another component that is not present in the schemaprotected AttributeWildcard getAttributeWildcard(SchemaCompiler compiler, Stack<AttributeGroupDecl> stack) throws MissingComponentException
MissingComponentException
public List<AttributeUse> getAttributeUses() throws MissingComponentException
MissingComponentException
public IntToIntMap getCounterMap()
public 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 warningsSchemaException
public boolean validate(SchemaCompiler compiler) throws SchemaException
validate
in interface UserSchemaComponent
compiler
- used for reporting errors and warningsSchemaException
- if this Attribute declaration
is invalid and the error listener chooses to treat the error
as fatal.public void buildCounterMap() throws MissingComponentException
MissingComponentException
public boolean isValidRestriction(AttributeGroupDecl base, SchemaCompiler compiler) throws SchemaException
base
- the other attribute groupcompiler
- user for reporting errors and warningsSchemaException
- 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 withpublic void setAttributeGroupName(StructuredQName name)
name
- the name of this attribute grouppublic IntHashMap<AttributeUse> getDeclaredAttributes() throws MissingComponentException
MissingComponentException
public final AttributeUse getAttributeUse(StructuredQName attributeName) throws MissingComponentException
attributeName
- the expanded name of the required attribute in the name pool.MissingComponentException
public void serialize(SchemaModelSerializer serializer) throws XPathException
serialize
in interface SerializableSchemaComponent
serializer
- the object responsible for performing the serializationMissingComponentException
- if the component cannot be serialized because it contains dangling referencesXPathException
- if serialization failspublic void serializeContents(SchemaModelSerializer serializer) throws XPathException
serializer
- the object to which the information is to be sentXPathException
- if a failure occurspublic void elaborate(SchemaCompiler compiler) throws SchemaException
elaborate
in interface UserSchemaComponent
elaborate
in class SchemaStructure
compiler
- the schema compilerSchemaException
public Function getComponentAsFunction()
SchemaComponent
getComponentAsFunction
in interface SchemaComponent
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.