Class ParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.juneau.commons.BasicRuntimeException
org.apache.juneau.marshall.BasicRuntimeException
org.apache.juneau.marshall.parser.ParseException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MissingRequiredPropertyException
Exception that indicates invalid syntax encountered during parsing.
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionParseException(String message, Object... args) Constructor.ParseException(Throwable causedBy) Constructor.ParseException(Throwable causedBy, String message, Object... args) Constructor.ParseException(ParserSession session, Exception causedBy) Constructor.ParseException(ParserSession session, String message, Object... args) Constructor.ParseException(ParserSession session, Throwable causedBy, String message, Object... args) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic ParseExceptionCreator method.Returns the highest-levelParseException in the stack trace.setMessage(String message, Object... args) Sets the detail message on this exception.Methods inherited from class org.apache.juneau.commons.BasicRuntimeException
getMessageMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ParseException
Constructor.- Parameters:
session- The parser session.
Can benull (the message is not augmented with position/debug info).causedBy- The inner exception.
Must not benull .
-
ParseException
Constructor.- Parameters:
session- The parser session.
Can benull (the message is not augmented with position/debug info).message- The exception message containingString.format-style (%s ) arguments.args- OptionalString.format-style arguments.
-
ParseException
Constructor.- Parameters:
session- The parser session.
Can benull (the message is not augmented with position/debug info).causedBy- The cause of this exception.
Can benull (no cause is set).message- The exception message containingString.format-style (%s ) arguments.args- OptionalString.format-style arguments.
-
ParseException
Constructor.- Parameters:
message- TheString.format-style message (%s placeholders).args- OptionalString.format-style arguments.
-
ParseException
Constructor.- Parameters:
causedBy- The cause of this exception.
Can benull (no cause is set).
-
ParseException
Constructor.- Parameters:
causedBy- The cause of this exception.
Can benull (no cause is set).message- TheString.format-style message (%s placeholders).args- OptionalString.format-style arguments.
-
-
Method Details
-
create
Creator method.If the throwable is already a
ParseException, we simply return that exception as-is. If the throwable is anInvocationTargetException, we unwrap the thrown exception. Otherwise we create a newParseException.- Parameters:
e- The exception being wrapped or unwrapped.
Can benull (a newParseExceptionwith no cause is created).- Returns:
- The specified throwable wrapped or unwrapped as a
ParseException(may be the same instance if it already was one).
-
getRootCause
Returns the highest-levelParseException in the stack trace.Useful for JUnit testing of error conditions.
- Returns:
- The root parse exception, or this exception if there isn't one.
-
setMessage
Description copied from class:BasicRuntimeExceptionSets the detail message on this exception.- Overrides:
setMessagein classBasicRuntimeException- Parameters:
message- The message.args- The message args.- Returns:
- This object.
-