WebLogic Integration


com.bea.schema.helper
Class SOMHelper

java.lang.Object
  |
  +--com.bea.schema.helper.SOMHelper

public class SOMHelper
extends java.lang.Object

A helper class for the Schema Object Model (SOM) providing methods that can be used to create XML documents based on an XML Schema.

Since:
WebLogic Process Integrator version 1.3
Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.

Constructor Summary
SOMHelper(SOMSchema som)
          Construct a new SOMHelper Object.
 
Method Summary
 java.util.List getAllowedAttributes(org.w3c.dom.Node node, boolean bExamineExisting)
          Obtain a java.util.List of com.bea.schema.SOMAttributes available for the given org.w3c.dom.Node, taking into account the current attributes, if specified.
 java.util.List getAllowedChildren(org.w3c.dom.Node element, boolean bExamineChildren)
          Return a java.util.List of allowable child element nodes (com.bea.schema.SOMElement) for a given XML node (org.w3c.dom.Node) based on this SOM.
 java.util.List getAllowedChildren(org.w3c.dom.Node element, boolean bExamineChildren, java.util.List allowedChildren)
          Return a java.util.List of allowable child element nodes (com.bea.schema.SOMElement) for a given XML node (org.w3c.dom.Node) based on this SOM.
 java.util.List getAllowedSiblings(org.w3c.dom.Node element, boolean bExamineChildren)
          A conveniece method that returns a java.util.List of org.w3c.dom.Nodes allowable as children of the provided org.w3c.dom.Node's parent.
 java.util.List getAllowedSiblings(org.w3c.dom.Node element, boolean bExamineChildren, java.util.List allowedChildren)
          A conveniece method that returns a java.util.List of org.w3c.dom.Nodes allowable as children of the provided org.w3c.dom.Node's parent.
 void showMap()
          For debugging, displays the dom-som mappings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SOMHelper

public SOMHelper(SOMSchema som)
Construct a new SOMHelper Object.

Parameters:
som - a SOMSchema object representing the schema being used.
Method Detail

getAllowedChildren

public java.util.List getAllowedChildren(org.w3c.dom.Node element,
                                         boolean bExamineChildren)
                                  throws SOMHelperException
Return a java.util.List of allowable child element nodes (com.bea.schema.SOMElement) for a given XML node (org.w3c.dom.Node) based on this SOM. The list will contain either all the possible children or just the children allowable taking into account the current children of the XML node.

Parameters:
element - the org.w3c.dom.Node representing the XML node for which children will be obtained.
bExamineChildren - a boolean flag that if true indicates that the returned list will contain only those children which are allowed accounting for existing children of element. If false the returned list will contain all possible children of element.
Returns:
a List of allowable children based on the bExamineChildren flag.

getAllowedSiblings

public java.util.List getAllowedSiblings(org.w3c.dom.Node element,
                                         boolean bExamineChildren)
                                  throws SOMHelperException
A conveniece method that returns a java.util.List of org.w3c.dom.Nodes allowable as children of the provided org.w3c.dom.Node's parent. When siblings are taken into account the returned list of elements is valid only as the last child of the parent (i.e. - the sibling used does not change the outcome of the returned list - this call maps directly to a call of:

getAllowedChildren(element.getParentNode(), bExamineSiblings);)

Parameters:
element - the org.w3c.dom.Node representing the XML node for which siblings will be obtained.
bExamineChildren - a boolean flag that if true indicates that the returned list will contain only those siblings which are allowed accounting for existing children of element's parent node. If false the returned list will contain all possible children of element's parent node.

getAllowedSiblings

public java.util.List getAllowedSiblings(org.w3c.dom.Node element,
                                         boolean bExamineChildren,
                                         java.util.List allowedChildren)
                                  throws SOMHelperException
A conveniece method that returns a java.util.List of org.w3c.dom.Nodes allowable as children of the provided org.w3c.dom.Node's parent. When siblings are taken into account the returned list of elements is valid only as the last child of the parent (i.e. - the sibling used does not change the outcome of the returned list - this call maps directly to a call of:

getAllowedChildren(element.getParentNode(), bExamineSiblings);)

Parameters:
element - the org.w3c.dom.Node representing the XML node for which siblings will be obtained.
bExamineChildren - a boolean flag that if true indicates that the returned list will contain only those siblings which are allowed accounting for existing children of element's parent node. If false the returned list will contain all possible children of element's parent node.
allowedChildren - a List to which the allowable children are appended, if not null. The object implementing this List interface must implement the add(Object) and addAll(Collection) methods.

getAllowedChildren

public java.util.List getAllowedChildren(org.w3c.dom.Node element,
                                         boolean bExamineChildren,
                                         java.util.List allowedChildren)
                                  throws SOMHelperException
Return a java.util.List of allowable child element nodes (com.bea.schema.SOMElement) for a given XML node (org.w3c.dom.Node) based on this SOM. The list will contain either all the possible children or just the children allowable taking into account the current children of the XML node.

Parameters:
element - the orgw3c.dom.Node representing the XML node for which children will be obtained.
bExamineChildren - a boolean flag that if true indicates that the returned list will contain only those children which are allowed accounting for existing children of element. If false the returned list will contain all possible children of element.
allowedChildren - a List to which the allowable children are appended, if not null. The object implementing this List interface must implement the add(Object) and addAll(Collection) methods.
Returns:
a List of allowable children based on the bExamineChildren flag. This will be allowedChildren with the allowable children appended if allowedChildren was not null, if allowedChildren was null this will be a new List.

getAllowedAttributes

public java.util.List getAllowedAttributes(org.w3c.dom.Node node,
                                           boolean bExamineExisting)
                                    throws SOMHelperException
Obtain a java.util.List of com.bea.schema.SOMAttributes available for the given org.w3c.dom.Node, taking into account the current attributes, if specified.

Parameters:
node - the XML org.w3c.dom.Node for which the attributes will be obtained. null will result in an empty Vector being returned.
bExaminExisting - a flag indicating if node's current attributes should be taken into account when returning the list of available attributes. true indicates that the exisiting attributes should be taken into account, false indicates that the current attributes should not be accounted for thus providing all allowable attributes allowable for the node.
Returns:
a List of attributes available for the node based on the bExamineExisiting flag. If no attributes are available for the node an empty List is returned, null is returned if node is null.

showMap

public void showMap()
For debugging, displays the dom-som mappings.

WebLogic Integration

WebLogic Integration (WLI)