com.bea.schema
Class SOMExtension

java.lang.Object
  extended bycom.bea.schema.SOMObject
      extended bycom.bea.schema.SOMExtension
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SOMComplexExtension, SOMRestriction

public class SOMExtension
extends SOMObject

<extension> This class acts as a wrapper to extension elements.

Since:
6/19/2001
Version:
1.0
Author:
sharpe
See Also:
Serialized Form

Constructor Summary
SOMExtension(SOMType base)
          Constructs a new <extension> element of a given base type.
 
Method Summary
 SOMAnnotation addAnnotation(SOMAnnotation annotation)
           
 SOMAttribute addAttribute(SOMAttribute attribute)
          add an <attribute> to this complexType.
 SOMAttribute addAttribute(String name)
           
 SOMAttribute addAttribute(String name, SOMType type)
           
 SOMAttributeGroup addAttributeGroup(SOMAttributeGroup attribute)
          add an <attributeGroup> to this complexType.
 boolean contains(SOMObject child)
          Determine if an object is child of this element.
 void createDefault(DefaultDocumentOptions options, Element current)
          Not implemented.
 SOMAnnotation getAnnotation()
           
 Iterator getAttributeElements()
          returns an iterator over SOMAttribute(s) children.
 Iterator getAttributeGroups()
          returns an iterator over SOMAttributeGroup(s) children An extension will not have both Attribute(s) and AttributeGroup(s).
 Map getAttributes(boolean getAll)
          retrieve the attributes for this schema element.
 SOMType getBase()
          get the base attribute
 String getID()
          Returns a printable element tag for this Schema Object
 Iterator listAttributesExtended()
          iterator over all attribute elements for this extension.
 void removeAllAttributeGroups()
          remove an all attribute sub-elements.
 void removeAllAttributes()
          remove an all attribute sub-elements.
 SOMAnnotation removeAnnotation()
          set the annotation for this type to null.
 SOMAttribute removeAttribute(SOMAttribute attr)
          remove an attribute sub-element.
 SOMAttributeGroup removeAttributeGroup(SOMAttributeGroup attr)
          remove an attribute group sub-element.
 void setBase(SOMType type)
          set the base type attribute
 void setBase(String type)
          performs a type lookup for the type name.
 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

SOMExtension

public SOMExtension(SOMType base)
Constructs a new <extension> element of a given base type.

Parameters:
base - type to be extended.
Method Detail

setBase

public void setBase(SOMType type)
set the base type attribute

Parameters:
type - base

setBase

public void setBase(String type)
performs a type lookup for the type name.

Parameters:
type - type name to lookup

getBase

public SOMType getBase()
get the base attribute

Returns:

getID

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

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

addAnnotation

public SOMAnnotation addAnnotation(SOMAnnotation annotation)

getAnnotation

public SOMAnnotation getAnnotation()

removeAnnotation

public SOMAnnotation removeAnnotation()
set the annotation for this type to null.

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

getAttributeElements

public Iterator getAttributeElements()
returns an iterator over SOMAttribute(s) children. An extension will not have both Attribute(s) and AttributeGroup(s).

Returns:
an Iterator of SOMAttributes.

getAttributeGroups

public Iterator getAttributeGroups()
returns an iterator over SOMAttributeGroup(s) children An extension will not have both Attribute(s) and AttributeGroup(s).

Returns:
an Iterator of SOMAttributeGroups.

listAttributesExtended

public Iterator listAttributesExtended()
iterator over all attribute elements for this extension. The list of SOMAttributes includes any attributes contained in this extension and in any attributeGroup children.

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.

addAttribute

public SOMAttribute addAttribute(String name)

addAttribute

public SOMAttribute addAttribute(String name,
                                 SOMType type)

addAttribute

public SOMAttribute addAttribute(SOMAttribute attribute)
add an <attribute> to this complexType. <attribute> is mutually exclusive with simpleContent and complexContent, as well as, attributeGroup

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

addAttributeGroup

public SOMAttributeGroup addAttributeGroup(SOMAttributeGroup attribute)
add an <attributeGroup> to this complexType. <attributeGroup> is mutually exclusive with simpleContent and complexContent, as well as, attribute

Parameters:
attribute - the attributeGroup to add
Returns:
the attributeGroup reference added

removeAttribute

public SOMAttribute removeAttribute(SOMAttribute attr)
remove an attribute sub-element. Removes an attribute from this tree that was previously added.

Parameters:
attr -
Returns:
the attribute removed, or null if the object is not a sub-element

removeAllAttributes

public void removeAllAttributes()
remove an all attribute sub-elements. Removes all attributes from this tree that was previously added.


removeAttributeGroup

public SOMAttributeGroup removeAttributeGroup(SOMAttributeGroup attr)
remove an attribute group sub-element. Removes an attribute group from this tree that was previously added.

Parameters:
attr -
Returns:
the attribute group removed, or null if the object is not a sub-element

removeAllAttributeGroups

public void removeAllAttributeGroups()
remove an all attribute sub-elements. Removes all attributes from this tree that was previously added.


contains

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

Parameters:
child - the object in question
Returns:
true if the child is contained within this structure

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

createDefault

public void createDefault(DefaultDocumentOptions options,
                          Element current)
Not implemented.

Parameters:
options -
current -