com.caucho.amber.expr
Class EnumExpr

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

public class EnumExpr
extends AbstractAmberExpr

Enum expression for Amber.


Field Summary
 
Fields inherited from interface com.caucho.amber.expr.AmberExpr
IS_INNER_JOIN, USES_DATA
 
Constructor Summary
EnumExpr(java.lang.Class javaType, java.lang.String name, int ordinal)
          Creates a new enum expression.
 
Method Summary
 AmberExpr bindSelect(QueryParser parser)
          Binds the expression as a select item.
 void generateHaving(CharBuffer cb)
          Generates the having expression.
 void generateUpdateWhere(CharBuffer cb)
          Generates the (update) enum.
 void generateWhere(CharBuffer cb)
          Generates the enum.
 java.lang.Class getJavaType()
          Returns the java type
 int getOrdinal()
          Returns the enum value
 AmberType getType()
          Returns the expr type.
 boolean isOrdinal()
          Returns true for ordinal
 void setOrdinal(boolean isOrdinal)
          Sets true for ordinal
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.amber.expr.AbstractAmberExpr
createBoolean, exists, exists, findItem, generateJoin, generateSelect, getCacheObject, getColumnCount, getObject, 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

EnumExpr

public EnumExpr(java.lang.Class javaType,
                java.lang.String name,
                int ordinal)
Creates a new enum expression.

Parameters:
javaType - the java type of the enum
name - the string name of the enum value
ordinal - the integer value of the enum
Method Detail

getType

public AmberType getType()
Returns the expr type.

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

getJavaType

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


getOrdinal

public int getOrdinal()
Returns the enum value


isOrdinal

public boolean isOrdinal()
Returns true for ordinal


setOrdinal

public void setOrdinal(boolean isOrdinal)
Sets true for ordinal


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

generateWhere

public void generateWhere(CharBuffer cb)
Generates the enum.

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

generateUpdateWhere

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

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