Package gnu.text
Class SyntaxException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- gnu.text.SyntaxException
-
- All Implemented Interfaces:
Serializable
public class SyntaxException extends RuntimeException
Used to signal a non-recoverable (fatal) syntax error. Can also be used to signal a syntax error from embedded parsers, such as aneval
orexecute
method, or well-formedness errors when reading an XML document.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description int
maxToPrint
-
Constructor Summary
Constructors Constructor Description SyntaxException(SourceMessages messages)
SyntaxException(String header, SourceMessages messages)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
String
getHeader()
If non-null, an extra one-line message printed before the messages.String
getMessage()
SourceMessages
getMessages()
void
printAll(PrintWriter out, int max)
void
setHeader(String header)
Set the header returned bygetHeader
.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
SyntaxException
public SyntaxException(SourceMessages messages)
-
SyntaxException
public SyntaxException(String header, SourceMessages messages)
-
-
Method Detail
-
getHeader
public final String getHeader()
If non-null, an extra one-line message printed before the messages. Can be used to provide extra context.
-
setHeader
public final void setHeader(String header)
Set the header returned bygetHeader
.
-
getMessages
public SourceMessages getMessages()
-
printAll
public void printAll(PrintWriter out, int max)
-
clear
public void clear()
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
-