com.bea.schema
Class SOMAttributeGroup

java.lang.Object
  extended bycom.bea.schema.SOMObject
      extended bycom.bea.schema.SOMAttributeGroup
All Implemented Interfaces:
Serializable, SOMReference

public class SOMAttributeGroup
extends SOMObject
implements SOMReference

<attributeGroup> The XML representation for an attribute group definition schema component is an <attributeGroup> element information item. It provides for naming a group of attribute declarations and an attribute wildcard for use by reference in the XML representation of complex type definitions and other attribute group definitions.

Version:
1.0
Author:
sharpe
See Also:
Serialized Form

Constructor Summary
SOMAttributeGroup()
           
SOMAttributeGroup(SOMAttributeGroup ref, SOMObject parent)
          Construct an <attributeGroup> reference
SOMAttributeGroup(String name, SOMObject parent)
           
 
Method Summary
 SOMAttribute add(SOMAttribute attribute)
          add an <attribute> sub-element.
 SOMAttributeGroup add(SOMAttributeGroup attributeGroup)
          add an <attributeGroup> sub-element.
 SOMAnnotation addAnnotation(SOMAnnotation annotation)
          add an annotation.
 SOMAttribute addAttribute(String name)
          add an new <attribute> sub-element.
 SOMAttributeGroup addAttributeGroup(String name)
          add an new <attributeGroup> sub-element.
 boolean contains(SOMObject child)
          Determine if an object is child of this element.
 Iterator getAttributeElements()
          get the iterator over the attribute elements
 Map getAttributes(boolean getAll)
          retrieve the attributes for this schema element.
 String getID()
          Returns a printable element tag for this Schema Object
 String getName()
          get the "name" attribute.
 SOMReference getRef()
          get the "ref" attribute.
 String getRefName()
           
 boolean isRef()
          Is this element a reference to another element.
 Iterator listAttributesExtended()
          iterator over all attribute elements.
 SOMAttribute remove(SOMAttribute child)
          remove an attribute child.
 SOMAttributeGroup remove(SOMAttributeGroup child)
          remove an attribute child.
 SOMAnnotation removeAnnotation()
          set the annotation at this group to null.
 void setName(String name)
          set the "name" attribute.
 void setRef(SOMReference ref)
          set the "ref" attribute.
 void setRef(SOMUnresolvedReference attrGrp)
          set the "ref" attribute.
 void toXML(Writer rtn, int indent)
          Outputs a formatted XML representation of SOMObject.
 
Methods inherited from class com.bea.schema.SOMObject
addPrefixMapping, getContainmentXPath, getEffectivePrefixMappings, getID_UQ, getParent, getParentName, getParentSchema, getPrefixForTargetNamespace, getPrefixMapping, getTargetNamespace, getURIForPrefix, isCircularReference, isSchemaChild, msg, msg, removeNamespaceQualifier, removePrefixMapping, setIndent, setParent, setTargetNamespace, toString, toXML, toXML, toXML
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SOMAttributeGroup

public SOMAttributeGroup()

SOMAttributeGroup

public SOMAttributeGroup(String name,
                         SOMObject parent)

SOMAttributeGroup

public SOMAttributeGroup(SOMAttributeGroup ref,
                         SOMObject parent)
Construct an <attributeGroup> reference

Parameters:
ref - <attributeGroup ref="...">
Method Detail

setName

public void setName(String name)
set the "name" attribute. The actual name of the attributeGroup. For example, <attributeGroup name="myAttributes">

Parameters:
name - the attributeGroup name

setRef

public void setRef(SOMReference ref)
set the "ref" attribute. For example, <attributeGroup ref="myAttributes"> A reference to another attributeGroup. This attributeGroup inherits all the attributes of the reference attributeGroup.

Specified by:
setRef in interface SOMReference

setRef

public void setRef(SOMUnresolvedReference attrGrp)
set the "ref" attribute. For example, <attributeGroup ref="myAttributes"> A reference to another attributeGroup. This attributeGroup inherits all the attributes of the reference attributeGroup.

Parameters:
attrGrp - the attributeGroup to reference

getName

public String getName()
get the "name" attribute. The actual name of the attributeGroup. For example, <attributeGroup name="myAttributes">

Specified by:
getName in interface SOMReference

isRef

public boolean isRef()
Is this element a reference to another element. If the getRef method would return null, this method will return false. Otherwise, it will return true.

Returns:
true if getRef method does not return null

getRef

public SOMReference getRef()
get the "ref" attribute. For example, <attributeGroup ref="myAttributes"> A reference to another attributeGroup. This attributeGroup inherits all the attributes of the reference attributeGroup.


getRefName

public String getRefName()

getID

public String getID()
Description copied from class: SOMObject
Returns a printable element tag for this Schema Object

Specified by:
getID in interface SOMReference
Specified by:
getID in class SOMObject
Returns:
String representation of the element tag

addAttribute

public SOMAttribute addAttribute(String name)
add an new <attribute> sub-element. Creates a new SOMAttribute and adds it to this AttributeGroup

For example:

 <attributeGroup name="myAttrGrp>
   <attribute name="style" type="xsd:string">
 <attributeGroup/>
 

Parameters:
name - the attribute name
Returns:
the added attribute

addAttributeGroup

public SOMAttributeGroup addAttributeGroup(String name)
add an new <attributeGroup> sub-element. Creates a new SOMAttributeGroup and adds it to this AttributeGroup

Parameters:
name - the attribute name
Returns:
the added attribute

add

public SOMAttribute add(SOMAttribute attribute)
add an <attribute> sub-element. If the attribute to be added is a member of another tree, it will be removed and then added to this attributeGroup.

For example:

 <attributeGroup name="myAttrGrp>
   <attribute name="style" type="xsd:string">
 <attributeGroup/>
 

Parameters:
attribute - the attribute reference to be added
Returns:
the added attribute

add

public SOMAttributeGroup add(SOMAttributeGroup attributeGroup)
add an <attributeGroup> sub-element. If the attributeGroup to be added is a member of another tree, it will be removed and then added to this attributeGroup.

For example:

 <attributeGroup name="anotherAttrGrp>
   <attributeGroup ref="myAttrGrp">
 <attributeGroup/>
 

Parameters:
attributeGroup - the attributeGroup reference to be added
Returns:
the added attributeGroup

addAnnotation

public SOMAnnotation addAnnotation(SOMAnnotation annotation)
add an annotation. If the annotation exists in another tree, it will first be removed and then added to this tree.

Parameters:
annotation - a previously created annotation
Returns:
the annotation that was added.

removeAnnotation

public SOMAnnotation removeAnnotation()
set the annotation at this group to null.

Returns:
the removed annotation, or null if none was present

remove

public SOMAttribute remove(SOMAttribute child)
remove an attribute child. Removes an object from this tree that was previously added with one of the add() methods.

Parameters:
child - the object that it is be removed
Returns:
the object removed, or null if the object is not a sub-element of this group type

remove

public SOMAttributeGroup remove(SOMAttributeGroup child)
remove an attribute child. Removes an object from this tree that was previously added with one of the add() methods.

Parameters:
child - the object that it is be removed
Returns:
the object removed, or null if the object is not a sub-element of this group type

contains

public boolean contains(SOMObject child)
Determine if an object is child of this element.

Specified by:
contains in interface SOMReference
Parameters:
child - the object in question
Returns:
true if the child is contained within this structure

getAttributeElements

public Iterator getAttributeElements()
get the iterator over the attribute elements

Returns:
an iterator over the attributes

listAttributesExtended

public Iterator listAttributesExtended()
iterator over all attribute elements. Searches to the bottom of the tree to find all attributes that make up the extended set of attributes for this group. This includes referenced groups and attributes in attributeGroups that make up the children of this attributeGroup.

Returns:
list of SOMAttribute(s)

getAttributes

public Map getAttributes(boolean getAll)
retrieve the attributes for this schema element. If getAll is false, only the attributes that are not set to their default value are returned. If getAll is true, all possible attributes for this element will be returned.

Parameters:
getAll - get all attributes
Returns:
a Hashtable of attributes, where the attribute name and value are stored as strings.

toXML

public void toXML(Writer rtn,
                  int indent)
           throws IOException
Description copied from class: SOMObject
Outputs a formatted XML representation of SOMObject.

Specified by:
toXML in class SOMObject
Parameters:
rtn - printable XML Schema
indent - the indent level for formatting at which to start this schema object.
Throws:
IOException - if IOExcpetion is thrown by underlying java.io.Writer