org.apache.openjpa.kernel.exps
Class Lit

java.lang.Object
  extended by org.apache.openjpa.kernel.exps.Val
      extended by org.apache.openjpa.kernel.exps.Lit
All Implemented Interfaces:
Serializable, Constant, Literal, Value

 class Lit
extends Val
implements Literal

Represents a literal.

Author:
Abe White

Field Summary
 
Fields inherited from interface org.apache.openjpa.kernel.exps.Literal
TYPE_BOOLEAN, TYPE_CLASS, TYPE_COLLECTION, TYPE_DATE, TYPE_ENUM, TYPE_NUMBER, TYPE_SQ_STRING, TYPE_STRING, TYPE_TIME, TYPE_TIMESTAMP, TYPE_UNKNOWN
 
Constructor Summary
Lit(Object val, int ptype)
          Constructor.
 
Method Summary
protected  Object eval(Object candidate, Object orig, StoreContext ctx, Object[] params)
          Return this value for the given candidate.
 int getParseType()
          The type the literal was parsed as.
 Class getType()
          Return the expected type for this value, or Object if the type is unknown.
 Object getValue()
          The value of this literal.
 Object getValue(Object[] parameters)
          Return the value for this constant given the specified parameters.
 void setImplicitType(Class type)
          Set the implicit type of the value, based on how it is used in the filter.
 void setValue(Object val)
          The value of this literal.
 
Methods inherited from class org.apache.openjpa.kernel.exps.Val
acceptVisit, eval, evaluate, evaluate, getAlias, getMetaData, getName, getPath, getSelectAs, isAggregate, isVariable, isXPath, setAlias, setMetaData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.openjpa.kernel.exps.Value
acceptVisit, getAlias, getMetaData, getName, getPath, getSelectAs, isAggregate, isVariable, isXPath, setAlias, setMetaData
 

Constructor Detail

Lit

public Lit(Object val,
           int ptype)
Constructor. Provide constant value.

Method Detail

getValue

public Object getValue()
Description copied from interface: Literal
The value of this literal.

Specified by:
getValue in interface Literal

setValue

public void setValue(Object val)
Description copied from interface: Literal
The value of this literal.

Specified by:
setValue in interface Literal

getParseType

public int getParseType()
Description copied from interface: Literal
The type the literal was parsed as.

Specified by:
getParseType in interface Literal

getValue

public Object getValue(Object[] parameters)
Description copied from interface: Constant
Return the value for this constant given the specified parameters.

Specified by:
getValue in interface Constant

getType

public Class getType()
Description copied from interface: Value
Return the expected type for this value, or Object if the type is unknown.

Specified by:
getType in interface Value

setImplicitType

public void setImplicitType(Class type)
Description copied from interface: Value
Set the implicit type of the value, based on how it is used in the filter. This method is only called on values who return Object from Value.getType().

Specified by:
setImplicitType in interface Value

eval

protected Object eval(Object candidate,
                      Object orig,
                      StoreContext ctx,
                      Object[] params)
Description copied from class: Val
Return this value for the given candidate.

Specified by:
eval in class Val


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.