com.bea.schema
Class SOMSimpleContent

java.lang.Object
  extended bycom.bea.schema.SOMObject
      extended bycom.bea.schema.SOMSimpleContent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SOMComplexContent

public class SOMSimpleContent
extends SOMObject

<simpleContent> Alternative content for complexType's. simpleContent elements must have either a restriction or an extension for a sub-element.

Version:
1.0
Author:
sharpe
See Also:
SOMComplexType, Serialized Form

Constructor Summary
SOMSimpleContent(SOMExtension extension)
           
SOMSimpleContent(SOMRestriction restriction)
           
 
Method Summary
 SOMExtension add(SOMExtension extension)
          add an <extension> or <restriction>.
 SOMAnnotation addAnnotation(SOMAnnotation annotation)
          add an annotation.
 SOMAttribute addAttribute(SOMAttribute attribute)
          utility for adding attributes to child, restriction or extension.
 boolean contains(SOMObject child)
          Determine if an object is child of this element.
 void createDefault(DefaultDocumentOptions options, Element current)
          Not implemented.
 Map getAttributes(boolean getAll)
          retrieve the attributes for this schema element.
 SOMExtension getExtension()
           
 String getID()
          Returns a printable element tag for this Schema Object
 SOMRestriction getRestriction()
           
 SOMAnnotation removeAnnotation()
          set the annotation at this content type to null.
 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

SOMSimpleContent

public SOMSimpleContent(SOMRestriction restriction)

SOMSimpleContent

public SOMSimpleContent(SOMExtension extension)
Method Detail

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

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(SOMAttribute attribute)
utility for adding attributes to child, restriction or extension. A previously created restriction or extension must be added prior to calling this method.

Same as getExtenstion().addAttribute(attribute)

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

add

public SOMExtension add(SOMExtension extension)
add an <extension> or <restriction>.

Parameters:
extension - extension to add, ignored if null
Returns:
extension element added

getRestriction

public SOMRestriction getRestriction()

getExtension

public SOMExtension getExtension()

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 content type to null.

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

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 -