|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
de.mguennewig.pobjects.PObjException
de.mguennewig.pobjects.PObjConstraintException
public class PObjConstraintException
Thrown when storing on an object fails (or would fail) because of a
Constraint imposed on the object's data.
Constraint checks may be done based on information from the
ClassDecl, by a Constraint that can be checked in-memory,
or by the database.
PObject.checkConstraints(),
CheckConstraint,
PrimaryKeyConstraint,
Serialized Form| Nested Class Summary | |
|---|---|
static class |
PObjConstraintException.Entry
Helper class holding data on an exception entry. |
| Constructor Summary | |
|---|---|
PObjConstraintException(Record obj)
Create a new exception for object obj. |
|
PObjConstraintException(Record obj,
Column column,
java.lang.String msg)
Create a new exception with details for object obj. |
|
| Method Summary | |
|---|---|
void |
add(Column column,
java.lang.String msg)
Adds a new entry to this exception's list of constraint violations. |
void |
add(Column column,
java.lang.String msg,
Constraint constraint)
Like add(Column,String), but also includes constraint in
question. |
void |
add(PObjConstraintException e)
Adds all entries of the exception e to this instance. |
void |
addAll(Column[] columns,
java.lang.String msg,
Constraint constraint)
Like add(Column,String,Constraint), but for multiple columns,
which all get the same message and constraint. |
java.lang.String |
errorMsgForColumn(Column column)
If the exception contains an error for the column column,
return the error message. |
java.lang.String |
getMessage()
Returns a description text for this exception. |
Record |
getObject()
Returns the object which violates some constraints. |
java.util.Iterator<PObjConstraintException.Entry> |
iterator()
Returns an Iterator over the
PObjConstraintException.Entry's. |
int |
size()
Returns the number of entries in the exception's list. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PObjConstraintException(Record obj)
obj.
public PObjConstraintException(Record obj,
Column column,
java.lang.String msg)
obj.
java.lang.IllegalArgumentException - if no message given.add(Column,String)| Method Detail |
|---|
public final void add(Column column,
java.lang.String msg)
java.lang.IllegalArgumentException - if no message given.PObjConstraintException(Record,Column,String)
public final void add(Column column,
java.lang.String msg,
Constraint constraint)
add(Column,String), but also includes constraint in
question.
java.lang.IllegalArgumentException - if no message given.
public final void addAll(Column[] columns,
java.lang.String msg,
Constraint constraint)
add(Column,String,Constraint), but for multiple columns,
which all get the same message and constraint.
java.lang.IllegalArgumentException - if no message given.public final void add(PObjConstraintException e)
e to this instance.
This method is used to merge different constraint exceptions.
public final Record getObject()
public final java.util.Iterator<PObjConstraintException.Entry> iterator()
Iterator over the
PObjConstraintException.Entry's.
iterator in interface java.lang.Iterable<PObjConstraintException.Entry>public final int size()
If the result is zero, then there aren't any complaints and the exception can be discarded.
public final java.lang.String errorMsgForColumn(Column column)
column,
return the error message. If there is no matching entry, result is
null.
public java.lang.String getMessage()
getMessage in class java.lang.ThrowableThrowable.getMessage()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||