|
3.0.2: 2012-01-25 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.nfunk.jep.JEP
net.sf.basedb.util.jep.FunctionSafeJep
public class FunctionSafeJep
Extension to the JEP parser that provides better error handling for unknown functions. The normal error message when JEP encounters an unknown function is: Syntax Error (implicit multiplication not enabled). This is not very informative so this class improves the error handling by giving a message: Unknown function foo() instead.
Nested Class Summary | |
---|---|
(package private) static class |
FunctionSafeJep.SafeFunctionTable
Function table implementation that pretends that all possible functions exists, but sends an error message if someone tries to use a function that doesn't really exists. |
(package private) static class |
FunctionSafeJep.UnknownFunction
Represents an unknown function that appears in an expression. |
Field Summary |
---|
Fields inherited from class org.nfunk.jep.JEP |
---|
allowAssignment, allowUndeclared, errorList, ev, funTab, implicitMul, numberFactory, opSet, parser, symTab |
Constructor Summary | |
---|---|
FunctionSafeJep()
Create a new function-safe JEP parser. |
Method Summary | |
---|---|
(package private) void |
addError(String error)
Adds an error message to the "real" JEP parser. |
Object |
getValueAsObject()
Override the superclass method so that exceptions are passed on instead of swallowed. |
void |
initFunTab()
Overrides the regular function lookup table by replacing it with a function table that pretends that all functions has been registered, but then generates an error message if it doesn't exists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FunctionSafeJep()
Method Detail |
---|
public void initFunTab()
initFunTab
in class JEP
void addError(String error)
public Object getValueAsObject()
getValueAsObject
in class JEP
|
3.0.2: 2012-01-25 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |