com.endeca.portal.data.functions
Class ArbitraryLQLASTFilter

java.lang.Object
  extended by com.endeca.portal.data.functions.QueryFunction
      extended by com.endeca.portal.data.functions.QueryFilter
          extended by com.endeca.portal.data.functions.LQLFilter
              extended by com.endeca.portal.data.functions.ArbitraryLQLASTFilter
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DataSourceFilter, SelectionFilter

public abstract class ArbitraryLQLASTFilter
extends LQLFilter

Abstract superclass for DataSourceFilter and SelectionFilter. This superclass contains the bulk of the implementation for those classes.

Author:
Endeca Technologies, Inc.
See Also:
Serialized Form

Field Summary
protected  java.lang.String expressionString
           
protected  java.lang.String filterString
           
 
Fields inherited from class com.endeca.portal.data.functions.QueryFunction
CLASS_PROPERTY
 
Constructor Summary
protected ArbitraryLQLASTFilter()
           
  ArbitraryLQLASTFilter(com.endeca.mdex.lql_parser.types.ExpressionBase expression)
           
  ArbitraryLQLASTFilter(java.lang.String name, com.endeca.mdex.lql_parser.types.ExpressionBase expression)
           
 
Method Summary
 com.endeca.mdex.lql_parser.types.ExpressionBase getExpression()
          gets the LQL expression in object form
 java.lang.String getExpressionString()
          Returns an XML representation of this filter's LQL AST.
 void initializeFromJSON(MDEXState mdexState)
          This method is called when constructing a MDEXState's initialQueryState from a json object.
 void setExpression(com.endeca.mdex.lql_parser.types.ExpressionBase expression)
          sets the LQL expression from an object form.
 void setExpressionString(java.lang.String exprString)
          Sets this filter's LQL AST expression from an XML representation.
 java.lang.String toString()
          This class' toString is abstract: all concrete subclasses are expected to provide an implementation. toString is used in comparing QueryFunction instances for equality, so if you implement a QueryFunction subclass it is important that your toString implementation be consistent and deterministic.
 
Methods inherited from class com.endeca.portal.data.functions.LQLFilter
applyToDiscoveryServiceQuery, applyToLQLFilter
 
Methods inherited from class com.endeca.portal.data.functions.QueryFunction
beforeQueryStateAdd, clone, equals, equals, getName, hashCode, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

expressionString

protected java.lang.String expressionString

filterString

protected java.lang.String filterString
Constructor Detail

ArbitraryLQLASTFilter

protected ArbitraryLQLASTFilter()

ArbitraryLQLASTFilter

public ArbitraryLQLASTFilter(com.endeca.mdex.lql_parser.types.ExpressionBase expression)

ArbitraryLQLASTFilter

public ArbitraryLQLASTFilter(java.lang.String name,
                             com.endeca.mdex.lql_parser.types.ExpressionBase expression)
Method Detail

initializeFromJSON

public void initializeFromJSON(MDEXState mdexState)
                        throws QueryFunctionInitializationException
Description copied from class: QueryFunction
This method is called when constructing a MDEXState's initialQueryState from a json object. Subclasses should override and implement this method if they desire to execute code upon initialization from json. The ArbitraryLQLASTFilter classes use this technique to allow different params/member vars for initialization from json vs. initialization programmatically from within Java.

Overrides:
initializeFromJSON in class QueryFunction
Parameters:
mdexState - the MDEXState object on which this QueryFunction exists
Throws:
QueryFunctionInitializationException

getExpressionString

public java.lang.String getExpressionString()
Returns an XML representation of this filter's LQL AST. This representation was previously created via LQLUtils.expressionToFilterString(ExpressionBase).

Returns:
XML representation of the LQL AST

setExpressionString

public void setExpressionString(java.lang.String exprString)
Sets this filter's LQL AST expression from an XML representation. To set the expression directly from an object, see setExpression(ExpressionBase). The XML input should have previously been generated by getExpressionString() or LQLUtils.expressionToFilterString(ExpressionBase). We recommend that users do not call this method directly. This method exists is required for deserialization of QueryState objects.

Parameters:
exprString - XML representation of the expression

getExpression

public com.endeca.mdex.lql_parser.types.ExpressionBase getExpression()
gets the LQL expression in object form

Returns:
the LQL expression in object form

setExpression

public void setExpression(com.endeca.mdex.lql_parser.types.ExpressionBase expression)
sets the LQL expression from an object form.

Parameters:
expression - the LQL expression in object form

toString

public java.lang.String toString()
Description copied from class: QueryFunction
This class' toString is abstract: all concrete subclasses are expected to provide an implementation. toString is used in comparing QueryFunction instances for equality, so if you implement a QueryFunction subclass it is important that your toString implementation be consistent and deterministic.

Specified by:
toString in class QueryFunction