org.oddjob.arooa.reflect
Class PropertyExceptionBuilder

java.lang.Object
  extended by org.oddjob.arooa.reflect.PropertyExceptionBuilder

public class PropertyExceptionBuilder
extends Object

Provide a more flexible way of building a ArooaPropertyException.

Author:
rob

Constructor Summary
PropertyExceptionBuilder()
           
 
Method Summary
 PropertyExceptionBuilder causedBy(Exception cause)
          Add the exception that is the cause.
 ArooaNoPropertyException failedReadingPropertyException(String property)
          Provide an ArooaNoPropertyException for when failing to read a property.
 ArooaNoPropertyException failedWritingPropertyException(String property)
          Provide an ArooaNoPropertyException for when failing to write a property.
 PropertyExceptionBuilder forBean(Object bean)
          Add a bean to the exception message.
 PropertyExceptionBuilder forClass(Class<?> theClass)
          Add a class to the exception message.
protected  String getBeanAndClassMessageSection()
          Helper method to get the bean and class part of the message.
 ArooaNoPropertyException noPropertyException(String property)
          Provide an ArooaNoPropertyException for when there is no property either readable or writable.
 PropertyExceptionBuilder withOverview(BeanOverview overview)
          Provide an BeanOverview of the bean causing the problem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyExceptionBuilder

public PropertyExceptionBuilder()
Method Detail

forClass

public PropertyExceptionBuilder forClass(Class<?> theClass)
Add a class to the exception message.

Parameters:
theClass -
Returns:
This.

forBean

public PropertyExceptionBuilder forBean(Object bean)
Add a bean to the exception message.

Parameters:
bean -
Returns:
This.

withOverview

public PropertyExceptionBuilder withOverview(BeanOverview overview)
Provide an BeanOverview of the bean causing the problem.

Parameters:
overview -
Returns:
This.

causedBy

public PropertyExceptionBuilder causedBy(Exception cause)
Add the exception that is the cause.

Parameters:
cause -
Returns:
This.

failedReadingPropertyException

public ArooaNoPropertyException failedReadingPropertyException(String property)
Provide an ArooaNoPropertyException for when failing to read a property.

Parameters:
property -
Returns:
The exception.

failedWritingPropertyException

public ArooaNoPropertyException failedWritingPropertyException(String property)
Provide an ArooaNoPropertyException for when failing to write a property.

Parameters:
property -
Returns:
The exception.

noPropertyException

public ArooaNoPropertyException noPropertyException(String property)
Provide an ArooaNoPropertyException for when there is no property either readable or writable.

Parameters:
property -
Returns:

getBeanAndClassMessageSection

protected String getBeanAndClassMessageSection()
Helper method to get the bean and class part of the message.

Returns: