|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.query.qml.Util
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
|
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 |
private static final String SLASH
private static final String DOUBLE_SLASH
private static final String ANY
private static final String CHILD
private static final String CHILD_ANY
private static final String DESCENDANT
private static final String DESCENDANT_OR_SELF
private static final String ANCESTOR
private static final String ANCESTOR_OR_SELF
private static final String PARENT
private static final String SELF
private static final String PARENT_ANY
private static final String ATTRIBUTE
private static final String OR
private static final String FIRST
private static final String OPERAND_CHILD_IN_LIKE_CONDITION_EXPRESSION
private static final String DESCENDANT_TABLE_ALIAS_EXPRESSION
private static final String DESCENDANT_SELECT_COLUMN_HEADING_EXPRESSION
private static final String SELECT_OBJECT_FROM_ALIAS_EXPRESSION
private static final String ALL_ALIAS_EXPRESSION
private static final String ALL_COLUMN_TARGET_HEADING_EXPRESSION
private static final String PARAMETER_LIST_EXPRESSION
private static final String ALL_PARAMETER_TARGETS_EXPRESSION
private static final String ANCESTOR_QUERY_EXPRESSION
private static final String DESCENDANT_QUERY_EXPRESSION
private static final String CHILD_FROM_TABLE_EXPRESSION
private static final String SELECT_LIST_EXPRESSION
private static final String SELECT_NONDERIVED_LIST_EXPRESSION
private static final String ORDER_BY_LIST_EXPRESSION
private static final String ALL_ELEMENTS_EXPRESSION
private static final String OUTER_JOIN_ALIAS_EXPRESSION
private static final String BIND_PARAMETER_EXPRESSION
private static final String ANCESTOR_CONDITION_EXPRESSION
private static final String QML_EXPRESSION
private static final String JOIN_LIST_BY_ALIAS_TARGET_EXPRESSION
private static final String WHERE_ELEMENT_EXPRESSION
private static final String PARAMETER_TARGET_EXPRESSION
private static final String PARAMETER_EXPRESSION
private static final String COLUMN_LIST_EXPRESSION
public static final String EQUAL
public static final String NOT_EQUAL
public static final String LESS_THAN
public static final String GREATER_THAN
private static XPathFactory FACTORY
static EmptyNodeList EMPTY_LIST
private static final boolean VERBOSE
Constructor Detail |
public Util()
Method Detail |
public static List getAttributes(NodeList a_list, String a_attribute)
a_list
- NodeList of Elementsa_attribute
- Name of the attribute to return
public static int getElementDepth(Node a_contextNode, String a_tag)
a_contextNode
- Relative, Inclusive context Nodea_tag
- Element tag name to search for
public static Element getFirstChildElement(Node a_node)
WTException
public static Element getNextSiblingElement(Node a_node)
WTException
public static Element getChildElementAt(Node a_node, int a_index)
WTException
public static Element findAncestorQueryElement(Node a_contextNode) throws WTException
a_contextNode
- Relative, Inclusive context Node
WTException
public static NodeList findDescendantSubQueryElements(Node a_contextNode, int a_level) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_level
- Indicates the level to return (0 based).
WTException
public static NodeList findChildren(Node a_contextNode) throws WTException
a_contextNode
- Relative, Exclusive context Node
WTException
public static Element findChildElement(Node a_contextNode, String a_tag) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_tag
- Element tag name to search for
WTException
public static int getChildElementCount(Node a_node)
WTException
public static Element findFirstElement(Node a_contextNode, String a_tag) throws WTException
a_contextNode
- Relative, Inclusive context Nodea_tag
- Element tag name to search for
WTException
public static Element findChildElement(Element a_parent, String a_attribute, String a_value)
a_attribute
- Element attribute to search fora_value
- Element attribute value to search for
WTException
public static Element findParentElement(Element a_contextNode, String a_elementTag) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_elementTag
- Element tag name to search for
WTException
public static boolean getAttributeExists(Element a_element, String a_attributeName)
a_element
- element to retrieve attribute froma_attributeName
- Element attribute name to search for
public static boolean getAttributeAsBoolean(Element a_element, String a_attributeName)
a_element
- element to retrieve attribute froma_attributeName
- Element attribute name to search for
public static String getOtherJoinAlias(Element a_joinElement, String a_alias)
a_joinElement
- Relative, Exclusive context Nodea_alias
- Element alias attribute to search for
public static void arrangeChildren(Node a_contextNode, String[] a_order) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_order
- ordered array of Element tag names
WTException
public static Element findSiblingElement(Element a_child, String a_tag) throws WTException
a_tag
- Element tag to search for
WTException
public static NodeList getElements(Node a_contextNode, String a_tag) throws WTException
a_contextNode
- Absolute context Nodea_tag
- Element tag attribute to search for
WTException
public static NodeList getElementsWithAttribute(Node a_contextNode, String a_tag, String a_name, String a_value) throws WTException
a_contextNode
- Absolute context Nodea_tag
- Element tag attribute to search fora_name
- Element attribute name search fora_value
- Element attribute value search for
WTException
public static Element getQmlElement(Node a_contextNode) throws WTException
a_contextNode
- Absolute context Node
WTException
public static Element getAliasedFromElement(Node a_contextNode, String a_alias) throws WTException
a_contextNode
- Absolute context Node, relative inclusive fragmenta_alias
- Element alias attribute to search for
WTException
public static Element getAliasedColumnElement(Node a_contextNode, String a_heading) throws WTException
a_contextNode
- Absolute context Node, relative inclusive fragmenta_heading
- Element alias attribute to search for
WTException
public static NodeList getFromAliasedObjectElements(Node a_contextNode, String a_alias) throws WTException
a_contextNode
- Absolute context Nodea_alias
- Element alias attribute to search for
WTException
public static NodeList getParameterTargetElements(Node a_contextNode) throws WTException
a_contextNode
- Absolute context Node
WTException
public static NodeList getBindParameterElements(Node a_contextNode) throws WTException
a_contextNode
- Relative, Exclusive context Node
WTException
public static NodeList getParameterElements(Node a_contextNode) throws WTException
a_contextNode
- Absolute context Node
WTException
public static NodeList getParameterTargetElementsWithName(Node a_contextNode, String a_name) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_name
- Element name attribute to search for
WTException
public static Node getParameterTargetElement(Node a_contextNode, String a_name) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_name
- Element name attribute to search for
WTException
public static Element getParameterElement(Node a_contextNode, String a_name) throws WTException
a_contextNode
- Absolute context Nodea_name
- Element name attribute to search for
WTException
public static NodeList getColumnElements(Node a_contextNode) throws WTException
a_contextNode
- Relative, Exclusive context Node
WTException
public static NodeList findDescendantFromElements(Node a_contextNode, boolean a_includeAllDescendants) throws WTException
a_contextNode
- Relative, Inclusive context Nodea_includeAllDescendants
- Indicates if all descendants should be
returned(true) or only the first level descendants(false)
WTException
public static NodeList findAncestorFromElements(Node a_contextNode, boolean a_includeAllAncestors) throws WTException
a_contextNode
- Relative, Inclusive context Nodea_includeAllAncestors
- Indicates if all ancestors should be
returned(true) or only the first level ancestors(false)
WTException
public static NodeList getSelectElements(Node a_contextNode, boolean a_includeAll) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_includeAll
- indicates whether nonderived elements are filtered
WTException
public static Node getStatementWhereElement(Node a_contextNode) throws WTException
a_contextNode
- Relative, Exclusive context Node
WTException
public static NodeList getOrderByElements(Node a_contextNode) throws WTException
a_contextNode
- Relative, Exclusive context Node
WTException
public static NodeList getJoinElements(Node a_contextNode, String a_tagName) throws WTException
a_contextNode
- Absolute context Node
WTException
public static Node getOperandChildLikeCondition(Node a_contextNode) throws WTException
a_contextNode
- Relative, Exclusive context Node
WTException
public static NodeList getAliasedJoinElements(Node a_contextNode, String a_alias) throws WTException
a_contextNode
- Absolute context Nodea_alias
- Alias Target Element alias attribute to search for
WTException
public static Node getAncestorConditionElement(Node a_contextNode) throws WTException
a_contextNode
- Relative, Exclusive context Node
WTException
public static void refreshColumnTargetHeading(Node a_contextNode, String a_oldHeading, String a_newHeading) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_oldHeading
- Element heading attribute to search fora_newHeading
- Element heading attribute value to change to
WTException
public static void deleteColumnTarget(Node a_contextNode, String a_heading) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_heading
- Element heading attribute to search for
WTException
public static void refreshAlias(Node a_contextNode, String a_oldAlias, String a_newAlias) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_oldAlias
- Element alias attribute to search fora_newAlias
- Element alias attribute value to change to
WTException
public static void deleteAlias(Node a_contextNode, String a_oldAlias) throws WTException
a_contextNode
- Relative, Exclusive context Node
WTException
public static Class findFromClass(Node a_contextNode, String a_alias) throws WTException
a_contextNode
- Absolute context Nodea_alias
- Element alias attribute to search for
WTException
public static Class getFromClass(Element a_fromElement) throws WTException
a_fromElement
- From element to dervie class from
WTException
public static NodeList getElementsWithNoAttribute(Node a_contextNode, String a_tag, String a_attributeName) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_tag
- Element tag name to search fora_attributeName
- attribute name to search for
WTException
public static NodeList getElementsWithChildCount(Node a_contextNode, String a_tag, int a_count, String a_operator) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_tag
- Element tag name to search fora_count
- value to use in count comparison expressiona_operator
- type of operator for the comparison expression
WTException
public static int remove(NodeList a_list)
a_list
- List of Nodes to remove
public static void remove(Node a_node)
private static void appendValue(String a_value, StringBuffer a_buffer) throws WTException
WTException
private static NodeList getColumnTargetElements(Node a_contextNode, String a_heading) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_heading
- Element heading attribute to search for
WTException
private static Vector getAliasedElements(Node a_contextNode, String a_alias) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_alias
- Element alias attribute to search for
WTException
private static NodeList getOuterJoinAliasedElements(Node a_contextNode, String a_alias) throws WTException
a_contextNode
- Relative, Exclusive context Nodea_alias
- Element outerJoinAlias attribute to search for
WTException
private static Element getAbsoluteRelativeInclusiveFragmentElement(Node a_contextNode, StringBuffer a_expression) throws WTException
a_contextNode
- Absolute context Node, relative inclusive fragmenta_expression
- Expression to use to search
WTException
private static NodeList getNodeList(Node a_contextNode, String a_expression) throws WTException
WTException
private static Node getNode(Node a_contextNode, String a_expression) throws WTException
WTException
private static Node getReverseNode(Node a_contextNode, String a_expression) throws WTException
WTException
private void displayDocument(Element a_element)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |