org.springframework.beans
public class: PropertyAccessExceptionsException [javadoc |
source]
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.beans.BeansException
org.springframework.beans.PropertyAccessExceptionsException
All Implemented Interfaces:
Serializable
Combined exception, composed of individual binding propertyAccessExceptions.
An object of this class is created at the beginning of the binding
process, and errors added to it as necessary.
The binding process continues when it encounters application-level
propertyAccessExceptions, applying those changes that can be applied and storing
rejected changes in an object of this class.
- author:
Rod - Johnson
- author:
Juergen - Hoeller
- since:
18 - April 2001
| Constructor: |
public PropertyAccessExceptionsException(BeanWrapper beanWrapper,
PropertyAccessException[] propertyAccessExceptions) {
super("");
this.beanWrapper = beanWrapper;
this.propertyAccessExceptions = propertyAccessExceptions;
}
Create a new PropertyAccessExceptionsException. Parameters:
beanWrapper - the BeanWrapper that wraps the target object
propertyAccessExceptions - the List of PropertyAccessExceptions
|
| Methods from org.springframework.beans.BeansException: |
|---|
|
equals, hashCode |
| Methods from java.lang.Throwable: |
|---|
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Method from org.springframework.beans.PropertyAccessExceptionsException Detail: |
public BeanWrapper getBeanWrapper() {
return beanWrapper;
}
Return the BeanWrapper that generated this exception. |
public Object getBindObject() {
return this.beanWrapper.getWrappedInstance();
}
Return the object we're binding to. |
public int getExceptionCount() {
return this.propertyAccessExceptions.length;
}
If this returns 0, no errors were encountered during binding. |
public String getMessage() {
StringBuffer sb = new StringBuffer();
sb.append(this.toString());
sb.append("; nested propertyAccessExceptions are: ");
for (int i = 0; i < this.propertyAccessExceptions.length; i++) {
PropertyAccessException pae = this.propertyAccessExceptions[i];
sb.append("[");
sb.append(pae.getClass().getName());
sb.append(": ");
sb.append(pae.getMessage());
sb.append(']");
if (i < this.propertyAccessExceptions.length - 1) {
sb.append(", ");
}
}
return sb.toString();
}
|
public PropertyAccessException getPropertyAccessException(String propertyName) {
for (int i = 0; i < this.propertyAccessExceptions.length; i++) {
PropertyAccessException pae = this.propertyAccessExceptions[i];
if (propertyName.equals(pae.getPropertyChangeEvent().getPropertyName())) {
return pae;
}
}
return null;
}
Return the exception for this field, or null if there isn't one. |
public PropertyAccessException[] getPropertyAccessExceptions() {
return this.propertyAccessExceptions;
}
Return an array of the propertyAccessExceptions stored in this object.
Will return the empty array (not null) if there were no errors. |
public void printStackTrace(PrintStream ps) {
ps.println(this);
for (int i = 0; i < this.propertyAccessExceptions.length; i++) {
PropertyAccessException pae = this.propertyAccessExceptions[i];
pae.printStackTrace(ps);
}
}
|
public void printStackTrace(PrintWriter pw) {
pw.println(this);
for (int i = 0; i < this.propertyAccessExceptions.length; i++) {
PropertyAccessException pae = this.propertyAccessExceptions[i];
pae.printStackTrace(pw);
}
}
|
public String toString() {
return "PropertyAccessExceptionsException (" + getExceptionCount() + " errors)";
}
|