Package org.apache.openjpa.kernel.exps
Class Val
- java.lang.Object
-
- org.apache.openjpa.kernel.exps.Val
-
- All Implemented Interfaces:
java.io.Serializable,Value
- Direct Known Subclasses:
CandidatePath,Coalesce,NullIf,SimpleCase
public abstract class Val extends java.lang.Object implements Value
An in-memory representation of aValue.- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Val()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidacceptVisit(ExpressionVisitor visitor)Accept a visit from a tree visitor.protected abstract java.lang.Objecteval(java.lang.Object candidate, java.lang.Object orig, StoreContext ctx, java.lang.Object[] params)Return this value for the given candidate.protected java.util.Collectioneval(java.util.Collection candidates, java.lang.Object orig, StoreContext ctx, java.lang.Object[] params)Return a list of values resulting from evaluating each given candidate.java.lang.Objectevaluate(java.lang.Object candidate, java.lang.Object orig, StoreContext ctx, java.lang.Object[] params)Return this value as a projection on the given candidate.java.lang.Objectevaluate(java.util.Collection candidates, java.lang.Object orig, StoreContext ctx, java.lang.Object[] params)Return this value as an aggregate projection on the given group of candidates.java.lang.StringgetAlias()Return select item aliasClassMetaDatagetMetaData()Return any associated persistent type.java.lang.StringgetName()PathgetPath()ValuegetSelectAs()Return 'this' concrete class if alias is set, otherwise nullbooleanisAggregate()Return true if this value is an aggregate.booleanisVariable()Return true if this value is a variable.booleanisXPath()Return true if this value is an XML Path.voidsetAlias(java.lang.String alias)Set select item aliasvoidsetMetaData(ClassMetaData meta)Associate a persistent type with this value.-
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
getType, setImplicitType
-
-
-
-
Method Detail
-
evaluate
public final java.lang.Object evaluate(java.lang.Object candidate, java.lang.Object orig, StoreContext ctx, java.lang.Object[] params)Return this value as a projection on the given candidate.
-
evaluate
public final java.lang.Object evaluate(java.util.Collection candidates, java.lang.Object orig, StoreContext ctx, java.lang.Object[] params)Return this value as an aggregate projection on the given group of candidates.
-
eval
protected abstract java.lang.Object eval(java.lang.Object candidate, java.lang.Object orig, StoreContext ctx, java.lang.Object[] params)Return this value for the given candidate.
-
eval
protected java.util.Collection eval(java.util.Collection candidates, java.lang.Object orig, StoreContext ctx, java.lang.Object[] params)Return a list of values resulting from evaluating each given candidate. By default, this implementation invokes#eval(Object,Object,StoreContext,Map)for each instance and packs the return value into a new list. Aggregates should override.
-
getMetaData
public ClassMetaData getMetaData()
Description copied from interface:ValueReturn any associated persistent type.- Specified by:
getMetaDatain interfaceValue
-
setMetaData
public void setMetaData(ClassMetaData meta)
Description copied from interface:ValueAssociate a persistent type with this value.- Specified by:
setMetaDatain interfaceValue
-
isVariable
public boolean isVariable()
Description copied from interface:ValueReturn true if this value is a variable.- Specified by:
isVariablein interfaceValue
-
isAggregate
public boolean isAggregate()
Description copied from interface:ValueReturn true if this value is an aggregate.- Specified by:
isAggregatein interfaceValue
-
isXPath
public boolean isXPath()
Description copied from interface:ValueReturn true if this value is an XML Path.
-
acceptVisit
public void acceptVisit(ExpressionVisitor visitor)
Description copied from interface:ValueAccept a visit from a tree visitor.- Specified by:
acceptVisitin interfaceValue
-
getAlias
public java.lang.String getAlias()
Description copied from interface:ValueReturn select item alias
-
setAlias
public void setAlias(java.lang.String alias)
Description copied from interface:ValueSet select item alias
-
getSelectAs
public Value getSelectAs()
Description copied from interface:ValueReturn 'this' concrete class if alias is set, otherwise null- Specified by:
getSelectAsin interfaceValue
-
-