Class LiteralExpression

java.lang.Object
org.apache.camel.language.simple.ast.BaseSimpleNode
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 Details

  • Constructor Details

    • LiteralExpression

      public LiteralExpression(SimpleToken token)
  • Method Details

    • 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 org.apache.camel.Expression createExpression(org.apache.camel.CamelContext camelContext, String expression)
      Description copied from interface: SimpleNode
      Creates a Camel Expression based on this model.
      Specified by:
      createExpression in interface SimpleNode
      Parameters:
      camelContext - the camel context
      expression - the input string
      Returns:
      the created Expression
    • createCode

      public String createCode(org.apache.camel.CamelContext camelContext, String expression) throws SimpleParserException
      Description copied from interface: SimpleNode
      Creates Java code based on this model.
      Specified by:
      createCode in interface SimpleNode
      Parameters:
      camelContext - the camel context
      expression - the input string
      Returns:
      the created Java code
      Throws:
      SimpleParserException - should be thrown if error parsing the model