Class XmlException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.github.oowekyala.ooxml.messages.XmlException
-
- All Implemented Interfaces:
java.io.Serializable
public final class XmlException extends java.lang.RuntimeExceptionGeneric XML exception wrapper. Can occur during validation or parsing.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private @Nullable java.lang.Stringkindprivate XmlPositionpositionprivate XmlSeverityseverityprivate java.lang.StringsimpleMessage
-
Constructor Summary
Constructors Constructor Description XmlException(NiceXmlMessageSpec spec, @Nullable java.lang.String fullMessage)Create a new exception from the given spec.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.lang.StringgetKind()Returns the message kind.XmlPositiongetPosition()Returns the position where the error occurred.XmlSeveritygetSeverity()Returns the severity of the message.java.lang.StringgetSimpleMessage()Returns the error message, without the surrounding line context.java.lang.StringtoString()
-
-
-
Field Detail
-
position
private final XmlPosition position
-
simpleMessage
private final java.lang.String simpleMessage
-
kind
private final @Nullable java.lang.String kind
-
severity
private final XmlSeverity severity
-
-
Constructor Detail
-
XmlException
public XmlException(NiceXmlMessageSpec spec, @Nullable java.lang.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:
java.lang.NullPointerException- If the spec is null
-
-
Method Detail
-
getSimpleMessage
public java.lang.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 java.lang.String getKind()
Returns the message kind.
-
getSeverity
public XmlSeverity getSeverity()
Returns the severity of the message.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Throwable
-
-