java.lang.Object
java.lang.Throwable
java.lang.Exception
org.refcodes.exception.AbstractException
org.refcodes.exception.UnmarshalException
- All Implemented Interfaces:
Serializable
,ErrorCodeAccessor
,Trap
Thrown when unmarshaling / deserializing an object fails.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.exception.ErrorCodeAccessor
ErrorCodeAccessor.ErrorCodeBuilder<B extends ErrorCodeAccessor.ErrorCodeBuilder<B>>, ErrorCodeAccessor.ErrorCodeMutator, ErrorCodeAccessor.ErrorCodeProperty
-
Field Summary
-
Constructor Summary
ConstructorDescriptionUnmarshalException
(String aMessage) UnmarshalException
(String aMessage, int aOffset) UnmarshalException
(String aMessage, int aOffset, Throwable aCause) UnmarshalException
(String aMessage, String aErrorCode) UnmarshalException
(String aMessage, Throwable aCause) UnmarshalException
(String aMessage, Throwable aCause, String aErrorCode) UnmarshalException
(Throwable aCause) UnmarshalException
(Throwable aCause, String aErrorCode) -
Method Summary
Modifier and TypeMethodDescriptionint
In case of a char sequence, the offset represents the position at which unmarshaling failed.Object[]
Provides the arguments for theThrowable.getMessage()
method to create the actual message from the message pattern (passed as message argument to the exception's constructors).Methods inherited from class org.refcodes.exception.AbstractException
getErrorCode, getMessage
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.refcodes.exception.Trap
toLocalizedMessage, toMessage, toMessage, toMessage, toShortLocalizedMessage, toShortMessage
-
Field Details
-
_offset
protected int _offset
-
-
Constructor Details
-
UnmarshalException
-
UnmarshalException
- Parameters:
aOffset
- The offset in the char sequence causing problems.
-
UnmarshalException
- Parameters:
aOffset
- The offset in the char sequence causing problems.
-
UnmarshalException
-
UnmarshalException
-
UnmarshalException
-
UnmarshalException
-
UnmarshalException
-
-
Method Details
-
getOffset
public int getOffset()In case of a char sequence, the offset represents the position at which unmarshaling failed.- Returns:
- The position at which unmarshaling failed or -1 if none such position is available.
-
getPatternArguments
Provides the arguments for theThrowable.getMessage()
method to create the actual message from the message pattern (passed as message argument to the exception's constructors). The message pattern together with the arguments are passed to theTrap.asMessage(String, Object...)
method). Override theTrap.getPatternArguments()
method to provide the required arguments for applyingTrap.asMessage(String, Object...)
to the message template! Providingnull
will return the message pattern untouched.- Returns:
- The arguments required to build a message from the message pattern or null if the message pattern is to be returned directly!
-