org.vladnput
Class ParseErrors

java.lang.Object
  extended by org.vladnput.ParseErrors

public class ParseErrors
extends java.lang.Object

Class for storing errors found during the parsing of a Vlad configuration file.

Author:
Patrick Higgins

Constructor Summary
ParseErrors()
           
 
Method Summary
 void add(java.lang.String msg)
          Add the error message.
 void add(java.lang.Throwable t)
          Add the error message from t.getMessage().
 java.util.Iterator<java.lang.String> getErrors()
          Allows iterating over the errors.
 boolean hasErrors()
          Check if this object has any errors.
 void reportErrors(java.io.PrintStream out)
           
 void reportErrors(java.io.PrintWriter out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseErrors

public ParseErrors()
Method Detail

add

public void add(java.lang.Throwable t)
Add the error message from t.getMessage(). If t is a TokenException or RecognitionException, then source location information will be added automatically. Otherwise, the prefix "error: " will be added to the message.

Parameters:
t - Throwable error

add

public void add(java.lang.String msg)
Add the error message.

Parameters:
msg - Error message

hasErrors

public boolean hasErrors()
Check if this object has any errors.

Returns:
true if there are errors, false otherwise.

getErrors

public java.util.Iterator<java.lang.String> getErrors()
Allows iterating over the errors.

Returns:
An iterator over all the errors.

reportErrors

public void reportErrors(java.io.PrintWriter out)

reportErrors

public void reportErrors(java.io.PrintStream out)


Copyright © 2009 Patrick Higgins. All Rights Reserved.