WebLogic Integration


com.bea.schema
Class SOMObject

java.lang.Object
  |
  +--com.bea.schema.SOMObject
Direct Known Subclasses:
SOMAnnotation, SOMAppInfo, SOMAttributeGroup, SOMBasic, SOMExtension, SOMFacet, SOMGroupType, SOMList, SOMRestriction, SOMSchema, SOMSimpleContent, SOMType, SOMUnion, SOMUnresolvedReference

public abstract class SOMObject
extends java.lang.Object
implements java.io.Serializable

abstract base class for all SOM classes

Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
SOMSchema, Serialized Form

Constructor Summary
SOMObject()
           
 
Method Summary
protected  SOMObject addChild(java.lang.String tagName, org.xml.sax.Attributes attrs)
          for use with the SAX parser while loading a SOM from a file.
protected  void attributesToXML(java.io.Writer rtn, java.util.Map attrs)
          internal utility to print attributes to XML used in toXML().
protected  void doIndent(java.io.Writer buf, int indent)
           
 java.lang.String getID_UQ()
          get the unqualified ID (no namespace).
abstract  java.lang.String getID()
          Returns a printable element tag for this Schema Object
 SOMObject getParent()
          get a reference to the parent object
 SOMSchema getParentSchema()
          get a reference to the parent schema for this object
 boolean isCircularReference(SOMObject reference)
           
 boolean isSchemaChild()
          determines if the immediate parent object is the schema element.
static void setIndent(java.lang.String indentToken)
          Allows the user to specify a token to be used for the indent when formatting output XML.
 void setParent(SOMObject parent)
           
 java.lang.String toString()
          The String representation of the XML Schema Object.
 java.lang.String toXML()
          The String representation of the XML Schema Object.
 java.lang.String toXML(java.lang.String encoding)
          The String representation of the XML Schema Object.
 void toXML(java.io.Writer rtn)
          Outputs a formatted XML representation of SOMObject.
abstract  void toXML(java.io.Writer rtn, int indent)
          Outputs a formatted XML representation of SOMObject.
protected static boolean trace(int lvl)
           
protected static void trace(java.lang.String msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SOMObject

public SOMObject()
Method Detail

addChild

protected SOMObject addChild(java.lang.String tagName,
                             org.xml.sax.Attributes attrs)
                      throws org.xml.sax.SAXException
for use with the SAX parser while loading a SOM from a file.

Parameters:
tagName - tag name from parser
attrs - attributes from parser
Returns:
the newly created object from the input arguments
Throws:
org.xml.sax.SAXException -  

toString

public java.lang.String toString()
The String representation of the XML Schema Object. Uses java.io.StringWriter to create a serialized XML Schema.

Returns:
formatted XML
Overrides:
toString in class java.lang.Object

toXML

public java.lang.String toXML()
The String representation of the XML Schema Object. This method calls the toXML(Writer, int) method using OutputStreamWriter with UTF-8 encoding. If an IOException occurs in the underlying Writer, the exception is discarded and an empty or partial String is returned.

Returns:
printable XML Schema.

toXML

public java.lang.String toXML(java.lang.String encoding)
The String representation of the XML Schema Object. This method calls the toXML(Writer, int) method using OutputStreamWriter with the specified encoding. If an IOException occurs in the underlying Writer, the exception is discarded and an empty or partial String is returned.

Returns:
printable XML Schema.

toXML

public void toXML(java.io.Writer rtn)
           throws java.io.IOException
Outputs a formatted XML representation of SOMObject. Indent is set to zero.

Parameters:
rtn - printable XML Schema
Throws:
java.io.IOException - if IOExcpetion is thrown by underlying java.io.Writer

toXML

public abstract void toXML(java.io.Writer rtn,
                           int indent)
                    throws java.io.IOException
Outputs a formatted XML representation of SOMObject.

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

attributesToXML

protected void attributesToXML(java.io.Writer rtn,
                               java.util.Map attrs)
                        throws java.io.IOException
internal utility to print attributes to XML used in toXML().

The Map used is not reusable. The Map is not guaranteed to be the same after this method completes.

Parameters:
rtn - the output stream
attrs - the attributes to be written to the stream
Throws:
java.io.IOException -  

getParentSchema

public SOMSchema getParentSchema()
get a reference to the parent schema for this object

Returns:
The parent SOMSchema for this object or null if the object doesn't have a schema parent.

getParent

public SOMObject getParent()
get a reference to the parent object

Returns:
The parent object for this object in the tree

setParent

public void setParent(SOMObject parent)


isSchemaChild

public boolean isSchemaChild()
determines if the immediate parent object is the schema element. If the immediate parent object of this object is an instance of a SOMSchema, this method returns true, and otherwise false.

Returns:
true if getParent() is instanceof SOMSchema

getID

public abstract java.lang.String getID()
Returns a printable element tag for this Schema Object

Returns:
String representation of the element tag

doIndent

protected void doIndent(java.io.Writer buf,
                        int indent)
                 throws java.io.IOException


getID_UQ

public java.lang.String getID_UQ()
get the unqualified ID (no namespace). By default, all schema elements are prefixed with the namespace xsd. With getID_UQ(), the xsd: is stripped off and the unqualified ID is returned.

Returns:
Unqualified ID

setIndent

public static void setIndent(java.lang.String indentToken)
Allows the user to specify a token to be used for the indent when formatting output XML. The default is two spaces, " ". To set the output to be tabbed indenting, use
setIndent("\t");

Parameters:
indentToken -  

isCircularReference

public boolean isCircularReference(SOMObject reference)


trace

protected static final boolean trace(int lvl)


trace

protected static final void trace(java.lang.String msg)


WebLogic Integration

WebLogic Integration (WLI)