|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JepRestrictionFunction
This interface should be implemented by JEP functions
that can also be converted into a Restriction
that
can be used in queries.
Jep.formulaToRestriction(String, JepFunction[])
Method Summary | |
---|---|
Restriction |
toRestriction(Node node)
Convert this function to a Restriction that can be used
in a query. |
Methods inherited from interface net.sf.basedb.util.jep.JepFunction |
---|
getFunctionName |
Methods inherited from interface org.nfunk.jep.function.PostfixMathCommandI |
---|
checkNumberOfParameters, getNumberOfParameters, run, setCurNumberOfParameters |
Method Detail |
---|
Restriction toRestriction(Node node)
Restriction
that can be used
in a query. The implementation must check that the node contains
the correct number of children (ie. arguments to the function)
and convert the arguments to whatever is suitable for the restriction.
Example from the InReporterListFunction
: inList(list-id)
public Restriction toRestriction(Node node) { int numChildren = node.jjtGetNumChildren(); if (numChildren != 1) { throw new BaseException("Invalid number of expressions for 'inList' function: " + numChildren); } int reporterListId = Jep.nodeToInt(node.jjtGetChild(0)); ReporterList list = ReporterList.getById(dc, reporterListId); return Dynamic.isPartOf(list); }
node
- The node representing this function
Restriction
object
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |