org.exolab.castor.xml.schema

Class AttributeGroupDecl

Implemented Interfaces:
java.io.Serializable

public final class AttributeGroupDecl
extends AttributeGroup

An XML Schema Attribute Group Definition
Version:
$Revision: 1.2 $ $Date: 2003/03/03 09:57:19 $
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

AttributeGroupDecl(Schema schema)
Creates a new AttributeGroup definition

Method Summary

void
addAttribute(AttributeDecl attrDecl)
Adds the given attribute definition to this AttributeGroup
void
addReference(AttributeGroupReference attrGroup)
Adds the given AttributeGroupReference to this AttributeGroup
Wildcard
getAnyAttribute()
Returns the wilcard used in this complexType (can be null)
AttributeDecl
getAttribute(String name)
Returns the AttributeDecl associated with the given name
Enumeration
getAttributes()
Returns an Enumeration of all the attributes of this attribute group.
Enumeration
getLocalAttributeGroupReferences()
Returns the AttributeGroupReference of THIS attribute group.
Enumeration
getLocalAttributes()
Returns the attributes of THIS attribute group.
String
getName()
Returns the name of this AttributeGroup
Schema
getSchema()
Returns the Schema that this AttributeGroupDecl belongs to.
short
getStructureType()
Returns the type of this Schema Structure
boolean
isEmpty()
Returns true if this AttributeGroup does not contain any AttributeDecls or any non-empty AttributeGroups
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 Group
void
setName(String name)
Sets the name of this AttributeGroup
void
validate()
Checks the validity of this Attribute declaration

Methods inherited from class org.exolab.castor.xml.schema.AttributeGroup

getAnyAttribute, getAttribute, getAttributes, getId, getStructureType, isEmpty, setId, validate

Methods inherited from class org.exolab.castor.xml.schema.Annotated

addAnnotation, getAnnotations, removeAnnotation

Methods inherited from class org.exolab.castor.xml.schema.Structure

getStructureType, isValid, validate

Constructor Details

AttributeGroupDecl

public AttributeGroupDecl(Schema schema)
Creates a new AttributeGroup definition
Parameters:
schema - the Schema that this AttributeGroup belongs to.

Method Details

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

getAnyAttribute

public Wildcard getAnyAttribute()
Returns the wilcard used in this complexType (can be null)
Overrides:
getAnyAttribute in interface AttributeGroup
Returns:
the wilcard used in this complexType (can be null)

getAttribute

public AttributeDecl getAttribute(String name)
Returns the AttributeDecl associated with the given name
Overrides:
getAttribute in interface AttributeGroup
Returns:
the AttributeDecl associated with the given name, or null if no AttributeDecl with the given name was found.

getAttributes

public Enumeration getAttributes()
Returns an Enumeration of all the attributes of this attribute group. The enumeration includes attributes from all AttributeGroupReferences contained in this AttributeGroup.
Overrides:
getAttributes in interface AttributeGroup
Returns:
an Enumeration of all the attributes of this attribute group.

getLocalAttributeGroupReferences

public Enumeration getLocalAttributeGroupReferences()
Returns the AttributeGroupReference of THIS attribute group. (not those of the nested groups)

getLocalAttributes

public Enumeration getLocalAttributes()
Returns the attributes of THIS attribute group. (not those of the nested groups)

getName

public 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

getStructureType

public short getStructureType()
Returns the type of this Schema Structure
Overrides:
getStructureType in interface AttributeGroup
Returns:
the type of this Schema Structure

isEmpty

public boolean isEmpty()
Returns true if this AttributeGroup does not contain any AttributeDecls or any non-empty AttributeGroups
Overrides:
isEmpty in interface AttributeGroup
Returns:
true if this AttributeGroup does not contain any AttributeDecls or any non-empty AttributeGroups

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:

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 .

setName

public void setName(String name)
Sets the name of this AttributeGroup
Parameters:
name - the name of this AttributeGroup

validate

public void validate()
            throws ValidationException
Checks the validity of this Attribute declaration
Overrides:
validate in interface AttributeGroup
Throws:
ValidationException - when this Attribute declaration is invalid

Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com