org.apache.jdo.model
Class ModelValidationException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.apache.jdo.model.ModelException
              extended byorg.apache.jdo.model.ModelValidationException
All Implemented Interfaces:
java.io.Serializable

public class ModelValidationException
extends ModelException

This exception indicates a problem during model validation.

Since:
JDO 1.0.1
Author:
Michael Bouschen
See Also:
Serialized Form

Field Summary
static int ERROR
          Constant representing an error.
private static I18NHelper msg
          I18N support
private  java.lang.Object offendingObject
          This field holds the offending object -- the one being validated when the problem occurred
private  int type
          This field holds the type -- one of ERROR or WARNING
static int WARNING
          Constant representing a warning.
 
Fields inherited from class org.apache.jdo.model.ModelException
 
Fields inherited from class java.lang.Exception
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
ModelValidationException()
          Creates new ModelValidationException of type ERROR with null as the offending object and no detail message.
ModelValidationException(int errorType, java.lang.Object offendingObject, java.lang.String message)
          Constructs a ModelValidationException of the specified type with the specified detail message and offending object.
ModelValidationException(java.lang.Object offendingObject)
          Constructs a ModelValidationException of type ERROR with the specified offending object and no detail message.
ModelValidationException(java.lang.Object offendingObject, java.lang.String message)
          Constructs a ModelValidationException of type ERROR with the specified offending object and detail message .
ModelValidationException(java.lang.String message)
          Constructs a ModelValidationException of type ERROR with null as the offending object and with the specified detail message.
 
Method Summary
 java.lang.String getMessage()
          Returns the error message string of this throwable object.
 java.lang.Object getOffendingObject()
          Get the offending object -- the one being validated when the problem occurred.
 int getType()
          Get the type -- one of ERROR or WARNING.
 java.lang.String toString()
          The String representation includes the name of the class, the descriptive comment (if any), and the String representation of the cause (if any).
 
Methods inherited from class org.apache.jdo.model.ModelException
getCause, initCause, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR

public static final int ERROR
Constant representing an error.

See Also:
Constant Field Values

WARNING

public static final int WARNING
Constant representing a warning.

See Also:
Constant Field Values

type

private int type
This field holds the type -- one of ERROR or WARNING


offendingObject

private java.lang.Object offendingObject
This field holds the offending object -- the one being validated when the problem occurred


msg

private static I18NHelper msg
I18N support

Constructor Detail

ModelValidationException

public ModelValidationException()
Creates new ModelValidationException of type ERROR with null as the offending object and no detail message.


ModelValidationException

public ModelValidationException(java.lang.String message)
Constructs a ModelValidationException of type ERROR with null as the offending object and with the specified detail message.

Parameters:
message - the detail message.

ModelValidationException

public ModelValidationException(java.lang.Object offendingObject)
Constructs a ModelValidationException of type ERROR with the specified offending object and no detail message.

Parameters:
offendingObject - the offending object.

ModelValidationException

public ModelValidationException(java.lang.Object offendingObject,
                                java.lang.String message)
Constructs a ModelValidationException of type ERROR with the specified offending object and detail message .

Parameters:
offendingObject - the offending object.
message - the detail message.

ModelValidationException

public ModelValidationException(int errorType,
                                java.lang.Object offendingObject,
                                java.lang.String message)
Constructs a ModelValidationException of the specified type with the specified detail message and offending object.

Parameters:
errorType - the type -- one of ERROR or WARNING.
offendingObject - the offending object.
message - the detail message.
Method Detail

getOffendingObject

public java.lang.Object getOffendingObject()
Get the offending object -- the one being validated when the problem occurred.


getType

public int getType()
Get the type -- one of ERROR or WARNING.


getMessage

public java.lang.String getMessage()
Returns the error message string of this throwable object.

Overrides:
getMessage in class ModelException
Returns:
the error message string of this ModelValidationException, prepended with the warning string if the type is WARNING

toString

public java.lang.String toString()
The String representation includes the name of the class, the descriptive comment (if any), and the String representation of the cause (if any).

Overrides:
toString in class ModelException
Returns:
the String.