Methods Summary |
---|
public void | error(javax.xml.transform.TransformerException te)This is part of the javax.xml.transform.ErrorListener interface.
Indicates that a recoverable error occurred.
report(te);
|
public void | fatalError(javax.xml.transform.TransformerException te)This is part of the javax.xml.transform.ErrorListener interface.
Indicates that a non-recoverable error occurred.
report(te);
|
public int | getColumnCount()Part of the TableModel interface.
return (this.exceptionList == null) ? 1 :
COLUMN_NAMES.length;
|
public java.lang.String | getColumnName(int column)Part of the TableModel interface.
return (this.exceptionList == null)
? "Transformation Problems"
: COLUMN_NAMES[column];
|
public java.lang.String | getDetailReport(int row)
if (this.exceptionList == null
|| row < 0 || row >= this.exceptionList.size()) {
return "";
}
TransformerException te = (TransformerException)
this.exceptionList.get(row);
SourceLocator loc = te.getLocator(); // may be null
// buffer the report
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
pw.println(te.getClass().getName());
pw.println("-----------------------------------------------------");
if (loc == null) {
pw.println("Line Number : [null SourceLocator]");
pw.println("Column Number: [null SourceLocator]");
pw.println("Public ID : [null SourceLocator]");
pw.println("System ID : [null SourceLocator]");
} else {
pw.println("Line Number : " + loc.getLineNumber());
pw.println("Column Number: " + loc.getColumnNumber());
pw.println("Public ID : " + loc.getPublicId());
pw.println("System ID : " + loc.getSystemId());
}
pw.println("Message & Location : " + te.getMessageAndLocation());
pw.println("Location : " + te.getLocationAsString());
pw.println("Exception : " + te.getException());
if (te.getException() != null) {
te.getException().printStackTrace(pw);
}
pw.println("Cause : " + te.getCause());
if (te.getCause() != null && (te.getCause() != te.getException())) {
te.getCause().printStackTrace(pw);
}
return sw.toString();
|
public int | getRowCount()Part of the TableModel interface.
return (this.exceptionList == null) ? 1 :
this.exceptionList.size();
|
public java.lang.Object | getValueAt(int row, int column)Part of the TableModel interface.
if (this.exceptionList == null) {
return "No errors or warnings";
} else {
TransformerException te = (TransformerException)
this.exceptionList.get(row);
SourceLocator loc = te.getLocator();
switch (column) {
case LINE_COL:
return (loc != null)
? String.valueOf(loc.getLineNumber()) : "N/A";
case COLUMN_COL:
return (loc != null)
? String.valueOf(loc.getColumnNumber()) : "N/A";
case PUBLIC_ID_COL:
return (loc != null) ? loc.getPublicId() : "N/A";
case SYSTEM_ID_COL:
return (loc != null) ? loc.getSystemId() : "N/A";
case MESSAGE_AND_LOC_COL:
return te.getMessageAndLocation();
case LOCATION_COL:
return te.getLocationAsString();
case EXCEPTION_COL:
return te.getException();
case CAUSE_COL:
return te.getCause();
default:
return "[error]"; // shouldn't happen
}
}
|
public boolean | hasErrors()
return this.exceptionList != null;
|
private void | report(javax.xml.transform.TransformerException te)
if (this.exceptionList == null) {
this.exceptionList = new ArrayList();
this.exceptionList.add(te);
fireTableStructureChanged();
} else {
this.exceptionList.add(te);
int row = this.exceptionList.size()-1;
super.fireTableRowsInserted(row, row);
}
|
public void | warning(javax.xml.transform.TransformerException te)This is part of the javax.xml.transform.ErrorListener interface.
Indicates that a warning occurred. Transformers are required to
continue processing after warnings, unless the error listener
throws TransformerException.
report(te);
|