public interface DefaultAdapterOption
Modifier and Type | Method and Description |
---|---|
ExceptionStrategy |
getFieldGetExceptionStrategy()
Get the strategy to use when a field value can not be read and throw an
IllegalAccessException . |
ExceptionStrategy |
getReaderExceptionStrategy()
Get the strategy to use when a
RuntimeException occur while reading a field value. |
ExceptionStrategy |
getWriterExceptionStrategy()
Get the strategy to use when a
RuntimeException occur while writing a field value. |
boolean |
isSkippingNull()
Get if the default object adapter write entries containing null as value
|
void |
setFieldGetExceptionStrategy(ExceptionStrategy strategy)
Set the strategy to use when a field value can not be read and throw an
IllegalAccessException . |
void |
setReaderExceptionStrategy(ExceptionStrategy strategy)
Set the strategy to use when a
RuntimeException occur while reading a field value. |
void |
setSkippingNull(boolean skipNull)
Set if the default object adapter write entries containing null as value
|
void |
setWriterExceptionStrategy(ExceptionStrategy strategy)
Set the strategy to use when a
RuntimeException occur while writing a field value. |
ExceptionStrategy getFieldGetExceptionStrategy()
Get the strategy to use when a field value can not be read and throw an IllegalAccessException
.
Can appear when writing the object or when reading a field with readTo parameter.
By default, the strategy is to forward the exception.
void setFieldGetExceptionStrategy(ExceptionStrategy strategy)
Set the strategy to use when a field value can not be read and throw an IllegalAccessException
.
Can appear when writing the object or when reading a field with readTo parameter.
By default, the strategy is to forward the exception.
strategy
- the exception strategyExceptionStrategy getReaderExceptionStrategy()
Get the strategy to use when a RuntimeException
occur while reading a field value. The cause can be:
-OdinFormatException
if the the odn format contains an error or an object is read with the wrong type. -OdinTypeException
if an error occur when Odin build the fields type. -OdinAdapterException
if the error has already been forwarded by a field adapter. -Any otherRuntimeException
if the error come from a registered adapter.
By default, the strategy is to forward the exception.
void setReaderExceptionStrategy(ExceptionStrategy strategy)
Set the strategy to use when a RuntimeException
occur while reading a field value.
-OdinFormatException
if the the odn format contains an error or an object is read with the wrong type. -OdinTypeException
if an error occur when Odin build the fields type. -OdinAdapterException
if the error has already been forwarded by a field adapter. -Any otherRuntimeException
if the error come from a registered adapter.
By default, the strategy is to forward the exception.
strategy
- the exception strategyExceptionStrategy getWriterExceptionStrategy()
Get the strategy to use when a RuntimeException
occur while writing a field value.
-OdinFormatException
if an invalid field key is write by this adapter ( key can not contains ,:={}[]<>'" ) -OdinTypeException
if an error occur when Odin build the fields type. -OdinAdapterException
if the error has already been forwarded by a field adapter. -Any otherRuntimeException
if the error come from a registered adapter.
By default, the strategy is to forward the exception.
void setWriterExceptionStrategy(ExceptionStrategy strategy)
Set the strategy to use when a RuntimeException
occur while writing a field value.
-OdinFormatException
if an invalid field key is write by this adapter ( key can not contains ,:={}[]<>'" ) -OdinTypeException
if an error occur when Odin build the fields type. -OdinAdapterException
if the error has already been forwarded by a field adapter. -Any otherRuntimeException
if the error come from a registered adapter.
By default, the strategy is to forward the exception.
strategy
- the exception strategyboolean isSkippingNull()
void setSkippingNull(boolean skipNull)
skipNull
- true to skip entries with a null value