com.gentics.api.lib.expressionparser
Class ExpressionParser

java.lang.Object
  extended by com.gentics.api.lib.expressionparser.ExpressionParser

public final class ExpressionParser
extends java.lang.Object

This is the expression parser (singleton). The expression parser parses strings into reusable expressions.


Field Summary
static java.lang.Object ASSIGNMENT
          constant result object for assignments
static EvaluableExpression FALSE
          Constant expression, which is always 'false'
static boolean treatEmptyStringAsNull
          Default value for the property "treatEmptyStringAsNull" when no portal configuration found.
static EvaluableExpression TRUE
          Constant expression, which is always 'true'
 
Method Summary
static java.lang.String getExpressionParserMode()
          Get the expressionparser mode as String
static java.lang.String getExpressionParserMode(ExpressionQueryRequest request)
           
static ExpressionParser getInstance()
          Get the singleton instance of the expression parser
static boolean isCompatibilityMode()
          Check whether compatibility mode is on for the expression parser.
static boolean isCompatibilityTestMode()
          Check whether compatibility test mode is on for the expression parser.
static boolean isTreatEmptyStringAsNull()
          Check whether empty strings shall be treated as null or not
 Expression parse(java.lang.String expressionString)
          Parse the given expression string into an Expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASSIGNMENT

public static final java.lang.Object ASSIGNMENT
constant result object for assignments


treatEmptyStringAsNull

public static boolean treatEmptyStringAsNull
Default value for the property "treatEmptyStringAsNull" when no portal configuration found. This is just for testing purposes and will not be effective in production environments


TRUE

public static EvaluableExpression TRUE
Constant expression, which is always 'true'


FALSE

public static EvaluableExpression FALSE
Constant expression, which is always 'false'

Method Detail

getInstance

public static ExpressionParser getInstance()
Get the singleton instance of the expression parser

Returns:
expression parser instance

parse

public Expression parse(java.lang.String expressionString)
                 throws ParserException
Parse the given expression string into an Expression. This method is threadsafe.

Parameters:
expressionString - expression string
Returns:
expression
Throws:
ParserException - when the string cannot be parsed into an Expression

isTreatEmptyStringAsNull

public static boolean isTreatEmptyStringAsNull()
Check whether empty strings shall be treated as null or not

Returns:
true when empty strings are treated as null, false if not

isCompatibilityMode

public static boolean isCompatibilityMode()
Check whether compatibility mode is on for the expression parser. (Default is true). When the compatibility mode is off, the old API (RuleTree, Rule, ...) will also use the new ExpressionParser.

Returns:
true when the compatibility mode is on, false if not

isCompatibilityTestMode

public static boolean isCompatibilityTestMode()
Check whether compatibility test mode is on for the expression parser. (Default is false). When compatibility test mode is on, the old API will also use the new ExpressionParser but check changes to the old API functionality.

Returns:
true when the compatibility test mode is on, false if not

getExpressionParserMode

public static java.lang.String getExpressionParserMode()
Get the expressionparser mode as String

Parameters:
request -
Returns:
expressionparser mode

getExpressionParserMode

public static java.lang.String getExpressionParserMode(ExpressionQueryRequest request)


Copyright © 2013 Gentics Software GmbH. All Rights Reserved.