public class SourceMessages extends SourceLocator.Simple
SourceLocator.Simple| Modifier and Type | Field and Description |
|---|---|
static boolean |
debugStackTraceOnError
If true, print out stack trace with any error.
|
static boolean |
debugStackTraceOnWarning
If true, print out stack trace with any warning.
|
boolean |
sortMessages
True if we should sort messages by line number.
|
boolean |
stripDirectories |
static boolean |
stripDirectoriesDefault |
filename, position| Constructor and Description |
|---|
SourceMessages() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkErrors(java.lang.Appendable out,
int max)
Checks if an error was seen; if so, prints and clears the messages.
|
void |
clear()
Clear the contained errors and warnings.
|
void |
clearErrors()
Clear the error count (only).
|
void |
error(char severity,
SourceLocator location,
java.lang.String message) |
void |
error(char severity,
SourceLocator location,
java.lang.String message,
java.lang.String code) |
void |
error(char severity,
java.lang.String message)
Record a new error at the current default source file location.
|
void |
error(char severity,
java.lang.String filename,
int line,
int column,
java.lang.String message)
Record a new error.
|
void |
error(char severity,
java.lang.String filename,
int line,
int column,
java.lang.String message,
java.lang.String code) |
void |
error(char severity,
java.lang.String message,
java.lang.String code) |
void |
error(char severity,
java.lang.String message,
java.lang.Throwable exception) |
void |
error(SourceError error)
Link in an error.
|
int |
getColumnNumber()
The default column number to use for a new error.
|
int |
getCount(java.lang.String severities)
Get number of diagnostics whose severity is one of the characters in the argument.
|
int |
getEndColumn()
Column (one-origin) of end of range; unknown/unspecified is -1.
|
int |
getEndLine()
Line number (one-origin) of end of range; unknown/unspecified is -1.
|
int |
getErrorCount()
Get the number of errors (not counting warnings).
|
SourceError |
getErrors() |
java.lang.String |
getFileName()
The default filename to use for a new error.
|
int |
getLineNumber()
The default line number to use for a new error.
|
java.lang.String |
getPublicId() |
int |
getStartColumn()
Column (one-origin) of start of range; unknown/unspecified is -1.
|
int |
getStartLine()
Line number (one-origin) of start of range; unknown/unspecified is -1.
|
java.lang.String |
getSystemId() |
boolean |
isStableSourceLocation()
True if position is unlikely to change.
|
void |
printAll(java.lang.Appendable out,
int max)
Print all the error messages to an Appendable.
|
boolean |
seenErrors()
Return true iff errors (not warnings) have been seen.
|
boolean |
seenErrorsOrWarnings() |
void |
setColumn(int column)
Set the default column number to use for a new error.
|
void |
setLocation(SourceLocator locator)
Copies the current position of locator.
|
void |
setSourceLocator(SourceLocator locator)
Links our location to the one give.
|
SourceLocator |
swapSourceLocator(SourceLocator locator) |
java.lang.String |
toString(int max)
Convert this to a String containing the recorded errors.
|
public static boolean stripDirectoriesDefault
public boolean stripDirectories
public static boolean debugStackTraceOnWarning
public static boolean debugStackTraceOnError
public boolean sortMessages
public SourceError getErrors()
public boolean seenErrors()
public boolean seenErrorsOrWarnings()
public int getErrorCount()
public int getCount(java.lang.String severities)
public void clearErrors()
public void clear()
public void error(SourceError error)
public void error(char severity,
java.lang.String filename,
int line,
int column,
java.lang.String message)
severity - is the seriousness of the error
- one of 'w' (for warning), 'e' (for error), or 'f' (for fatal error)filename - the name or URL of the file containing the errorline - the (1-origin) line number or 0 if unknowncolumn - the (1-origin) column number or 0 if unknownmessage - the error messagepublic void error(char severity,
SourceLocator location,
java.lang.String message)
public void error(char severity,
java.lang.String filename,
int line,
int column,
java.lang.String message,
java.lang.String code)
public void error(char severity,
SourceLocator location,
java.lang.String message,
java.lang.String code)
public void error(char severity,
java.lang.String message)
severity - is the seriousness of the error
- one of 'w' (for warning), 'e' (for error), or 'f' (for fatal error)message - the error messagepublic void error(char severity,
java.lang.String message,
java.lang.Throwable exception)
public void error(char severity,
java.lang.String message,
java.lang.String code)
public void printAll(java.lang.Appendable out,
int max)
public java.lang.String toString(int max)
max - the maximum number of error error to listpublic boolean checkErrors(java.lang.Appendable out,
int max)
out - where to write the error message tomax - maximum number of messages to print (can be 0)public final void setSourceLocator(SourceLocator locator)
public final SourceLocator swapSourceLocator(SourceLocator locator)
public final void setLocation(SourceLocator locator)
setLocation in class SourceLocator.Simplepublic java.lang.String getPublicId()
getPublicId in interface javax.xml.transform.SourceLocatorgetPublicId in interface org.xml.sax.LocatorgetPublicId in class SourceLocator.Simplepublic java.lang.String getSystemId()
getSystemId in interface javax.xml.transform.SourceLocatorgetSystemId in interface org.xml.sax.LocatorgetSystemId in class SourceLocator.Simplepublic boolean isStableSourceLocation()
SourceLocatorisStableSourceLocation in class SourceLocator.Simplepublic final java.lang.String getFileName()
getFileName in class SourceLocator.Simplepublic final int getLineNumber()
getLineNumber in interface javax.xml.transform.SourceLocatorgetLineNumber in interface org.xml.sax.LocatorgetLineNumber in class SourceLocator.Simplepublic final int getColumnNumber()
getColumnNumber in interface javax.xml.transform.SourceLocatorgetColumnNumber in interface org.xml.sax.LocatorgetColumnNumber in class SourceLocator.Simplepublic int getStartLine()
SourceLocatorgetStartLine in class SourceLocator.Simplepublic int getStartColumn()
SourceLocatorgetStartColumn in class SourceLocator.Simplepublic int getEndLine()
SourceLocatorgetEndLine in class SourceLocator.Simplepublic int getEndColumn()
SourceLocatorgetEndColumn in class SourceLocator.Simplepublic void setColumn(int column)