Package org.nekosoft.pdffer.exception
Class PayloadFormatException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.nekosoft.pdffer.exception.PdfTemplateException
org.nekosoft.pdffer.exception.PayloadFormatException
- All Implemented Interfaces:
Serializable
An exception indicating that an invalid payload representation has been provided to either
setPayloadJson
or
setPayloadMap
and therefore
a payload instance could not be created.- See Also:
- Serialized Form
-
Constructor Summary
ConstructorDescriptionPayloadFormatException(String json, Throwable t)
Invoke this constructor when a JSON representation failed to create a payload instance.PayloadFormatException(Map map, Throwable t)
Invoke this constructor when a Java map representation failed to create a payload instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the JSON string that caused the failure, ornull
if the failure was caused by a Java mapReturns the map that caused the failure, ornull
if the failure was caused by a JSON stringReturns the representation that caused the failure - it could be a JSON string or a Java map.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
PayloadFormatException
Invoke this constructor when a JSON representation failed to create a payload instance.- Parameters:
json
- the failing JSON stringt
- the exception that was raised when trying to convert JSON to payload class
-
PayloadFormatException
Invoke this constructor when a Java map representation failed to create a payload instance.- Parameters:
map
- the failing Java mapt
- the exception that was raised when trying to convert the map to payload class
-
-
Method Details
-
getPayloadMap
Returns the map that caused the failure, ornull
if the failure was caused by a JSON string- Returns:
- the failing map or
null
-
getPayloadJson
Returns the JSON string that caused the failure, ornull
if the failure was caused by a Java map- Returns:
- the failing JSON string or
null
-
getPayloadSource
Returns the representation that caused the failure - it could be a JSON string or a Java map.- Returns:
- the failing JSON string or Java map
-