|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.ejb.EJBException
au.gov.tas.dpiwe.mr.bean.ValidateException
public class ValidateException
Validate exception is thrown when a bean fails a validation test.
When a storeWithRelated() method throws this exception, it is customary for the ValidateException to contain the chain of ValidateExceptions (including beans and field names) needed to uniquely specify the field or bean which could not be validated.
| Field Summary | |
|---|---|
protected EntityBean |
bean
The bean for which the validation test failed. |
protected Throwable |
cause
The direct cause of this exception, usually another ValidateException or null. |
static int |
Failure_Architecture
The identifier marking the start of the architecture-defined range. |
static int |
Failure_Client
The identifier marking the start of the client-defined range. |
static int |
Failure_NumberTooBig
The identifier indicating that the number for a field is too large according to the metadata available. |
static int |
Failure_RequiredField
The identifier indicating that a required field (according to the metadata available) was null. |
static int |
Failure_TextTooLong
The identifier indicating that the text for a field is too long according to the metadata available. |
static int |
Failure_TypeMismatch
The identifier indicating that a value could not be parsed according to the required type. |
static int |
Failure_Undefined
The identifier which does not indicate any particular failure. |
protected int |
failureReason
An identifier indicating what validation test failed. |
protected String |
fieldName
The name of field which could not be validated, or null if no specific field was invalid. |
| Constructor Summary | |
|---|---|
ValidateException(EntityBean bean,
int failureReason)
Constructs a new validation exception for an entity bean or bean object. |
|
ValidateException(EntityBean bean,
int failureReason,
String message)
Constructs a new validation exception for an entity bean or bean object. |
|
ValidateException(EntityBean bean,
int failureReason,
String message,
Throwable cause)
Constructs a new validation exception for an entity bean or bean object. |
|
ValidateException(EntityBean bean,
int failureReason,
Throwable cause)
Constructs a new validation exception for an entity bean or bean object. |
|
ValidateException(EntityBean bean,
String fieldName,
int failureReason)
Constructs a new validation exception for an entity bean or bean object where a particular field is the cause of the validation failure. |
|
ValidateException(EntityBean bean,
String fieldName,
int failureReason,
String message)
Constructs a new validation exception for an entity bean or bean object where a particular field is the cause of the validation failure. |
|
ValidateException(EntityBean bean,
String fieldName,
int failureReason,
String message,
Throwable cause)
Constructs a new validation exception for an entity bean or bean object where a particular field is the cause of the validation failure. |
|
ValidateException(EntityBean bean,
String fieldName,
int failureReason,
Throwable cause)
Constructs a new validation exception for an entity bean or bean object where a particular field is the cause of the validation failure. |
|
ValidateException(int failureReason)
Constructs a new validation exception for an object which is not an EJB. |
|
ValidateException(int failureReason,
String message)
Constructs a new validation exceptionfor an object which is not an EJB. |
|
ValidateException(int failureReason,
Throwable cause)
Constructs a new validation exception for an object which is not an EJB. |
|
ValidateException(String fieldName,
int failureReason,
String message)
Constructs a new validation exception for an object which is not an EJB where a particular field is the cause of the validation failure. |
|
ValidateException(String fieldName,
int failureReason,
String message,
Throwable cause)
Constructs a new validation exception for an object which is not an EJB where a particular field is the cause of the validation failure. |
|
ValidateException(String fieldName,
int failureReason,
Throwable cause)
Constructs a new validation exception for an object which is not an EJB where a particular field is the cause of the validation failure. |
|
| Method Summary | |
|---|---|
EJBLocalObject |
getBeanObject(Container container)
Returns a reference to the bean which caused this exception. |
Throwable |
getCause()
Returns the cause of this exception, usually another ValidateException. |
int |
getFailureReason()
Returns an identifier indicating what validation test failed. |
String |
getFieldName()
Returns the name of field which could not be validated. |
Throwable |
initCause(Throwable cause)
Sets the cause of this exception, usually another ValidateException. |
protected static String |
makeMessage(String fieldName,
int failureReason)
Internal method to construct an appropriate message based on a field name and failure reason. |
| Methods inherited from class javax.ejb.EJBException |
|---|
getCausedByException, getMessage, printStackTrace, printStackTrace, printStackTrace |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getLocalizedMessage, getStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String fieldName
protected int failureReason
protected EntityBean bean
protected Throwable cause
public static final int Failure_Architecture
public static final int Failure_Undefined
public static final int Failure_TextTooLong
public static final int Failure_NumberTooBig
public static final int Failure_RequiredField
public static final int Failure_TypeMismatch
public static final int Failure_Client
| Constructor Detail |
|---|
public ValidateException(EntityBean bean,
String fieldName,
int failureReason,
String message,
Throwable cause)
bean - the bean for which a validation test failed.fieldName - the name of field which could not be validated.failureReason - an identifier indicating what validation test failed.message - a message to describe the validation failure.cause - the exception (usually a ValidateException) which caused this validation failure.
public ValidateException(EntityBean bean,
String fieldName,
int failureReason,
String message)
No further exception is chained.
bean - the bean for which a validation test failed.fieldName - the name of field which could not be validated.failureReason - an identifier indicating what validation test failed.message - a message to describe the validation failure.
public ValidateException(EntityBean bean,
String fieldName,
int failureReason,
Throwable cause)
This constructor is commonly used to construct validation failures in beans related to beans which caused validation failures. The message is automatically generated based on the reason code.
bean - the bean for which a validation test failed.fieldName - the name of field which could not be validated.failureReason - an identifier indicating what validation test failed.cause - the exception (usually a ValidateException) which caused this validation failure.
public ValidateException(EntityBean bean,
String fieldName,
int failureReason)
The message is automatically generated based on the reason code, and no further exception is chained.
bean - the bean for which a validation test failed.fieldName - the name of field which could not be validated.failureReason - an identifier indicating what validation test failed.
public ValidateException(EntityBean bean,
int failureReason,
String message,
Throwable cause)
This constructor is used when no particular field of the bean could be identified as the reason for validation failure. It is commonly used to construct validation failures in beans related to beans which caused validation failures.
bean - the bean for which a validation test failed.failureReason - an identifier indicating what validation test failed.message - a message to describe the validation failure.cause - the exception (usually a ValidateException) which caused this validation failure.
public ValidateException(EntityBean bean,
int failureReason,
String message)
This constructor is used when no particular field of the bean could be identified as the reason for validation failure. It is commonly used to construct validation failures in beans related to beans which caused validation failures. No further exception is chained.
bean - the bean for which a validation test failed.failureReason - an identifier indicating what validation test failed.message - a message to describe the validation failure.
public ValidateException(EntityBean bean,
int failureReason,
Throwable cause)
This constructor is used when no particular field of the bean could be identified as the reason for validation failure. It is commonly used to construct validation failures in beans related to beans which caused validation failures. The message is automatically generated based on the reason code.
bean - the bean for which a validation test failed.failureReason - an identifier indicating what validation test failed.cause - the exception (usually a ValidateException) which caused this validation failure.
public ValidateException(EntityBean bean,
int failureReason)
This constructor is used when no particular field of the bean could be identified as the reason for validation failure. The message is automatically generated based on the reason code, and no further exception is chained.
bean - the bean for which a validation test failed.failureReason - an identifier indicating what validation test failed.
public ValidateException(String fieldName,
int failureReason,
String message,
Throwable cause)
fieldName - the name of field which could not be validated.failureReason - an identifier indicating what validation test failed.message - a message to describe the validation failure.cause - the exception (usually a ValidateException) which caused this validation failure.
public ValidateException(String fieldName,
int failureReason,
String message)
No further exception is chained.
fieldName - the name of field which could not be validated.failureReason - an identifier indicating what validation test failed.message - a message to describe the validation failure.
public ValidateException(String fieldName,
int failureReason,
Throwable cause)
The message is automatically generated based on the reason code.
fieldName - the name of field which could not be validated.failureReason - an identifier indicating what validation test failed.message - a message to describe the validation failure.
public ValidateException(int failureReason,
String message)
bean - the bean for which a validation test failed.failureReason - an identifier indicating what validation test failed.message - a message to describe the validation failure.
public ValidateException(int failureReason,
Throwable cause)
The message is automatically generated based on the reason code.
failureReason - an identifier indicating what validation test failed.public ValidateException(int failureReason)
The message is automatically generated based on the reason code, and no further exception is chained.
failureReason - an identifier indicating what validation test failed.| Method Detail |
|---|
public Throwable initCause(Throwable cause)
initCause in class Throwablecause - the cause of this exception, or null if this exception has no cause.public Throwable getCause()
getCause in class Throwable
public EJBLocalObject getBeanObject(Container container)
throws EJBException
container - the container to instatiate the bean with respect to.
EJBException
protected static String makeMessage(String fieldName,
int failureReason)
fieldName - the text to insert into the message as the field name
(where applicable.)failureReason - an identifier indicating what validation test failed.public String getFieldName()
public int getFailureReason()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||