Top Description Fields Constructors Methods
com.opencsv.exceptions

public Class CsvBeanIntrospectionException

extends CsvRuntimeException
Class Inheritance
Imports
com.opencsv.ICSVParser, java.lang.reflect.Field, java.util.Locale, .ResourceBundle

This exception is to be thrown when anything goes bad during introspection of beans given to opencsv. It encapsulates exceptions such as java.lang.NoSuchMethodException, java.lang.IllegalAccessException and java.lang.reflect.InvocationTargetException. Some might notice that this effectively converts checked exceptions into unchecked exceptions. Introspection exceptions are coding errors that should be fixed during development, and should not have to be handled in production code.
Author
Andrew Rucker Jones
Since
3.9

Field Summary

Modifier and TypeField and Description
private final transient Object
bean

The bean that was acted upon.

private final transient Field
field

The field that was supposed to be manipulated in the bean.

private static final long

Constructor Summary

AccessConstructor and Description
public
CsvBeanIntrospectionException()

Nullary constructor.

public
CsvBeanIntrospectionException(String
Error message
message
)

Constructor with a human-readable error message.

public
CsvBeanIntrospectionException(Object
The bean that was to be manipulated
bean
,
Field
The field in the bean
field
)

Constructor to specify the bean and field whose manipulation caused this exception.

public
CsvBeanIntrospectionException(Object
The bean that was to be manipulated
bean
,
Field
The field in the bean
field
,
String
Error message
message
)

Constructor to provide all information connected to the error raised.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

The bean that caused this exception
getBean
()

Gets the bean that was to be introspected.

public Field

Returns:

The field in the bean that caused this exception
getField
()

Gets the field from the Reflection API that was involved in the error.

public String
getLocalizedMessage()

Overrides java.lang.Throwable.getLocalizedMessage.

Creates a localized description of this throwable.

public String

Returns:

The error message, or if none is found, but bean and field have been set, returns a default error message incorporating the names of bean and field
getMessage
()

Overrides java.lang.Throwable.getMessage.

Gets a human-readable error message.

private String

Field Detail

beanback to summary
private final transient Object bean

The bean that was acted upon.

fieldback to summary
private final transient Field field

The field that was supposed to be manipulated in the bean.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.opencsv.exceptions.CsvRuntimeException.serialVersionUID.

Constructor Detail

CsvBeanIntrospectionExceptionback to summary
public CsvBeanIntrospectionException()

Nullary constructor.

CsvBeanIntrospectionExceptionback to summary
public CsvBeanIntrospectionException(String message)

Constructor with a human-readable error message.

Parameters
message:String

Error message

CsvBeanIntrospectionExceptionback to summary
public CsvBeanIntrospectionException(Object bean, Field field)

Constructor to specify the bean and field whose manipulation caused this exception.

Parameters
bean:Object

The bean that was to be manipulated

field:Field

The field in the bean

CsvBeanIntrospectionExceptionback to summary
public CsvBeanIntrospectionException(Object bean, Field field, String message)

Constructor to provide all information connected to the error raised.

Parameters
bean:Object

The bean that was to be manipulated

field:Field

The field in the bean

message:String

Error message

Method Detail

getBeanback to summary
public Object getBean()

Gets the bean that was to be introspected. bean is marked transient, because java.lang.Object is not java.io.Serializable. If for any reason this exception is serialized and deserialized, this method will subsequently return null.

Returns:Object

The bean that caused this exception

getFieldback to summary
public Field getField()

Gets the field from the Reflection API that was involved in the error. field is marked transient, because java.lang.reflect.Field is not java.io.Serializable. If for any reason this exception is serialized and deserialized, this method will subsequently return null.

Returns:Field

The field in the bean that caused this exception

getLocalizedMessageback to summary
public String getLocalizedMessage()

Overrides java.lang.Throwable.getLocalizedMessage.

Doc from java.lang.Throwable.getLocalizedMessage.

Creates a localized description of this throwable. Subclasses may override this method in order to produce a locale-specific message. For subclasses that do not override this method, the default implementation returns the same result as getMessage().

Annotations
@Override
getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

Gets a human-readable error message.

Returns:String

The error message, or if none is found, but bean and field have been set, returns a default error message incorporating the names of bean and field

Annotations
@Override
getMessageFromLocaleback to summary
private String getMessageFromLocale(Locale locale)