public class ValidationError extends Object
| Constructor and Description |
|---|
ValidationError(ErrorSeverity severity,
String message,
int lineNum,
int columnNum,
String pointer)
Constructs an immutable validation error object from SAX or DOM error
information.
|
ValidationError(ErrorSeverity severity,
String message,
String diagnostics,
ErrorLocator locator)
Constructs an immutable validation error.
|
ValidationError(ErrorSeverity severity,
String message,
String diagnostics,
int lineNum,
int columnNum,
String pointer)
Constructs an immutable validation error object from SAX or DOM error
information.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getColumnNumber()
Returns the column number where the error is located.
|
String |
getDiagnostics()
Returns additional diagnostic information about this error.
|
int |
getLineNumber()
Returns the line number where the error is located.
|
String |
getMessage()
Returns the message describing this error.
|
String |
getPointer()
Returns a fragment identifier that identifies the invalid part of some
resource representation.
|
ErrorSeverity |
getSeverity()
Returns the severity of this error.
|
String |
toString()
Returns information about the error.
|
String |
toXml()
Returns an XML representation of the validation error.
|
public ValidationError(ErrorSeverity severity, String message, int lineNum, int columnNum, String pointer)
severity - The severity level (WARNING, ERROR, CRITICAL).message - A brief description of the error.lineNum - The line number where the error occurs (-1 if unknown).columnNum - The column number where the error occurs (-1 if unknown).pointer - A fragment identifier (pointer) that locates the error in the
invalid representation.public ValidationError(ErrorSeverity severity, String message, String diagnostics, int lineNum, int columnNum, String pointer)
severity - The severity level (WARNING, ERROR, CRITICAL).message - A brief description of the error.diagnostics - Supplementary diagnostic information about the error.lineNum - The line number where the error occurs (-1 if unknown).columnNum - The column number where the error occurs (-1 if unknown).pointer - A fragment identifier (pointer) that locates the error in the
invalid representation.public ValidationError(ErrorSeverity severity, String message, String diagnostics, ErrorLocator locator)
severity - The severity level (WARNING, ERROR, CRITICAL).message - A brief description of the error.diagnostics - Supplementary diagnostic information about the error.locator - Provides information about the location of the error.public String getMessage()
public String getDiagnostics()
public ErrorSeverity getSeverity()
public int getLineNumber()
public int getColumnNumber()
public String getPointer()
public String toXml()
Returns an XML representation of the validation error. The structure is as shown in the example below:
<error>
<severity>ERROR</severity>
<message>Error details</message>
<diagnosticInfo>Error details</diagnosticInfo>
<location>
<lineNumber>5</lineNumber>
<columnNumber>4</columnNumber>
<pointer>xmlns(tns=http://www.example.org)xpointer(//tns:foo[1])
</pointer>
</location>
</error>
Copyright © 2016 Open Geospatial Consortium. All rights reserved.