|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Auditor
is a "global" repository for errors and
warnings; a listener for complaints. If a translation
component discovers an error or wishes to report a warning, it may
do so through one of the notify()
methods in this
interface. The use of the word "audit" here specifically refers to
one that hears or listens; it's not related to taxation
:)
Method Summary | |
int |
complaints()
Returns the current number of complaints ( errors() +
warnings() ). |
int |
errors()
Returns the current number of errors. |
List |
getErrors()
Returns an unmodifiable list of errors, where each member in the List is an Complaint . |
Properties |
getProperties()
Gets the Properties instance. |
String |
getSource()
Gets the name of the input source. |
List |
getWarnings()
Returns an unmodifiable list of warnings, where each member in the List is an Complaint . |
boolean |
hasErrors()
Returns true if there is at least one error,
false otherwise. |
boolean |
hasWarnings()
Returns true if there is at least one warning,
false otherwise. |
boolean |
isEmpty()
Returns true if there are no errors or warnings,
false if there is at least one error or at least
one warning. |
Complaint |
notify(Complaint complaint)
Adds the given Complaint to the end of the the
internal List of complaints and returns the same
object to the caller. |
Complaint |
notify(int type,
int line,
String msg)
Creates a new Complaint of the given type having
the given message and given line number. |
Complaint |
notify(int type,
String msg)
Creates a new Complaint of the given type having
the given message. |
Complaint |
notify(int type,
String msg,
Input in,
int offset,
int length)
Creates a new Complaint of the given type having
the given message at the given Input offset with
the given length. |
void |
setProperties(Properties p)
Sets the Properties instance. |
void |
setSource(String src)
Sets the name of the input source. |
int |
warnings()
Returns the current number of warnings. |
Method Detail |
public String getSource()
public void setSource(String src)
public Properties getProperties()
Properties
instance.public void setProperties(Properties p)
Properties
instance.public boolean isEmpty()
true
if there are no errors or warnings,
false
if there is at least one error or at least
one warning.public int complaints()
errors() +
warnings()
).public int errors()
public int warnings()
public boolean hasErrors()
true
if there is at least one error,
false
otherwise.public boolean hasWarnings()
true
if there is at least one warning,
false
otherwise.public List getErrors()
List
is an Complaint
.public List getWarnings()
List
is an Complaint
.public Complaint notify(Complaint complaint)
Complaint
to the end of the the
internal List
of complaints and returns the same
object to the caller.public Complaint notify(int type, int line, String msg)
Complaint
of the given type having
the given message and given line number. The
Complaint
is appended to the internal
List
of complaints and also returned to the
caller.public Complaint notify(int type, String msg)
Complaint
of the given type having
the given message. The Complaint
is appended to
the internal List
of complaints and also returned
to the caller.public Complaint notify(int type, String msg, Input in, int offset, int length)
Complaint
of the given type having
the given message at the given Input
offset with
the given length. The Complaint
is appended to
the internal List
of complaints and also returned
to the caller. This method is generally used for syntactic
errors.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |