org.jdom.contrib.schema
Class ValidationError

java.lang.Object
  extended by org.jdom.contrib.schema.ValidationError

public class ValidationError
extends java.lang.Object

A ValidationError object encapsulates a schema validation error or warning.

Author:
Laurent Bihanic

Nested Class Summary
static class ValidationError.Severity
          Class to support type-safe enumeration design pattern to represent severity levels of validation errors.
 
Field Summary
static ValidationError.Severity ERROR
          The severity for recoverable validation errors.
static ValidationError.Severity FATAL
          The severity for non-recoverable validation errors.
static ValidationError.Severity WARNING
          The severity for warnings.
 
Constructor Summary
ValidationError(ValidationError.Severity severity, java.lang.String message)
          Creates a new validation error.
ValidationError(ValidationError.Severity severity, java.lang.String message, java.lang.Object node)
          Creates a new validation error.
 
Method Summary
 java.lang.String getMessage()
          Returns the detailed error message.
 java.lang.Object getNode()
          Returns the JDOM node that caused the error.
 ValidationError.Severity getSeverity()
          Returns the severity of this error.
 java.lang.String toString()
          Returns a string representation of this error suitable for debugging and diagnosis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WARNING

public static final ValidationError.Severity WARNING
The severity for warnings.


ERROR

public static final ValidationError.Severity ERROR
The severity for recoverable validation errors.


FATAL

public static final ValidationError.Severity FATAL
The severity for non-recoverable validation errors.

Constructor Detail

ValidationError

public ValidationError(ValidationError.Severity severity,
                       java.lang.String message)
Creates a new validation error.

Parameters:
severity - the error severity.
message - the detailed error message.

ValidationError

public ValidationError(ValidationError.Severity severity,
                       java.lang.String message,
                       java.lang.Object node)
Creates a new validation error.

Parameters:
severity - the error severity.
message - the detailed error message.
node - the JDOM node that caused the error.
Method Detail

getSeverity

public ValidationError.Severity getSeverity()
Returns the severity of this error.

Returns:
the severity of this error.

getMessage

public java.lang.String getMessage()
Returns the detailed error message.

Returns:
the detailed error message.

getNode

public java.lang.Object getNode()
Returns the JDOM node that caused the error.

Returns:
the JDOM node that caused the error.

toString

public java.lang.String toString()
Returns a string representation of this error suitable for debugging and diagnosis.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this error.
See Also:
Object.toString()


Copyright © 2007 Jason Hunter, Brett McLaughlin. All Rights Reserved.