public abstract class ExpressionBase extends Object implements Expression
Constructor and Description |
---|
ExpressionBase()
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(Expression expression)
Adds a new child expression to the current expression.
|
List<Expression> |
getChildren()
Returns the list of sub-expressions to the current expression.
|
String |
getTreeObjectName()
Returns the tree of object name, for use by tools to assign an identifier to an expression.
|
protected static void |
renderAggregation(StringWriter writer,
String name,
boolean distinct,
List<Expression> children)
Render an aggregation function with distinct and parameter expressions
|
void |
setChildren(List<Expression> children)
Sets the list of sub-expressions (child expressions) to the current expression node.
|
void |
setTreeObjectName(String treeObjectName)
Sets the tree of object name, for use by tools to assign an identifier to an expression.
|
void |
toEPL(StringWriter writer,
ExpressionPrecedenceEnum parentPrecedence)
Write expression considering precedence.
|
static void |
toPrecedenceFreeEPL(List<Expression> children,
StringWriter writer)
Render expression list
|
protected static void |
toPrecedenceFreeEPL(String functionName,
List<Expression> children,
StringWriter writer)
Renders child expression of a function in a comma-separated list.
|
abstract void |
toPrecedenceFreeEPL(StringWriter writer)
Renders the expressions and all it's child expression, in full tree depth, as a string in
language syntax.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPrecedence
public String getTreeObjectName()
Expression
getTreeObjectName
in interface Expression
public void setTreeObjectName(String treeObjectName)
Expression
setTreeObjectName
in interface Expression
treeObjectName
- tree object idpublic List<Expression> getChildren()
getChildren
in interface Expression
public void addChild(Expression expression)
expression
- to addpublic void setChildren(List<Expression> children)
Expression
setChildren
in interface Expression
children
- child expressions or empty list if there are no child expressionspublic final void toEPL(StringWriter writer, ExpressionPrecedenceEnum parentPrecedence)
Expression
toEPL
in interface Expression
writer
- to useparentPrecedence
- precedenceprotected static void toPrecedenceFreeEPL(String functionName, List<Expression> children, StringWriter writer)
functionName
- function namechildren
- child nodeswriter
- writerpublic static void toPrecedenceFreeEPL(List<Expression> children, StringWriter writer)
children
- expressions to renderwriter
- writer to render toprotected static void renderAggregation(StringWriter writer, String name, boolean distinct, List<Expression> children)
writer
- to render toname
- function namedistinct
- distinct flagchildren
- parameters to renderpublic abstract void toPrecedenceFreeEPL(StringWriter writer)
writer
- is the output to use