FileDocCategorySizeDatePackage
ModelValidationException.javaAPI DocGlassfish v2 API5568Fri May 04 22:34:44 BST 2007com.sun.jdo.api.persistence.model.util

ModelValidationException

public class ModelValidationException extends com.sun.jdo.api.persistence.model.ModelException
author
raccah
version
%I%

Fields Summary
public static final int
ERROR
Constant representing an error.
public static final int
WARNING
Constant representing a warning.
private static final ResourceBundle
_messages
I18N message handler
private int
_type
This field holds the type -- one of {@link #ERROR} or {@link #WARNING}
private Object
_offendingObject
This field holds the offending object -- the one being validated when the problem occurred
Constructors Summary
public ModelValidationException()
Creates new ModelValidationException of type {@link #ERROR} without a detail message and with null as the offending object.

	
public ModelValidationException(String msg)
Constructs a ModelValidationException of type {@link #ERROR} with the specified detail message and null as the offending object.

param
msg the detail message.

		super(msg);
	
public ModelValidationException(Object offendingObject)
Constructs a ModelValidationException of type {@link #ERROR} with the specified offending object and no detail message.

param
offendingObject the offending object.

		super();
		_offendingObject = offendingObject;
	
public ModelValidationException(Object offendingObject, String msg)
Constructs a ModelValidationException of type {@link #ERROR} with the specified detail message and offending object.

param
offendingObject the offending object.
param
msg the detail message.

		this(ERROR, offendingObject, msg);
	
public ModelValidationException(int errorType, Object offendingObject, String msg)
Constructs a ModelValidationException of the specified type with the specified detail message and offending object.

param
errorType the type -- one of {@link #ERROR} or {@link #WARNING}.
param
offendingObject the offending object.
param
msg the detail message.

		super(msg);
		_type = errorType;
		_offendingObject = offendingObject;
	
Methods Summary
public java.lang.StringgetMessage()
Returns the error message string of this throwable object.

return
the error message string of this ModelValidationException, prepended with the warning string if the type is {@link #WARNING}

		String message = super.getMessage();

		if ((WARNING == getType()) && !StringHelper.isEmpty(message))
		{
			message	= I18NHelper.getMessage(getMessages(), 
				"util.validation.warning") + message;			//NOI18N
		}

		return message;
	
protected static final java.util.ResourceBundlegetMessages()

return
I18N message handler for this element


	       	 
	     
	
		return _messages;
	
public java.lang.ObjectgetOffendingObject()
Get the offending object -- the one being validated when the problem occurred.

 return _offendingObject; 
public intgetType()
Get the type -- one of {@link #ERROR} or {@link #WARNING}.

 return _type;