Package com.opencsv.exceptions
Class CsvBeanIntrospectionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.opencsv.exceptions.CsvRuntimeException
com.opencsv.exceptions.CsvBeanIntrospectionException
- All Implemented Interfaces:
Serializable
This exception is to be thrown when anything goes bad during introspection of
beans given to opencsv.
It encapsulates exceptions such as
NoSuchMethodException
,
IllegalAccessException
and
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.- Since:
- 3.9
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNullary constructor.CsvBeanIntrospectionException
(Object bean, Field field) Constructor to specify the bean and field whose manipulation caused this exception.CsvBeanIntrospectionException
(Object bean, Field field, String message) Constructor to provide all information connected to the error raised.CsvBeanIntrospectionException
(String message) Constructor with a human-readable error message. -
Method Summary
Modifier and TypeMethodDescriptiongetBean()
Gets the bean that was to be introspected.getField()
Gets the field from the Reflection API that was involved in the error.Gets a human-readable error message.private String
getMessageFromLocale
(Locale locale) Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
bean
The bean that was acted upon. -
field
The field that was supposed to be manipulated in the bean.
-
-
Constructor Details
-
CsvBeanIntrospectionException
public CsvBeanIntrospectionException()Nullary constructor. -
CsvBeanIntrospectionException
Constructor with a human-readable error message.- Parameters:
message
- Error message
-
CsvBeanIntrospectionException
Constructor to specify the bean and field whose manipulation caused this exception.- Parameters:
bean
- The bean that was to be manipulatedfield
- The field in the bean
-
CsvBeanIntrospectionException
Constructor to provide all information connected to the error raised.- Parameters:
bean
- The bean that was to be manipulatedfield
- The field in the beanmessage
- Error message
-
-
Method Details
-
getMessage
Gets a human-readable error message. -
getLocalizedMessage
- Overrides:
getLocalizedMessage
in classThrowable
-
getMessageFromLocale
-
getBean
Gets the bean that was to be introspected.bean
is markedtransient
, becauseObject
is notSerializable
. If for any reason this exception is serialized and deserialized, this method will subsequently returnnull
.- Returns:
- The bean that caused this exception
-
getField
Gets the field from the Reflection API that was involved in the error.field
is markedtransient
, becauseField
is notSerializable
. If for any reason this exception is serialized and deserialized, this method will subsequently returnnull
.- Returns:
- The field in the bean that caused this exception
-