wt.query.qml
Class QMLHelper

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

public class QMLHelper
extends Object

Utility functions

Supported API: false
Extendable: false


Field Summary
private static String CLASSNAME
           
static boolean DEBUG
           
private static DebugWriter LOG
           
private static char NEW_WILDCARD
           
private static char OLD_WILDCARD
           
 
Constructor Summary
QMLHelper()
           
 
Method Summary
private static boolean containsEmptyValue(Hashtable a_parameterMap, Object a_key)
           
static void dropEmptyCriteria(Node a_contextNode, Hashtable a_parameterMap)
          This method drops empty critieria Elements in the document.
static Vector getAliases(NodeList a_list)
          This method returns a Vector of aliases from the list of Elements.
static Map getJoinAliases(Node a_contextNode, String a_joinTag)
          This method returns a Map of aliases for Join Elements in the document.
static String getOtherOperandType(Node a_contextNode)
          This method returns the type of the other operand in a condition element.
static String getRootAlias(Node a_contextNode)
          This method gets the root TypeInstance alias specified in the document.
static boolean isAdvancedQuery(Node a_contextNode)
          This method indicates if the document contains advancend query features.
static boolean isInflateRequired(Element a_element)
           
static boolean isStringBound(Element a_element)
           
static boolean makeValid(Element a_contextNode)
          This method validates the QML based relative to the specified context Node.
private static boolean makeValidJoin(Element a_contextNode)
           
private static boolean makeValidOrderBy(Element a_contextNode)
           
private static boolean makeValidWhere(Element a_contextNode)
           
private static void removeConditionElement(Element a_condition)
           
static Element removeNegatedCompositeConditions(Element a_conditionElement)
           
static Object replaceLikeWildcard(Element a_operandChildElement, Object a_value)
           
static void setRootAlias(Node a_contextNode, String a_rootAlias)
          This method sets the root TypeInstance alias in the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSNAME

private static final String CLASSNAME

DEBUG

public static final boolean DEBUG

LOG

private static final DebugWriter LOG

OLD_WILDCARD

private static final char OLD_WILDCARD
See Also:
Constant Field Values

NEW_WILDCARD

private static final char NEW_WILDCARD
See Also:
Constant Field Values
Constructor Detail

QMLHelper

public QMLHelper()
Method Detail

getOtherOperandType

public static String getOtherOperandType(Node a_contextNode)
                                  throws WTException
This method returns the type of the other operand in a condition element. The specified node must be a child Element of an Operand.

Supported API: false

Parameters:
a_contextNode - Relative, inclusive Node
Returns:
type attribute of the operand element
Throws:
WTException

isAdvancedQuery

public static boolean isAdvancedQuery(Node a_contextNode)
                               throws WTException
This method indicates if the document contains advancend query features.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
Returns:
true if the Document contains advanced query features, otherwise false
Throws:
WTException

getRootAlias

public static String getRootAlias(Node a_contextNode)
                           throws WTException
This method gets the root TypeInstance alias specified in the document.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
Returns:
alias
Throws:
WTException

setRootAlias

public static void setRootAlias(Node a_contextNode,
                                String a_rootAlias)
                         throws WTException
This method sets the root TypeInstance alias in the document.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
a_rootAlias - the root alias to set
Throws:
WTException

makeValid

public static boolean makeValid(Element a_contextNode)
                         throws WTException
This method validates the QML based relative to the specified context Node. The speccified Element is assumed to be either a Query or SubQuery Element. If invalid QML Elements are found, then the invalid nodes are removed.

Supported API: false

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

getAliases

public static Vector getAliases(NodeList a_list)
                         throws WTException
This method returns a Vector of aliases from the list of Elements.

Supported API: false

Parameters:
a_list - NodeList of Elements
Returns:
Vector of the alias attributes of each Element
Throws:
WTException

getJoinAliases

public static Map getJoinAliases(Node a_contextNode,
                                 String a_joinTag)
                          throws WTException
This method returns a Map of aliases for Join Elements in the document.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
a_joinTag - Join Element tag to search for
Returns:
Map of results where the "from" alias is the key and the "to" alias is the value.
Throws:
WTException

removeNegatedCompositeConditions

public static Element removeNegatedCompositeConditions(Element a_conditionElement)
                                                throws WTException
Throws:
WTException

replaceLikeWildcard

public static Object replaceLikeWildcard(Element a_operandChildElement,
                                         Object a_value)
                                  throws WTException
Throws:
WTException

dropEmptyCriteria

public static void dropEmptyCriteria(Node a_contextNode,
                                     Hashtable a_parameterMap)
                              throws WTException
This method drops empty critieria Elements in the document.

Supported API: false

Parameters:
a_contextNode - Absolute context Node
a_parameterMap - Map of parameters names and values
Throws:
WTException

isStringBound

public static boolean isStringBound(Element a_element)
                             throws WTException
Throws:
WTException

isInflateRequired

public static boolean isInflateRequired(Element a_element)
                                 throws WTException
Throws:
WTException

removeConditionElement

private static void removeConditionElement(Element a_condition)

containsEmptyValue

private static boolean containsEmptyValue(Hashtable a_parameterMap,
                                          Object a_key)

makeValidWhere

private static boolean makeValidWhere(Element a_contextNode)
                               throws WTException
Throws:
WTException

makeValidOrderBy

private static boolean makeValidOrderBy(Element a_contextNode)
                                 throws WTException
Throws:
WTException

makeValidJoin

private static boolean makeValidJoin(Element a_contextNode)
                              throws WTException
Throws:
WTException