Package com.nomagic.magicreport
Class ParseErrorException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.nomagic.magicreport.TemplateException
com.nomagic.magicreport.ParseErrorException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
PPTXParseErrorException,XLSXParseErrorException
Application-level exception thrown when a template has a syntax or other error which prevents it from being
parsed.
- Since:
- Jun 11, 2007
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe column number of the parsing error, or -1 if not defined.protected StringMessage in detailed.protected intThe line number of the parsing error, or -1 if not defined.protected StringContains content to template until error offset.protected TemplateContains reference to error template. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new exception withnullas its detail message.ParseErrorException(String message) Constructs a new exception with the specified detail message.ParseErrorException(String message, Template template) Constructs a new exception with the specified detail message.ParseErrorException(String message, Template template, int lineNumber) Constructs a new exception with the specified detail message.ParseErrorException(String message, Template template, int lineNumber, int columnNumber) Constructs a new exception with the specified detail message.ParseErrorException(String message, Template template, int lineNumber, int columnNumber, String source) Constructs a new exception with the specified detail message.ParseErrorException(String message, Throwable cause) Constructs a new exception with the specified detail message and cause.ParseErrorException(Throwable cause) Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). -
Method Summary
Modifier and TypeMethodDescriptionCreates and returns a copy of this object.intReturn the column number of the parsing error, or -1 if not defined.Return a full message.intReturn the line number of the parsing error, or -1 if not defined.Return a full message.Return string representation of this exception without velocityMessageToHumanReadableReturn a source.Return a message without customize.Return the template containing the error, or null if not defined.voidsetColumnNumber(int columnNumber) Set a column number of the parsing error.voidsetFullMessage(String fullMessage) Set a full message.voidsetLineNumber(int lineNumber) Set a line number of the parsing error.voidSet a source.voidsetTemplate(Template template) Set a template containing the error.toString()Return string representation of this exceptionMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Field Details
-
columnNumber
protected int columnNumberThe column number of the parsing error, or -1 if not defined. -
lineNumber
protected int lineNumberThe line number of the parsing error, or -1 if not defined. -
template
Contains reference to error template. -
source
Contains content to template until error offset. -
fullMessage
Message in detailed.
-
-
Constructor Details
-
ParseErrorException
public ParseErrorException()Constructs a new exception withnullas its detail message. -
ParseErrorException
Constructs a new exception with the specified detail message.- Parameters:
message- the detail message. The detail message is saved for later retrieval by thegetMessage()method.
-
ParseErrorException
Constructs a new exception with the specified detail message.- Parameters:
message- the detail message. The detail message is saved for later retrieval by thegetMessage()method.template- template
-
ParseErrorException
Constructs a new exception with the specified detail message.- Parameters:
message- the detail message. The detail message is saved for later retrieval by thegetMessage()method.template- templatelineNumber- line number
-
ParseErrorException
Constructs a new exception with the specified detail message.- Parameters:
message- the detail message. The detail message is saved for later retrieval by thegetMessage()method.template- templatelineNumber- line numbercolumnNumber- column number
-
ParseErrorException
public ParseErrorException(String message, Template template, int lineNumber, int columnNumber, String source) Constructs a new exception with the specified detail message.- Parameters:
message- the detail message. The detail message is saved for later retrieval by thegetMessage()method.template- templatelineNumber- line numbercolumnNumber- column numbersource- template content until offset of error character.
-
ParseErrorException
Constructs a new exception with the specified detail message and cause.Note that the detail message associated with
causeis not automatically incorporated in this exception's detail message.- Parameters:
message- the detail message (which is saved for later retrieval by thegetMessage()method).cause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
-
ParseErrorException
Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for exceptions that are little more than wrappers for other throwables (for example,PrivilegedActionException).- Parameters:
cause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
-
-
Method Details
-
setColumnNumber
public void setColumnNumber(int columnNumber) Set a column number of the parsing error.- Parameters:
columnNumber- column number of the parsing error
-
setLineNumber
public void setLineNumber(int lineNumber) Set a line number of the parsing error.- Parameters:
lineNumber- the line number of the parsing error
-
setTemplate
Set a template containing the error.- Parameters:
template- the template containing the error
-
getColumnNumber
public int getColumnNumber()Return the column number of the parsing error, or -1 if not defined.- Returns:
- column number of the parsing error, or -1 if not defined
-
getLineNumber
public int getLineNumber()Return the line number of the parsing error, or -1 if not defined.- Returns:
- line number of the parsing error, or -1 if not defined
-
getTemplate
Return the template containing the error, or null if not defined.- Returns:
- the template containing the parsing error, or null if not defined
-
getSource
Return a source.- Returns:
- the source
-
setSource
Set a source.- Parameters:
source- the source to set
-
setFullMessage
Set a full message.- Parameters:
fullMessage- the full message to set
-
getFullMessage
Return a full message.- Returns:
- a full message.
-
getSourceMessage
Return a message without customize.- Returns:
- a message.
-
getMessage
Return a full message.- Overrides:
getMessagein classThrowable- Returns:
- the full message
-
toString
Return string representation of this exception -
getShortMessage
Return string representation of this exception without velocityMessageToHumanReadable- Returns:
-
copy
Creates and returns a copy of this object.- Parameters:
message- a new message- Returns:
- a copy of this instance.
-