Search in sources :

Example 6 with DfBeanIllegalPropertyException

use of org.dbflute.helper.beans.exception.DfBeanIllegalPropertyException in project dbflute-core by dbflute.

the class DfPropertyDescImpl method throwPropertyReadFailureException.

protected void throwPropertyReadFailureException(Object target, RuntimeException e) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("Failed to read the property.");
    setupExceptionBasicInfo(br);
    br.addItem("Target Object");
    br.addElement(target != null ? target.getClass() : null);
    br.addElement(target);
    final String msg = br.buildExceptionMessage();
    throw new DfBeanIllegalPropertyException(msg, e);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfBeanIllegalPropertyException(org.dbflute.helper.beans.exception.DfBeanIllegalPropertyException)

Example 7 with DfBeanIllegalPropertyException

use of org.dbflute.helper.beans.exception.DfBeanIllegalPropertyException in project dbflute-core by dbflute.

the class DfPropertyDescImpl method throwPropertyWriteFailureException.

protected void throwPropertyWriteFailureException(Object target, Object value, RuntimeException e) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("Failed to write the property.");
    setupExceptionBasicInfo(br);
    br.addItem("Target Object");
    br.addElement(target != null ? target.getClass() : null);
    br.addElement(target);
    br.addItem("Wrote Object");
    br.addElement(value != null ? value.getClass() : null);
    br.addElement(value);
    final String msg = br.buildExceptionMessage();
    throw new DfBeanIllegalPropertyException(msg, e);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfBeanIllegalPropertyException(org.dbflute.helper.beans.exception.DfBeanIllegalPropertyException)

Aggregations

DfBeanIllegalPropertyException (org.dbflute.helper.beans.exception.DfBeanIllegalPropertyException)7 ExceptionMessageBuilder (org.dbflute.helper.message.ExceptionMessageBuilder)4 DfBeanDesc (org.dbflute.helper.beans.DfBeanDesc)3 DfPropertyDesc (org.dbflute.helper.beans.DfPropertyDesc)3 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 DfBeanMethodNotFoundException (org.dbflute.helper.beans.exception.DfBeanMethodNotFoundException)1 IfCommentListIndexOutOfBoundsException (org.dbflute.twowaysql.exception.IfCommentListIndexOutOfBoundsException)1 MapParameterBean (org.dbflute.twowaysql.pmbean.MapParameterBean)1 ReflectionFailureException (org.dbflute.util.DfReflectionUtil.ReflectionFailureException)1