org.apache.openjpa.kernel.exps
Class BindVariableExpression

java.lang.Object
  extended by org.apache.openjpa.kernel.exps.Exp
      extended by org.apache.openjpa.kernel.exps.BindVariableExpression
All Implemented Interfaces:
Serializable, Expression
Direct Known Subclasses:
BindKeyVariableExpression, BindValueVariableExpression

 class BindVariableExpression
extends Exp

Binds a variable to a collection.

Author:
Abe White

Constructor Summary
BindVariableExpression(BoundVariable var, Val val)
          Constructor.
 
Method Summary
 void acceptVisit(ExpressionVisitor visitor)
          Accept a visit from a tree visitor.
protected  boolean eval(Collection candidates, StoreContext ctx, Object[] params)
          Evaluate the expression for the given group.
protected  boolean eval(Object candidate, Object orig, StoreContext ctx, Object[] params)
          Evaluate the expression for the given context candidate and original candidate.
protected  Collection getCollection(Object values)
          Return a collection for the given object, produced by eval'ing the value of this expression.
 BoundVariable getVariable()
           
 Collection getVariableValues(Object candidate, Object orig, StoreContext ctx, Object[] params)
          Return the possible values that variable can take.
 
Methods inherited from class org.apache.openjpa.kernel.exps.Exp
evaluate, evaluate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindVariableExpression

public BindVariableExpression(BoundVariable var,
                              Val val)
Constructor.

Parameters:
var - the bound variable
val - the value the variable is bound to
Method Detail

getVariable

public BoundVariable getVariable()

getVariableValues

public Collection getVariableValues(Object candidate,
                                    Object orig,
                                    StoreContext ctx,
                                    Object[] params)
Return the possible values that variable can take.


getCollection

protected Collection getCollection(Object values)
Return a collection for the given object, produced by eval'ing the value of this expression. Simply casts the object to a collection by default.


eval

protected boolean eval(Object candidate,
                       Object orig,
                       StoreContext ctx,
                       Object[] params)
Description copied from class: Exp
Evaluate the expression for the given context candidate and original candidate.

Overrides:
eval in class Exp

eval

protected boolean eval(Collection candidates,
                       StoreContext ctx,
                       Object[] params)
Description copied from class: Exp
Evaluate the expression for the given group.

Overrides:
eval in class Exp

acceptVisit

public void acceptVisit(ExpressionVisitor visitor)
Description copied from interface: Expression
Accept a visit from a tree visitor.

Specified by:
acceptVisit in interface Expression
Overrides:
acceptVisit in class Exp


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