org.apache.camel.language.simple.ast
Class LiteralExpression

java.lang.Object
  extended by org.apache.camel.language.simple.ast.BaseSimpleNode
      extended by org.apache.camel.language.simple.ast.LiteralExpression
All Implemented Interfaces:
LiteralNode, SimpleNode
Direct Known Subclasses:
SimpleFunctionExpression

public class LiteralExpression
extends BaseSimpleNode
implements LiteralNode

Represents literals in the AST.


Field Summary
protected  StringBuilder text
           
 
Fields inherited from class org.apache.camel.language.simple.ast.BaseSimpleNode
token
 
Constructor Summary
LiteralExpression(SimpleToken token)
           
 
Method Summary
 void addText(String text)
          Adds the given text to this model.
 Expression createExpression(String expression)
          Creates a Camel Expression based on this model.
 String getText()
          Gets the text
 boolean quoteEmbeddedNodes()
          Whether to quote embedded nodes.
 String toString()
           
 
Methods inherited from class org.apache.camel.language.simple.ast.BaseSimpleNode
getToken
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.language.simple.ast.SimpleNode
getToken
 

Field Detail

text

protected StringBuilder text
Constructor Detail

LiteralExpression

public LiteralExpression(SimpleToken token)
Method Detail

toString

public String toString()
Overrides:
toString in class BaseSimpleNode

addText

public void addText(String text)
Description copied from interface: LiteralNode
Adds the given text to this model.

This operation can be invoked multiple times to add more text.

Specified by:
addText in interface LiteralNode
Parameters:
text - the text to add

getText

public String getText()
Description copied from interface: LiteralNode
Gets the text

Specified by:
getText in interface LiteralNode
Returns:
the text, will never be null, but may contain an empty string.

quoteEmbeddedNodes

public boolean quoteEmbeddedNodes()
Description copied from interface: LiteralNode
Whether to quote embedded nodes.

Some functions such as the bean: function would need to quote its embedded nodes as they are parameter values for method names.

Specified by:
quoteEmbeddedNodes in interface LiteralNode

createExpression

public Expression createExpression(String expression)
Description copied from interface: SimpleNode
Creates a Camel Expression based on this model.

Specified by:
createExpression in interface SimpleNode
Parameters:
expression - the input string
Returns:
the created Expression


Apache CAMEL