Class AbstractExpressionRenderer
- java.lang.Object
-
- com.exasol.sql.expression.rendering.AbstractExpressionRenderer
-
- Direct Known Subclasses:
ValueExpressionRenderer
public abstract class AbstractExpressionRenderer extends Object
Common base class for expression renderers.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringBuilder
builder
Builder that holds the fragments of the rendered stringprotected StringRendererConfig
config
Configuration that controls string rendering options
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractExpressionRenderer(StringRendererConfig config)
Create a new instance of aAbstractExpressionRenderer
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
append(String string)
Append a string.protected void
appendAutoQuoted(String identifier)
Append a SQL identifier with the right form of quotes.protected void
appendBooleanLiteral(BooleanLiteral literal)
Append a boolean literal (i.e.protected void
appendKeyword(String keyword)
Append a SQL keyword (likeSELECT
).protected void
endParenthesis()
End a parenthesis.String
render()
Render expression to a stringprotected void
startParenthesis()
Start a parenthesis.
-
-
-
Field Detail
-
config
protected final StringRendererConfig config
Configuration that controls string rendering options
-
builder
protected final StringBuilder builder
Builder that holds the fragments of the rendered string
-
-
Constructor Detail
-
AbstractExpressionRenderer
protected AbstractExpressionRenderer(StringRendererConfig config)
Create a new instance of aAbstractExpressionRenderer
.- Parameters:
config
- configuration that controls string rendering options
-
-
Method Detail
-
appendKeyword
protected void appendKeyword(String keyword)
Append a SQL keyword (likeSELECT
).- Parameters:
keyword
- SQL keyword
-
appendBooleanLiteral
protected void appendBooleanLiteral(BooleanLiteral literal)
Append a boolean literal (i.e.true
offalse
).- Parameters:
literal
- boolean literal
-
startParenthesis
protected void startParenthesis()
Start a parenthesis.
-
endParenthesis
protected void endParenthesis()
End a parenthesis.
-
append
protected void append(String string)
Append a string.- Parameters:
string
- string to append
-
appendAutoQuoted
protected void appendAutoQuoted(String identifier)
Append a SQL identifier with the right form of quotes.- Parameters:
identifier
- SQL identifier to be appended
-
render
public String render()
Render expression to a string- Returns:
- rendered string
-
-