Package org.exolab.castor.xml.schema
Class AttributeGroupDecl
- java.lang.Object
-
- org.exolab.castor.xml.schema.Structure
-
- org.exolab.castor.xml.schema.Annotated
-
- org.exolab.castor.xml.schema.AttributeGroup
-
- org.exolab.castor.xml.schema.AttributeGroupDecl
-
- All Implemented Interfaces:
java.io.Serializable
public final class AttributeGroupDecl extends AttributeGroup
An XML Schema Attribute Group Definition- Version:
- $Revision: 6230 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
- Author:
- Keith Visco
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.exolab.castor.xml.schema.Structure
ANNOTATION, ANYTYPE, APPINFO, ATTRIBUTE, ATTRIBUTE_GROUP, COMPLEX_CONTENT, COMPLEX_TYPE, DOCUMENTATION, ELEMENT, FACET, GROUP, IDENTITY_FIELD, IDENTITY_SELECTOR, KEY, KEYREF, LIST, MODELGROUP, MODELGROUP_REF, REDEFINE, SCHEMA, SIMPLE_CONTENT, SIMPLE_TYPE, UNION, UNIQUE, UNKNOWN, WILDCARD
-
-
Constructor Summary
Constructors Constructor Description AttributeGroupDecl(Schema schema)
Creates a new AttributeGroup definition
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(AttributeDecl attrDecl)
Adds the given attribute definition to this AttributeGroupvoid
addReference(AttributeGroupReference attrGroup)
Adds the given AttributeGroupReference to this AttributeGroupWildcard
getAnyAttribute()
Returns the wilcard used in this complexType (can be null)AttributeDecl
getAttribute(java.lang.String name)
Returns the AttributeDecl associated with the given namejava.util.Enumeration
getAttributes()
Returns an Enumeration of all the attributes of this attribute group.java.util.Enumeration
getLocalAttributeGroupReferences()
Returns the AttributeGroupReference of THIS attribute group.java.util.Enumeration
getLocalAttributes()
Returns the attributes of THIS attribute group.java.lang.String
getName()
Returns the name of this AttributeGroupSchema
getSchema()
Returns the Schema that this AttributeGroupDecl belongs to.short
getStructureType()
Returns the type of this Schema Structureboolean
isEmpty()
Returns true if this AttributeGroup does not contain any AttributeDecls or any non-empty AttributeGroupsboolean
isRedefined()
Returns true if this attributeGroupDecl is a redefinition.boolean
removeAttribute(AttributeDecl attr)
Removes the given AttributeDecl from this AttributeGroup.boolean
removeReference(AttributeGroupReference attrGroupReference)
Removes the given AttributeGroupReference from this AttributeGroup.void
setAnyAttribute(Wildcard wildcard)
Sets the wildcard (anyAttribute) of this attribute Groupvoid
setName(java.lang.String name)
Sets the name of this AttributeGroupvoid
setRedefined()
Sets this Group has redefined.void
validate()
Checks the validity of this Attribute declaration-
Methods inherited from class org.exolab.castor.xml.schema.AttributeGroup
getId, setId
-
Methods inherited from class org.exolab.castor.xml.schema.Annotated
addAnnotation, getAnnotations, removeAnnotation
-
-
-
-
Constructor Detail
-
AttributeGroupDecl
public AttributeGroupDecl(Schema schema)
Creates a new AttributeGroup definition- Parameters:
schema
- the Schema that this AttributeGroup belongs to.
-
-
Method Detail
-
addAttribute
public void addAttribute(AttributeDecl attrDecl)
Adds the given attribute definition to this AttributeGroup- Parameters:
attrDecl
- the AttributeDecl to add
-
addReference
public void addReference(AttributeGroupReference attrGroup)
Adds the given AttributeGroupReference to this AttributeGroup- Parameters:
attrGroup
- the AttributeGroupReference to add
-
getLocalAttributes
public java.util.Enumeration getLocalAttributes()
Returns the attributes of THIS attribute group. (not those of the nested groups)
-
getLocalAttributeGroupReferences
public java.util.Enumeration getLocalAttributeGroupReferences()
Returns the AttributeGroupReference of THIS attribute group. (not those of the nested groups)
-
getAnyAttribute
public Wildcard getAnyAttribute()
Returns the wilcard used in this complexType (can be null)- Specified by:
getAnyAttribute
in classAttributeGroup
- Returns:
- the wilcard used in this complexType (can be null)
-
getAttribute
public AttributeDecl getAttribute(java.lang.String name)
Returns the AttributeDecl associated with the given name- Specified by:
getAttribute
in classAttributeGroup
- Returns:
- the AttributeDecl associated with the given name, or null if no AttributeDecl with the given name was found.
-
getAttributes
public java.util.Enumeration getAttributes()
Returns an Enumeration of all the attributes of this attribute group. The enumeration includes attributes from all AttributeGroupReferences contained in this AttributeGroup.- Specified by:
getAttributes
in classAttributeGroup
- Returns:
- an Enumeration of all the attributes of this attribute group.
-
getName
public java.lang.String getName()
Returns the name of this AttributeGroup- Returns:
- the name of this AttributeGroup, or null, if no name was defined.
-
getSchema
public Schema getSchema()
Returns the Schema that this AttributeGroupDecl belongs to.- Returns:
- the Schema that this AttributeGroupDecl belongs to
-
isEmpty
public boolean isEmpty()
Returns true if this AttributeGroup does not contain any AttributeDecls or any non-empty AttributeGroups- Specified by:
isEmpty
in classAttributeGroup
- Returns:
- true if this AttributeGroup does not contain any AttributeDecls or any non-empty AttributeGroups
-
isRedefined
public boolean isRedefined()
Returns true if this attributeGroupDecl is a redefinition.- Returns:
- true if this attributeGroupDecl is a redefinition.
-
removeAttribute
public boolean removeAttribute(AttributeDecl attr)
Removes the given AttributeDecl from this AttributeGroup.- Parameters:
attr
- the attribute to remove.
-
removeReference
public boolean removeReference(AttributeGroupReference attrGroupReference)
Removes the given AttributeGroupReference from this AttributeGroup.- Parameters:
attrGroupReference
- the AttributeGroupReference to remove.
-
setAnyAttribute
public void setAnyAttribute(Wildcard wildcard) throws SchemaException
Sets the wildcard (anyAttribute) of this attribute Group- Throws:
SchemaException
- thrown when a wildcard as already be set or when the wildCard is not an <anyAttribute>.
-
setName
public void setName(java.lang.String name)
Sets the name of this AttributeGroup- Parameters:
name
- the name of this AttributeGroup
-
setRedefined
public void setRedefined()
Sets this Group has redefined.
-
getStructureType
public short getStructureType()
Returns the type of this Schema Structure- Overrides:
getStructureType
in classAttributeGroup
- Returns:
- the type of this Schema Structure
-
validate
public void validate() throws ValidationException
Checks the validity of this Attribute declaration- Overrides:
validate
in classAttributeGroup
- Throws:
ValidationException
- when this Attribute declaration is invalid
-
-