|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.lsmp.djep.xjep.DoNothingVisitor
org.lsmp.djep.xjep.ErrorCatchingVisitor
public abstract class ErrorCatchingVisitor
An abstract ParserVisitor which adds some useful error handling facilities. Visitors which require these facilities should extend this class. General format should be
clearErrors();
Object res = (Node) node.jjtAccept(this,data);
if(hasErrors())
throw new ParseException(getErrors());
| Constructor Summary | |
|---|---|
ErrorCatchingVisitor()
|
|
| Method Summary | |
|---|---|
Object |
acceptCatchingErrors(Node node,
Object data)
calls jjtAccept inside a try catch block, adding the error if necessary |
void |
addError(Exception e)
Adds an error message to the list of errors. |
void |
clearErrors()
Reset the list of errors. |
Exception |
getError()
Returns the Exception or null if no error. |
String |
getErrorsMessage()
Returns the error messages. |
boolean |
hasErrors()
Are their any errors? |
| Methods inherited from class org.lsmp.djep.xjep.DoNothingVisitor |
|---|
acceptChildrenAsArray, visit, visit, visit, visit, visit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ErrorCatchingVisitor()
| Method Detail |
|---|
public Object acceptCatchingErrors(Node node,
Object data)
public void clearErrors()
public boolean hasErrors()
public void addError(Exception e)
public String getErrorsMessage()
public Exception getError()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||