com.caucho.amber.expr
Class LiteralExpr

java.lang.Object
  extended by com.caucho.amber.expr.AbstractAmberExpr
      extended by com.caucho.amber.expr.LiteralExpr
All Implemented Interfaces:
AmberExpr

public class LiteralExpr
extends AbstractAmberExpr

Literal expression for Amber.


Field Summary
 
Fields inherited from interface com.caucho.amber.expr.AmberExpr
IS_INNER_JOIN, USES_DATA
 
Constructor Summary
LiteralExpr(QueryParser parser, java.lang.String value, java.lang.Class javaType)
          Creates a new literal expression.
 
Method Summary
 AmberExpr bindSelect(QueryParser parser)
          Binds the expression as a select item.
 boolean exists()
          Returns true if the expression must exist
 void generateHaving(CharBuffer cb)
          Generates the having expression.
 void generateUpdateWhere(CharBuffer cb)
          Generates the (update) literal.
 void generateWhere(CharBuffer cb)
          Generates the literal.
 java.lang.Class getJavaType()
          Returns the java type
 java.lang.String getValue()
          Returns the literal value
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.amber.expr.AbstractAmberExpr
createBoolean, exists, findItem, generateJoin, generateSelect, getCacheObject, getColumnCount, getObject, getType, hasRelationship, isBoolean, replaceJoin, setInternalArgType, usesFrom, usesFrom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LiteralExpr

public LiteralExpr(QueryParser parser,
                   java.lang.String value,
                   java.lang.Class javaType)
Creates a new literal expression.

Parameters:
value - the string value of the literal
type - the java type of the literal
Method Detail

getJavaType

public java.lang.Class getJavaType()
Returns the java type


getValue

public java.lang.String getValue()
Returns the literal value


bindSelect

public AmberExpr bindSelect(QueryParser parser)
Binds the expression as a select item.

Specified by:
bindSelect in interface AmberExpr
Specified by:
bindSelect in class AbstractAmberExpr

exists

public boolean exists()
Returns true if the expression must exist

Specified by:
exists in interface AmberExpr
Overrides:
exists in class AbstractAmberExpr

generateWhere

public void generateWhere(CharBuffer cb)
Generates the literal.

Specified by:
generateWhere in interface AmberExpr
Overrides:
generateWhere in class AbstractAmberExpr

generateUpdateWhere

public void generateUpdateWhere(CharBuffer cb)
Generates the (update) literal.

Specified by:
generateUpdateWhere in interface AmberExpr
Overrides:
generateUpdateWhere in class AbstractAmberExpr

generateHaving

public void generateHaving(CharBuffer cb)
Generates the having expression.

Specified by:
generateHaving in interface AmberExpr
Overrides:
generateHaving in class AbstractAmberExpr

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object