wt.query.qml
Class Util

java.lang.Object
  extended bywt.query.qml.Util

public class Util
extends Object

This class contains static utility functions for accessing QML nodes. In general, each method will take a context Node argument. Some methods access the QML relative to that Node while others access the QML from the root Node obtained from the context Node. For relative searches, the context Node itself can either be included or excluded from the search. Each method describes how it uses the context Node, either "Relative, Exclusive", "Relative, Inclusive" or "Absolute".

Supported API: false
Extendable: false


Nested Class Summary
static class Util.AppendedNodeList
           
 
Field Summary
private static String ALL_ALIAS_EXPRESSION
           
private static String ALL_COLUMN_TARGET_HEADING_EXPRESSION
           
private static String ALL_ELEMENTS_EXPRESSION
           
private static String ALL_PARAMETER_TARGETS_EXPRESSION
           
private static String ANCESTOR
           
private static String ANCESTOR_CONDITION_EXPRESSION
           
private static String ANCESTOR_OR_SELF
           
private static String ANCESTOR_QUERY_EXPRESSION
           
private static String ANY
           
private static String ATTRIBUTE
           
private static String BIND_PARAMETER_EXPRESSION
           
private static String CHILD
           
private static String CHILD_ANY
           
private static String CHILD_FROM_TABLE_EXPRESSION
           
private static String COLUMN_LIST_EXPRESSION
           
private static String DESCENDANT
           
private static String DESCENDANT_OR_SELF
           
private static String DESCENDANT_QUERY_EXPRESSION
           
private static String DESCENDANT_SELECT_COLUMN_HEADING_EXPRESSION
           
private static String DESCENDANT_TABLE_ALIAS_EXPRESSION
           
private static String DOUBLE_SLASH
           
(package private) static EmptyNodeList EMPTY_LIST
           
static String EQUAL
           
private static XPathFactory FACTORY
           
private static String FIRST
           
static String GREATER_THAN
           
private static String JOIN_LIST_BY_ALIAS_TARGET_EXPRESSION
           
static String LESS_THAN
           
static String NOT_EQUAL
           
private static String OPERAND_CHILD_IN_LIKE_CONDITION_EXPRESSION
           
private static String OR
           
private static String ORDER_BY_LIST_EXPRESSION
           
private static String OUTER_JOIN_ALIAS_EXPRESSION
           
private static String PARAMETER_EXPRESSION
           
private static String PARAMETER_LIST_EXPRESSION
           
private static String PARAMETER_TARGET_EXPRESSION
           
private static String PARENT
           
private static String PARENT_ANY
           
private static String QML_EXPRESSION
           
private static String SELECT_LIST_EXPRESSION
           
private static String SELECT_NONDERIVED_LIST_EXPRESSION
           
private static String SELECT_OBJECT_FROM_ALIAS_EXPRESSION
           
private static String SELF
           
private static String SLASH
           
private static boolean VERBOSE
           
private static String WHERE_ELEMENT_EXPRESSION
           
 
Constructor Summary
Util()
           
 
Method Summary
private static void appendValue(String a_value, StringBuffer a_buffer)
           
static void arrangeChildren(Node a_contextNode, String[] a_order)
          This method arranges the child elements relative to the context Node based on the ordered array of Element tag names.
static void deleteAlias(Node a_contextNode, String a_oldAlias)
          This method deletes the Elements relative to the context Node that have an alias attribute with the specified value.
static void deleteColumnTarget(Node a_contextNode, String a_heading)
          This method deletes the ColumnTarget Elements relative to the context Node that have a heading attribute with the specified value.
private  void displayDocument(Element a_element)
           
static NodeList findAncestorFromElements(Node a_contextNode, boolean a_includeAllAncestors)
          This method returns the ancestor Table Elements relative to the context Node.
static Element findAncestorQueryElement(Node a_contextNode)
          This method returns the first ancestor Query/Sub Query Element relative to the context Node.
static Element findChildElement(Element a_parent, String a_attribute, String a_value)
          This method returns the first child Element relative to the context Node that has an attribute matching the specified value.
static Element findChildElement(Node a_contextNode, String a_tag)
          This method returns the first child Element relative to the context Node that matches the specified tag.
static NodeList findChildren(Node a_contextNode)
          This method returns the child Elements relative to the context Node.
static NodeList findDescendantFromElements(Node a_contextNode, boolean a_includeAllDescendants)
          This method returns the descendant Table Elements relative to the context Node.
static NodeList findDescendantSubQueryElements(Node a_contextNode, int a_level)
          This method returns the descendant Sub Query Elements relative to the context Node at the specified level.
static Element findFirstElement(Node a_contextNode, String a_tag)
          This method returns the first descendant Element relative to the context Node that matches the specified Element tag.
static Class findFromClass(Node a_contextNode, String a_alias)
          This method returns the Class for the Table Element in the document that has the specified alias attribute.
static Element findParentElement(Element a_contextNode, String a_elementTag)
          This method returns the first ancestor Element relative to the context Node that matches the specified Element tag.
static Element findSiblingElement(Element a_child, String a_tag)
          This method returns the first sibling Element relative to the context Node that matches the specified tag.
private static Element getAbsoluteRelativeInclusiveFragmentElement(Node a_contextNode, StringBuffer a_expression)
          This method returns the Element in the document that satisfies the expression.
static Element getAliasedColumnElement(Node a_contextNode, String a_heading)
          This method returns the Object, Column, Constant, Keyword, or Function Element in the document that has a Select or SubQuerySelect parent and the specified heading attribute.
private static Vector getAliasedElements(Node a_contextNode, String a_alias)
          This method finds all Elements relative to the context Node that have an alias attribute with the specified value.
static Element getAliasedFromElement(Node a_contextNode, String a_alias)
          This method returns the Table Element in the document that has the specified alias attribute.
static NodeList getAliasedJoinElements(Node a_contextNode, String a_alias)
          This method returns the Join Elements in the document that have an Alias Target child Element with the specified alias attribute.
static Node getAncestorConditionElement(Node a_contextNode)
          This method returns the ancestor Condition Element relative to the context Node.
static boolean getAttributeAsBoolean(Element a_element, String a_attributeName)
          This method returns the attribute as a boolean value.
static boolean getAttributeExists(Element a_element, String a_attributeName)
          This method returns true if the Element has the specified attribute and the value is non empty string.
static List getAttributes(NodeList a_list, String a_attribute)
          This method returns a List of attribute values from the list of Elements.
static NodeList getBindParameterElements(Node a_contextNode)
          This method returns all Elements representing bind parameters (i.e.
static Element getChildElementAt(Node a_node, int a_index)
          This method returns the child Element relative to the context Node at the specified index.
static int getChildElementCount(Node a_node)
          This method returns number of child Elements relative to the context Node.
static NodeList getColumnElements(Node a_contextNode)
          This method returns the all descendant Column Elements relative to the context Node.
private static NodeList getColumnTargetElements(Node a_contextNode, String a_heading)
          This method finds all ColumnTarget Elements relative to the context Node that have an heading attribute with the specified value.
static int getElementDepth(Node a_contextNode, String a_tag)
          This method returns number of ancestor Elements relative to the context Node that match the specified Element tag.
static NodeList getElements(Node a_contextNode, String a_tag)
          This method returns the specified Elements in the document.
static NodeList getElementsWithAttribute(Node a_contextNode, String a_tag, String a_name, String a_value)
          This method returns the specified Elements in the document.
static NodeList getElementsWithChildCount(Node a_contextNode, String a_tag, int a_count, String a_operator)
          This method returns all descendant Elements relative to the context Node that have the specified tag name and have a count that satisfies the specified operator comparison and count value.
static NodeList getElementsWithNoAttribute(Node a_contextNode, String a_tag, String a_attributeName)
          This method returns all descendant Elements relative to the context Node that have the specified tag name but do not have the specified attribute name.
static Element getFirstChildElement(Node a_node)
          This method returns the first Element child relative to the context Node.
static NodeList getFromAliasedObjectElements(Node a_contextNode, String a_alias)
          This method returns the Object Elements in the document that have a Select parent Element and have the specified alias attribute.
static Class getFromClass(Element a_fromElement)
          This method returns the class specified by the From Element.
static NodeList getJoinElements(Node a_contextNode, String a_tagName)
          This method returns the Join Elements in the document that have the specified Element as a parent.
static Element getNextSiblingElement(Node a_node)
          This method returns the next sibling Element relative to the context Node.
private static Node getNode(Node a_contextNode, String a_expression)
           
private static NodeList getNodeList(Node a_contextNode, String a_expression)
           
static Node getOperandChildLikeCondition(Node a_contextNode)
          This method returns the ancestor's child Operator Element relative to the context Node that has "like" or "notLike" for the type attribute.
static NodeList getOrderByElements(Node a_contextNode)
          This method returns all Order By Item Elements that are descendants of the context Node.
static String getOtherJoinAlias(Element a_joinElement, String a_alias)
          This method returns the alias attribute of the Alias Target child Element relative to the context Node that has another Alias Target child Element with the specified alias attribute.
private static NodeList getOuterJoinAliasedElements(Node a_contextNode, String a_alias)
          This method finds all Table Elements relative to the context Node that have an outerJoinAlias attribute with the specified value.
static Element getParameterElement(Node a_contextNode, String a_name)
          This method returns the first Parameter Element in the document that matches the name attribute.
static NodeList getParameterElements(Node a_contextNode)
          This method returns all Parameter Elements in the document.
static Node getParameterTargetElement(Node a_contextNode, String a_name)
          This method returns the first ParameterTarget Element descendant relative to the context Node that has the specified name attribute.
static NodeList getParameterTargetElements(Node a_contextNode)
          This method returns all ParameterTarget Elements in the document.
static NodeList getParameterTargetElementsWithName(Node a_contextNode, String a_name)
          This method returns the first ParameterTarget Element descendant relative to the context Node that has the specified name attribute.
static Element getQmlElement(Node a_contextNode)
          This method returns the first Qml Element in the document.
private static Node getReverseNode(Node a_contextNode, String a_expression)
           
static NodeList getSelectElements(Node a_contextNode, boolean a_includeAll)
          This method returns all descendant Elements relative to the context Node that are children of a Select Element.
static Node getStatementWhereElement(Node a_contextNode)
          This method returns the first descendant Where Element relative to the context Node in which the Where element has a parent query Element that has a parent statement Element.
static void refreshAlias(Node a_contextNode, String a_oldAlias, String a_newAlias)
          This method refreshes the alias attribute value on the Elements relative to the context Node that have an alias attribute with the old value.
static void refreshColumnTargetHeading(Node a_contextNode, String a_oldHeading, String a_newHeading)
          This method refreshes the heading attribute value on the ColumnTarget Elements relative to the context Node that have an heading attribute with the old value.
static void remove(Node a_node)
          This method removes the Node from the document that contains it.
static int remove(NodeList a_list)
          This method removes the Nodes in the NodeList from the document that contains them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SLASH

private static final String SLASH
See Also:
Constant Field Values

DOUBLE_SLASH

private static final String DOUBLE_SLASH
See Also:
Constant Field Values

ANY

private static final String ANY
See Also:
Constant Field Values

CHILD

private static final String CHILD
See Also:
Constant Field Values

CHILD_ANY

private static final String CHILD_ANY
See Also:
Constant Field Values

DESCENDANT

private static final String DESCENDANT
See Also:
Constant Field Values

DESCENDANT_OR_SELF

private static final String DESCENDANT_OR_SELF
See Also:
Constant Field Values

ANCESTOR

private static final String ANCESTOR
See Also:
Constant Field Values

ANCESTOR_OR_SELF

private static final String ANCESTOR_OR_SELF
See Also:
Constant Field Values

PARENT

private static final String PARENT
See Also:
Constant Field Values

SELF

private static final String SELF
See Also:
Constant Field Values

PARENT_ANY

private static final String PARENT_ANY
See Also:
Constant Field Values

ATTRIBUTE

private static final String ATTRIBUTE
See Also:
Constant Field Values

OR

private static final String OR
See Also:
Constant Field Values

FIRST

private static final String FIRST
See Also:
Constant Field Values

OPERAND_CHILD_IN_LIKE_CONDITION_EXPRESSION

private static final String OPERAND_CHILD_IN_LIKE_CONDITION_EXPRESSION
See Also:
Constant Field Values

DESCENDANT_TABLE_ALIAS_EXPRESSION

private static final String DESCENDANT_TABLE_ALIAS_EXPRESSION
See Also:
Constant Field Values

DESCENDANT_SELECT_COLUMN_HEADING_EXPRESSION

private static final String DESCENDANT_SELECT_COLUMN_HEADING_EXPRESSION
See Also:
Constant Field Values

SELECT_OBJECT_FROM_ALIAS_EXPRESSION

private static final String SELECT_OBJECT_FROM_ALIAS_EXPRESSION
See Also:
Constant Field Values

ALL_ALIAS_EXPRESSION

private static final String ALL_ALIAS_EXPRESSION
See Also:
Constant Field Values

ALL_COLUMN_TARGET_HEADING_EXPRESSION

private static final String ALL_COLUMN_TARGET_HEADING_EXPRESSION
See Also:
Constant Field Values

PARAMETER_LIST_EXPRESSION

private static final String PARAMETER_LIST_EXPRESSION
See Also:
Constant Field Values

ALL_PARAMETER_TARGETS_EXPRESSION

private static final String ALL_PARAMETER_TARGETS_EXPRESSION
See Also:
Constant Field Values

ANCESTOR_QUERY_EXPRESSION

private static final String ANCESTOR_QUERY_EXPRESSION
See Also:
Constant Field Values

DESCENDANT_QUERY_EXPRESSION

private static final String DESCENDANT_QUERY_EXPRESSION
See Also:
Constant Field Values

CHILD_FROM_TABLE_EXPRESSION

private static final String CHILD_FROM_TABLE_EXPRESSION
See Also:
Constant Field Values

SELECT_LIST_EXPRESSION

private static final String SELECT_LIST_EXPRESSION
See Also:
Constant Field Values

SELECT_NONDERIVED_LIST_EXPRESSION

private static final String SELECT_NONDERIVED_LIST_EXPRESSION
See Also:
Constant Field Values

ORDER_BY_LIST_EXPRESSION

private static final String ORDER_BY_LIST_EXPRESSION
See Also:
Constant Field Values

ALL_ELEMENTS_EXPRESSION

private static final String ALL_ELEMENTS_EXPRESSION
See Also:
Constant Field Values

OUTER_JOIN_ALIAS_EXPRESSION

private static final String OUTER_JOIN_ALIAS_EXPRESSION
See Also:
Constant Field Values

BIND_PARAMETER_EXPRESSION

private static final String BIND_PARAMETER_EXPRESSION
See Also:
Constant Field Values

ANCESTOR_CONDITION_EXPRESSION

private static final String ANCESTOR_CONDITION_EXPRESSION
See Also:
Constant Field Values

QML_EXPRESSION

private static final String QML_EXPRESSION
See Also:
Constant Field Values

JOIN_LIST_BY_ALIAS_TARGET_EXPRESSION

private static final String JOIN_LIST_BY_ALIAS_TARGET_EXPRESSION
See Also:
Constant Field Values

WHERE_ELEMENT_EXPRESSION

private static final String WHERE_ELEMENT_EXPRESSION
See Also:
Constant Field Values

PARAMETER_TARGET_EXPRESSION

private static final String PARAMETER_TARGET_EXPRESSION
See Also:
Constant Field Values

PARAMETER_EXPRESSION

private static final String PARAMETER_EXPRESSION
See Also:
Constant Field Values

COLUMN_LIST_EXPRESSION

private static final String COLUMN_LIST_EXPRESSION
See Also:
Constant Field Values

EQUAL

public static final String EQUAL
See Also:
Constant Field Values

NOT_EQUAL

public static final String NOT_EQUAL
See Also:
Constant Field Values

LESS_THAN

public static final String LESS_THAN
See Also:
Constant Field Values

GREATER_THAN

public static final String GREATER_THAN
See Also:
Constant Field Values

FACTORY

private static XPathFactory FACTORY

EMPTY_LIST

static EmptyNodeList EMPTY_LIST

VERBOSE

private static final boolean VERBOSE
Constructor Detail

Util

public Util()
Method Detail

getAttributes

public static List getAttributes(NodeList a_list,
                                 String a_attribute)
This method returns a List of attribute values from the list of Elements.

Supported API: false

Parameters:
a_list - NodeList of Elements
a_attribute - Name of the attribute to return
Returns:
List of the attributes of each Element

getElementDepth

public static int getElementDepth(Node a_contextNode,
                                  String a_tag)
This method returns number of ancestor Elements relative to the context Node that match the specified Element tag.

Supported API: false

Parameters:
a_contextNode - Relative, Inclusive context Node
a_tag - Element tag name to search for
Returns:
number of ancestor Elements

getFirstChildElement

public static Element getFirstChildElement(Node a_node)
This method returns the first Element child relative to the context Node.

Supported API: false

Returns:
result Element, null if not found
Throws:
WTException

getNextSiblingElement

public static Element getNextSiblingElement(Node a_node)
This method returns the next sibling Element relative to the context Node.

Supported API: false

Returns:
result Element, null if not found
Throws:
WTException

getChildElementAt

public static Element getChildElementAt(Node a_node,
                                        int a_index)
This method returns the child Element relative to the context Node at the specified index.

Supported API: false

Returns:
result Element, null if not found
Throws:
WTException

findAncestorQueryElement

public static Element findAncestorQueryElement(Node a_contextNode)
                                        throws WTException
This method returns the first ancestor Query/Sub Query Element relative to the context Node.

Supported API: false

Parameters:
a_contextNode - Relative, Inclusive context Node
Returns:
result Query/Sub Query Element
Throws:
WTException

findDescendantSubQueryElements

public static NodeList findDescendantSubQueryElements(Node a_contextNode,
                                                      int a_level)
                                               throws WTException
This method returns the descendant Sub Query Elements relative to the context Node at the specified level.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_level - Indicates the level to return (0 based).
Returns:
result NodeList
Throws:
WTException

findChildren

public static NodeList findChildren(Node a_contextNode)
                             throws WTException
This method returns the child Elements relative to the context Node.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
Returns:
NodeList
Throws:
WTException

findChildElement

public static Element findChildElement(Node a_contextNode,
                                       String a_tag)
                                throws WTException
This method returns the first child Element relative to the context Node that matches the specified tag.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_tag - Element tag name to search for
Returns:
result Element, null if not found
Throws:
WTException

getChildElementCount

public static int getChildElementCount(Node a_node)
This method returns number of child Elements relative to the context Node.

Supported API: false

Returns:
number of child Elements
Throws:
WTException

findFirstElement

public static Element findFirstElement(Node a_contextNode,
                                       String a_tag)
                                throws WTException
This method returns the first descendant Element relative to the context Node that matches the specified Element tag.

Supported API: false

Parameters:
a_contextNode - Relative, Inclusive context Node
a_tag - Element tag name to search for
Returns:
result Element, null if not found
Throws:
WTException

findChildElement

public static Element findChildElement(Element a_parent,
                                       String a_attribute,
                                       String a_value)
This method returns the first child Element relative to the context Node that has an attribute matching the specified value.

Supported API: false

Parameters:
a_attribute - Element attribute to search for
a_value - Element attribute value to search for
Returns:
result Element, null if not found
Throws:
WTException

findParentElement

public static Element findParentElement(Element a_contextNode,
                                        String a_elementTag)
                                 throws WTException
This method returns the first ancestor Element relative to the context Node that matches the specified Element tag. The context Node itself is not included in the search.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_elementTag - Element tag name to search for
Returns:
result Element, null if not found
Throws:
WTException

getAttributeExists

public static boolean getAttributeExists(Element a_element,
                                         String a_attributeName)
This method returns true if the Element has the specified attribute and the value is non empty string.

Supported API: false

Parameters:
a_element - element to retrieve attribute from
a_attributeName - Element attribute name to search for
Returns:
true, if the attribute exists and has a non empty string value, otherwise false

getAttributeAsBoolean

public static boolean getAttributeAsBoolean(Element a_element,
                                            String a_attributeName)
This method returns the attribute as a boolean value. The string value of the Element's attribute is converted to a boolean.

Supported API: false

Parameters:
a_element - element to retrieve attribute from
a_attributeName - Element attribute name to search for
Returns:
true, if the attribute exists and has a true value, otherwise false

getOtherJoinAlias

public static String getOtherJoinAlias(Element a_joinElement,
                                       String a_alias)
This method returns the alias attribute of the Alias Target child Element relative to the context Node that has another Alias Target child Element with the specified alias attribute.

Supported API: false

Parameters:
a_joinElement - Relative, Exclusive context Node
a_alias - Element alias attribute to search for
Returns:
Alias attribute, null if not found

arrangeChildren

public static void arrangeChildren(Node a_contextNode,
                                   String[] a_order)
                            throws WTException
This method arranges the child elements relative to the context Node based on the ordered array of Element tag names.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_order - ordered array of Element tag names
Throws:
WTException

findSiblingElement

public static Element findSiblingElement(Element a_child,
                                         String a_tag)
                                  throws WTException
This method returns the first sibling Element relative to the context Node that matches the specified tag.

Supported API: false

Parameters:
a_tag - Element tag to search for
Returns:
result Element, null if not found
Throws:
WTException

getElements

public static NodeList getElements(Node a_contextNode,
                                   String a_tag)
                            throws WTException
This method returns the specified Elements in the document.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
a_tag - Element tag attribute to search for
Returns:
result NodeList
Throws:
WTException

getElementsWithAttribute

public static NodeList getElementsWithAttribute(Node a_contextNode,
                                                String a_tag,
                                                String a_name,
                                                String a_value)
                                         throws WTException
This method returns the specified Elements in the document.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
a_tag - Element tag attribute to search for
a_name - Element attribute name search for
a_value - Element attribute value search for
Returns:
result NodeList
Throws:
WTException

getQmlElement

public static Element getQmlElement(Node a_contextNode)
                             throws WTException
This method returns the first Qml Element in the document.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
Returns:
result Element, null if not found
Throws:
WTException

getAliasedFromElement

public static Element getAliasedFromElement(Node a_contextNode,
                                            String a_alias)
                                     throws WTException
This method returns the Table Element in the document that has the specified alias attribute.

Supported API: false

Parameters:
a_contextNode - Absolute context Node, relative inclusive fragment
a_alias - Element alias attribute to search for
Returns:
result Element, null if not found
Throws:
WTException

getAliasedColumnElement

public static Element getAliasedColumnElement(Node a_contextNode,
                                              String a_heading)
                                       throws WTException
This method returns the Object, Column, Constant, Keyword, or Function Element in the document that has a Select or SubQuerySelect parent and the specified heading attribute.

Supported API: false

Parameters:
a_contextNode - Absolute context Node, relative inclusive fragment
a_heading - Element alias attribute to search for
Returns:
result Element, null if not found
Throws:
WTException

getFromAliasedObjectElements

public static NodeList getFromAliasedObjectElements(Node a_contextNode,
                                                    String a_alias)
                                             throws WTException
This method returns the Object Elements in the document that have a Select parent Element and have the specified alias attribute.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
a_alias - Element alias attribute to search for
Returns:
result NodeList
Throws:
WTException

getParameterTargetElements

public static NodeList getParameterTargetElements(Node a_contextNode)
                                           throws WTException
This method returns all ParameterTarget Elements in the document.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
Returns:
result NodeList
Throws:
WTException

getBindParameterElements

public static NodeList getBindParameterElements(Node a_contextNode)
                                         throws WTException
This method returns all Elements representing bind parameters (i.e. Constant and ParameterTarget elements) that are descendants of the context Node.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
Returns:
result NodeList
Throws:
WTException

getParameterElements

public static NodeList getParameterElements(Node a_contextNode)
                                     throws WTException
This method returns all Parameter Elements in the document.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
Returns:
result NodeList
Throws:
WTException

getParameterTargetElementsWithName

public static NodeList getParameterTargetElementsWithName(Node a_contextNode,
                                                          String a_name)
                                                   throws WTException
This method returns the first ParameterTarget Element descendant relative to the context Node that has the specified name attribute.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_name - Element name attribute to search for
Returns:
result Node, null if not found
Throws:
WTException

getParameterTargetElement

public static Node getParameterTargetElement(Node a_contextNode,
                                             String a_name)
                                      throws WTException
This method returns the first ParameterTarget Element descendant relative to the context Node that has the specified name attribute.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_name - Element name attribute to search for
Returns:
result Node, null if not found
Throws:
WTException

getParameterElement

public static Element getParameterElement(Node a_contextNode,
                                          String a_name)
                                   throws WTException
This method returns the first Parameter Element in the document that matches the name attribute.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
a_name - Element name attribute to search for
Returns:
result Element, null if not found
Throws:
WTException

getColumnElements

public static NodeList getColumnElements(Node a_contextNode)
                                  throws WTException
This method returns the all descendant Column Elements relative to the context Node.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
Returns:
result NodeList
Throws:
WTException

findDescendantFromElements

public static NodeList findDescendantFromElements(Node a_contextNode,
                                                  boolean a_includeAllDescendants)
                                           throws WTException
This method returns the descendant Table Elements relative to the context Node.

Supported API: false

Parameters:
a_contextNode - Relative, Inclusive context Node
a_includeAllDescendants - Indicates if all descendants should be returned(true) or only the first level descendants(false)
Returns:
result NodeList
Throws:
WTException

findAncestorFromElements

public static NodeList findAncestorFromElements(Node a_contextNode,
                                                boolean a_includeAllAncestors)
                                         throws WTException
This method returns the ancestor Table Elements relative to the context Node.

Supported API: false

Parameters:
a_contextNode - Relative, Inclusive context Node
a_includeAllAncestors - Indicates if all ancestors should be returned(true) or only the first level ancestors(false)
Returns:
result NodeList
Throws:
WTException

getSelectElements

public static NodeList getSelectElements(Node a_contextNode,
                                         boolean a_includeAll)
                                  throws WTException
This method returns all descendant Elements relative to the context Node that are children of a Select Element. If a_inlcudeAll is false, then non-derived select children are not included.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_includeAll - indicates whether nonderived elements are filtered
Returns:
result NodeList
Throws:
WTException

getStatementWhereElement

public static Node getStatementWhereElement(Node a_contextNode)
                                     throws WTException
This method returns the first descendant Where Element relative to the context Node in which the Where element has a parent query Element that has a parent statement Element.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
Returns:
result Node, null if not found
Throws:
WTException

getOrderByElements

public static NodeList getOrderByElements(Node a_contextNode)
                                   throws WTException
This method returns all Order By Item Elements that are descendants of the context Node.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
Returns:
result NodeList
Throws:
WTException

getJoinElements

public static NodeList getJoinElements(Node a_contextNode,
                                       String a_tagName)
                                throws WTException
This method returns the Join Elements in the document that have the specified Element as a parent.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
Returns:
result NodeList
Throws:
WTException

getOperandChildLikeCondition

public static Node getOperandChildLikeCondition(Node a_contextNode)
                                         throws WTException
This method returns the ancestor's child Operator Element relative to the context Node that has "like" or "notLike" for the type attribute.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
Returns:
result Node, null if not found
Throws:
WTException

getAliasedJoinElements

public static NodeList getAliasedJoinElements(Node a_contextNode,
                                              String a_alias)
                                       throws WTException
This method returns the Join Elements in the document that have an Alias Target child Element with the specified alias attribute.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
a_alias - Alias Target Element alias attribute to search for
Returns:
result NodeList
Throws:
WTException

getAncestorConditionElement

public static Node getAncestorConditionElement(Node a_contextNode)
                                        throws WTException
This method returns the ancestor Condition Element relative to the context Node.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
Returns:
result Node, null if not found
Throws:
WTException

refreshColumnTargetHeading

public static void refreshColumnTargetHeading(Node a_contextNode,
                                              String a_oldHeading,
                                              String a_newHeading)
                                       throws WTException
This method refreshes the heading attribute value on the ColumnTarget Elements relative to the context Node that have an heading attribute with the old value.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_oldHeading - Element heading attribute to search for
a_newHeading - Element heading attribute value to change to
Throws:
WTException

deleteColumnTarget

public static void deleteColumnTarget(Node a_contextNode,
                                      String a_heading)
                               throws WTException
This method deletes the ColumnTarget Elements relative to the context Node that have a heading attribute with the specified value.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_heading - Element heading attribute to search for
Throws:
WTException

refreshAlias

public static void refreshAlias(Node a_contextNode,
                                String a_oldAlias,
                                String a_newAlias)
                         throws WTException
This method refreshes the alias attribute value on the Elements relative to the context Node that have an alias attribute with the old value. An Element with a parent From Element is not refreshed. Any From Elements with an Outer Join Alias attribute that match the alias, will have the attribute value changed to the new value.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_oldAlias - Element alias attribute to search for
a_newAlias - Element alias attribute value to change to
Throws:
WTException

deleteAlias

public static void deleteAlias(Node a_contextNode,
                               String a_oldAlias)
                        throws WTException
This method deletes the Elements relative to the context Node that have an alias attribute with the specified value. An Element with a parent From Element is not deleted. Any From Elements with an Outer Join Alias attribute that match the alias, will have the attribute removed.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
Throws:
WTException

findFromClass

public static Class findFromClass(Node a_contextNode,
                                  String a_alias)
                           throws WTException
This method returns the Class for the Table Element in the document that has the specified alias attribute.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
a_alias - Element alias attribute to search for
Returns:
result Class, null if not found
Throws:
WTException

getFromClass

public static Class getFromClass(Element a_fromElement)
                          throws WTException
This method returns the class specified by the From Element.

Supported API: false

Parameters:
a_fromElement - From element to dervie class from
Returns:
Class specfied by the From Element
Throws:
WTException

getElementsWithNoAttribute

public static NodeList getElementsWithNoAttribute(Node a_contextNode,
                                                  String a_tag,
                                                  String a_attributeName)
                                           throws WTException
This method returns all descendant Elements relative to the context Node that have the specified tag name but do not have the specified attribute name.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_tag - Element tag name to search for
a_attributeName - attribute name to search for
Returns:
result NodeList
Throws:
WTException

getElementsWithChildCount

public static NodeList getElementsWithChildCount(Node a_contextNode,
                                                 String a_tag,
                                                 int a_count,
                                                 String a_operator)
                                          throws WTException
This method returns all descendant Elements relative to the context Node that have the specified tag name and have a count that satisfies the specified operator comparison and count value.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_tag - Element tag name to search for
a_count - value to use in count comparison expression
a_operator - type of operator for the comparison expression
Returns:
result NodeList
Throws:
WTException

remove

public static int remove(NodeList a_list)
This method removes the Nodes in the NodeList from the document that contains them.

Supported API: false

Parameters:
a_list - List of Nodes to remove
Returns:
number of Nodes removed

remove

public static void remove(Node a_node)
This method removes the Node from the document that contains it.

Supported API: false


appendValue

private static void appendValue(String a_value,
                                StringBuffer a_buffer)
                         throws WTException
Throws:
WTException

getColumnTargetElements

private static NodeList getColumnTargetElements(Node a_contextNode,
                                                String a_heading)
                                         throws WTException
This method finds all ColumnTarget Elements relative to the context Node that have an heading attribute with the specified value.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_heading - Element heading attribute to search for
Throws:
WTException

getAliasedElements

private static Vector getAliasedElements(Node a_contextNode,
                                         String a_alias)
                                  throws WTException
This method finds all Elements relative to the context Node that have an alias attribute with the specified value. An Element with a parent From Element is excluded.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_alias - Element alias attribute to search for
Throws:
WTException

getOuterJoinAliasedElements

private static NodeList getOuterJoinAliasedElements(Node a_contextNode,
                                                    String a_alias)
                                             throws WTException
This method finds all Table Elements relative to the context Node that have an outerJoinAlias attribute with the specified value.

Supported API: false

Parameters:
a_contextNode - Relative, Exclusive context Node
a_alias - Element outerJoinAlias attribute to search for
Throws:
WTException

getAbsoluteRelativeInclusiveFragmentElement

private static Element getAbsoluteRelativeInclusiveFragmentElement(Node a_contextNode,
                                                                   StringBuffer a_expression)
                                                            throws WTException
This method returns the Element in the document that satisfies the expression.

Supported API: false

Parameters:
a_contextNode - Absolute context Node, relative inclusive fragment
a_expression - Expression to use to search
Returns:
result Element, null if not found
Throws:
WTException

getNodeList

private static NodeList getNodeList(Node a_contextNode,
                                    String a_expression)
                             throws WTException
Throws:
WTException

getNode

private static Node getNode(Node a_contextNode,
                            String a_expression)
                     throws WTException
Throws:
WTException

getReverseNode

private static Node getReverseNode(Node a_contextNode,
                                   String a_expression)
                            throws WTException
Throws:
WTException

displayDocument

private void displayDocument(Element a_element)