Modifier and Type | Class and Description |
---|---|
static class |
LoadErrorImpl.CompareLoadErrors
Compares load errors by their locations.
|
LoadError.Type
Modifier and Type | Field and Description |
---|---|
int |
columnNumber
The column number where this error was found.
|
static LoadErrorImpl.CompareLoadErrors |
COMPARE_LOAD_ERRORS
A ready-to-use comparator, comparing two load errors by their
locations.
|
int |
lineNumber
The line number where this error was found.
|
String |
message
The error message.
|
static LoadErrorImpl[] |
NO_ERRORS
An empty array of load errors.
|
Node |
node
The node where this error was found.
|
LoadError.Type |
type
The type of this error.
|
URL |
url
The URL of the file where this error was found.
|
Constructor and Description |
---|
LoadErrorImpl(LoadError.Type type,
Node node,
String message)
Constructs an error found for specified node.
|
LoadErrorImpl(LoadError.Type type,
URL url,
int lineNumber,
int columnNumber,
String message)
Constructs an error found in specified file.
|
Modifier and Type | Method and Description |
---|---|
static String |
format(LoadError error,
boolean isWarning)
Utility function: returns localized message representing all the
information contained in specified load error.
|
static Element |
getElementInError(LoadError error)
Convenience method: unlike
getNodeInError() which returns a
Node, this method always returns an Element. |
int |
getErrorColumnNumber()
Returns the column number where this error was found.
|
int |
getErrorLineNumber()
Returns the line number where this error was found.
|
URL |
getErrorLocation()
Returns the URL of the file where this error was found.
|
String |
getErrorMessage()
Returns the error message.
|
LoadError.Type |
getErrorType()
Returns the type of this error.
|
Node |
getNodeInError()
Returns the node where this error was found.
|
public static final LoadErrorImpl[] NO_ERRORS
public final LoadError.Type type
public final URL url
null
if unknown or not applicable.public final int lineNumber
public final int columnNumber
public final Node node
null
if
unknown or not applicable.public final String message
public static final LoadErrorImpl.CompareLoadErrors COMPARE_LOAD_ERRORS
public LoadErrorImpl(LoadError.Type type, URL url, int lineNumber, int columnNumber, String message)
type
- The type of the error.url
- The URL of the file where this error was found.lineNumber
- The line number where this error was found. Number of
first line is 1. Returns -1 if unknown.columnNumber
- The column number where this error was found.
Number of first column is 1. Returns -1 if unknown.message
- The error message.public LoadErrorImpl(LoadError.Type type, Node node, String message)
type
- The type of the error.node
- The node where the error was found.message
- The error message.public LoadError.Type getErrorType()
LoadError
getErrorType
in interface LoadError
public URL getErrorLocation()
LoadError
null
if unknown or not applicable.getErrorLocation
in interface LoadError
public int getErrorLineNumber()
LoadError
getErrorLineNumber
in interface LoadError
public int getErrorColumnNumber()
LoadError
getErrorColumnNumber
in interface LoadError
public Node getNodeInError()
LoadError
null
if unknown or not applicable.getNodeInError
in interface LoadError
public String getErrorMessage()
LoadError
getErrorMessage
in interface LoadError
public static Element getElementInError(LoadError error)
getNodeInError()
which returns a
Node, this method always returns an Element. For example, it returns
the root element when getNodeInError returns the Document.public static String format(LoadError error, boolean isWarning)
error
- Load error to be formatted.isWarning
- If true
, the load error object is just a
warning; if false
, it is an actual error.