Combined exception, composed of individual PropertyAccessException instances.
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.
| Method from org.springframework.beans.PropertyBatchUpdateException Detail: |
public boolean contains(Class exType) {
if (exType == null) {
return false;
}
if (exType.isInstance(this)) {
return true;
}
for (int i = 0; i < this.propertyAccessExceptions.length; i++) {
PropertyAccessException pae = this.propertyAccessExceptions[i];
if (pae.contains(exType)) {
return true;
}
}
return false;
}
|
public final int getExceptionCount() {
return this.propertyAccessExceptions.length;
}
If this returns 0, no errors were encountered during binding. |
public String getMessage() {
StringBuffer sb = new StringBuffer("Failed properties: ");
for (int i = 0; i < this.propertyAccessExceptions.length; i++) {
sb.append(this.propertyAccessExceptions[i].getMessage());
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 final 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) {
synchronized (ps) {
ps.println(getClass().getName() + "; nested PropertyAccessException details (" +
getExceptionCount() + ") are:");
for (int i = 0; i < this.propertyAccessExceptions.length; i++) {
ps.println("PropertyAccessException " + (i + 1) + ":");
this.propertyAccessExceptions[i].printStackTrace(ps);
}
}
}
|
public void printStackTrace(PrintWriter pw) {
synchronized (pw) {
pw.println(getClass().getName() + "; nested PropertyAccessException details (" +
getExceptionCount() + ") are:");
for (int i = 0; i < this.propertyAccessExceptions.length; i++) {
pw.println("PropertyAccessException " + (i + 1) + ":");
this.propertyAccessExceptions[i].printStackTrace(pw);
}
}
}
|
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(getClass().getName()).append("; nested PropertyAccessExceptions (");
sb.append(getExceptionCount()).append(") are:");
for (int i = 0; i < this.propertyAccessExceptions.length; i++) {
sb.append('\n").append("PropertyAccessException ").append(i + 1).append(": ");
sb.append(this.propertyAccessExceptions[i]);
}
return sb.toString();
}
|