Class XmlException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.github.oowekyala.ooxml.messages.XmlException
-
- All Implemented Interfaces:
Serializable
public final class XmlException extends RuntimeException
Generic XML exception wrapper. Can occur during validation or parsing.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XmlException(NiceXmlMessageSpec spec, @Nullable String fullMessage)Create a new exception from the given spec.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable StringgetKind()Returns the message kind.XmlPositiongetPosition()Returns the position where the error occurred.XmlSeveritygetSeverity()Returns the severity of the message.StringgetSimpleMessage()Returns the error message, without the surrounding line context.StringtoString()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Constructor Detail
-
XmlException
public XmlException(NiceXmlMessageSpec spec, @Nullable String fullMessage)
Create a new exception from the given spec.- Parameters:
spec- A non-null specfullMessage- Used as thetoString(). If null, the spec'sNiceXmlMessageSpec.getSimpleMessage()is used.- Throws:
NullPointerException- If the spec is null
-
-
Method Detail
-
getSimpleMessage
public String getSimpleMessage()
Returns the error message, without the surrounding line context.Throwable.getMessage()will return a fuller message.
-
getPosition
public XmlPosition getPosition()
Returns the position where the error occurred. This may be undefined.
-
getKind
public @Nullable String getKind()
Returns the message kind.
-
getSeverity
public XmlSeverity getSeverity()
Returns the severity of the message.
-
-