public class ParseException
extends java.io.IOException
TemplateException
). This usually
signals syntactical/lexical errors.
Note that on JavaCC-level lexical errors throw TokenMgrError
instead of this, however with the API-s that
most users use those will be wrapped into ParseException
-s.
This is a modified version of file generated by JavaCC from FTL.jj.
You can modify this class to customize the error reporting mechanisms so long as the public interface
remains compatible with the original.TokenMgrError
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
_INCLUDE |
static int |
AND |
static int |
AS |
static int |
ASCII_DIGIT |
static int |
ASSIGN |
static int |
ATTEMPT |
static int |
AUTOESC |
static int |
BLANK |
static int |
BREAK |
static int |
BUILT_IN |
static int |
CALL |
static int |
CASE |
static int |
CLOSE_BRACKET |
static int |
CLOSE_PAREN |
static int |
CLOSE_TAG1 |
static int |
CLOSE_TAG2 |
static int |
CLOSING_CURLY_BRACKET |
static int |
COLON |
int |
columnNumber |
static int |
COMMA |
static int |
COMMENT |
static int |
COMPRESS |
static int |
CONTINUE |
freemarker.core.Token |
currentToken
This is the last token that has been consumed successfully.
|
static int |
DECIMAL |
static int |
DEFAUL |
static int |
DEFAULT |
static int |
DIRECTIVE_END |
static int |
DIV_EQUALS |
static int |
DIVIDE |
static int |
DOLLAR_INTERPOLATION_OPENING |
static int |
DOT |
static int |
DOT_DOT |
static int |
DOT_DOT_ASTERISK |
static int |
DOT_DOT_LESS |
static int |
DOUBLE_EQUALS |
static int |
DOUBLE_STAR |
static int |
ELLIPSIS |
static int |
ELSE |
static int |
ELSE_IF |
static int |
EMPTY_DIRECTIVE_END |
static int |
END_ASSIGN |
static int |
END_ATTEMPT |
static int |
END_AUTOESC |
static int |
END_COMPRESS |
static int |
END_ESCAPE |
static int |
END_FOREACH |
static int |
END_FUNCTION |
static int |
END_GLOBAL |
static int |
END_IF |
static int |
END_ITEMS |
static int |
END_LIST |
static int |
END_LOCAL |
static int |
END_MACRO |
static int |
END_NOAUTOESC |
static int |
END_NOESCAPE |
static int |
END_OUTPUTFORMAT |
static int |
END_RECOVER |
static int |
END_SEP |
static int |
END_SWITCH |
static int |
END_TAG |
static int |
END_TRANSFORM |
int |
endColumnNumber |
int |
endLineNumber |
static int |
EOF |
protected java.lang.String |
eol
The end of line string for this machine.
|
static int |
EQUALS |
static int |
ESCAPE |
static int |
ESCAPED_CHAR |
static int |
ESCAPED_GT |
static int |
ESCAPED_GTE |
static int |
ESCAPED_ID_CHAR |
static int |
EXCLAM |
static int |
EXISTS |
int[][] |
expectedTokenSequences
Each entry in this array is an array of integers.
|
static int |
EXPRESSION_COMMENT |
static int |
FALLBACK |
static int |
FALSE |
static int |
FLUSH |
static int |
FM_EXPRESSION |
static int |
FOREACH |
static int |
FTL_HEADER |
static int |
FUNCTION |
static int |
GLOBALASSIGN |
static int |
HALT |
static int |
HASH_INTERPOLATION_OPENING |
static int |
ID |
static int |
ID_START_CHAR |
static int |
IF |
static int |
IMPORT |
static int |
IN |
static int |
IN_PAREN |
static int |
INTEGER |
static int |
ITEMS |
static int |
KEEP_GOING |
static int |
LAMBDA_ARROW |
static int |
LESS_THAN |
static int |
LESS_THAN_EQUALS |
int |
lineNumber |
static int |
LIST |
static int |
LOCALASSIGN |
static int |
LONE_LESS_THAN_OR_DASH |
static int |
LTRIM |
static int |
MACRO |
static int |
MAYBE_END |
static int |
MINUS |
static int |
MINUS_EQUALS |
static int |
MINUS_MINUS |
static int |
MOD_EQUALS |
static int |
NAMED_PARAMETER_EXPRESSION |
static int |
NATURAL_GT |
static int |
NATURAL_GTE |
static int |
NESTED |
static int |
NO_DIRECTIVE |
static int |
NO_PARSE |
static int |
NO_SPACE_EXPRESSION |
static int |
NOAUTOESC |
static int |
NOESCAPE |
static int |
NON_ESCAPED_ID_START_CHAR |
static int |
NOPARSE |
static int |
NOT_EQUALS |
static int |
NOTRIM |
static int |
OPEN_BRACKET |
static int |
OPEN_MISPLACED_INTERPOLATION |
static int |
OPEN_PAREN |
static int |
OPENING_CURLY_BRACKET |
static int |
OR |
static int |
OUTPUTFORMAT |
static int |
PERCENT |
static int |
PLUS |
static int |
PLUS_EQUALS |
static int |
PLUS_PLUS |
static int |
RAW_STRING |
static int |
RECOVER |
static int |
RECURSE |
static int |
RETURN |
static int |
RTRIM |
static int |
SEMICOLON |
static int |
SEP |
static int |
SETTING |
static int |
SIMPLE_NESTED |
static int |
SIMPLE_RECURSE |
static int |
SIMPLE_RETURN |
protected boolean |
specialConstructor
Deprecated.
Will be remove without replacement in 2.4.
|
static int |
SQUARE_BRACKET_INTERPOLATION_OPENING |
static int |
START_TAG |
static int |
STATIC_TEXT_FALSE_ALARM |
static int |
STATIC_TEXT_NON_WS |
static int |
STATIC_TEXT_WS |
static int |
STOP |
static int |
STRING_LITERAL |
static int |
SWITCH |
static int |
TERMINATING_EXCLAM |
static int |
TERMINATING_WHITESPACE |
static int |
TERSE_COMMENT |
static int |
TERSE_COMMENT_END |
static int |
TIMES |
static int |
TIMES_EQUALS |
java.lang.String[] |
tokenImage
This is a reference to the "tokenImage" array of the generated
parser within which the parse error occurred.
|
static int |
TRANSFORM |
static int |
TRIM |
static int |
TRIVIAL_FTL_HEADER |
static int |
TRUE |
static int |
UNIFIED_CALL |
static int |
UNIFIED_CALL_END |
static int |
UNKNOWN_DIRECTIVE |
static int |
USING |
static int |
VISIT |
Modifier | Constructor and Description |
---|---|
protected |
ParseException()
Deprecated.
Use a constructor to which you pass description, template, and positions.
|
|
ParseException(java.lang.String description,
int lineNumber,
int columnNumber)
Deprecated.
Use a constructor to which you can also pass the template, and the end positions.
|
|
ParseException(java.lang.String description,
Template template,
int lineNumber,
int columnNumber)
Deprecated.
Use
ParseException(String, Template, int, int, int, int) instead, as IDE-s need the end
position of the error too. |
|
ParseException(java.lang.String description,
Template template,
int lineNumber,
int columnNumber,
int endLineNumber,
int endColumnNumber) |
|
ParseException(java.lang.String description,
Template template,
int lineNumber,
int columnNumber,
int endLineNumber,
int endColumnNumber,
java.lang.Throwable cause) |
|
ParseException(java.lang.String description,
Template template,
int lineNumber,
int columnNumber,
java.lang.Throwable cause)
Deprecated.
Use
ParseException(String, Template, int, int, int, int, Throwable) instead, as IDE-s need
the end position of the error too. |
|
ParseException(java.lang.String description,
freemarker.core.TemplateObject tobj) |
|
ParseException(java.lang.String description,
freemarker.core.TemplateObject tobj,
java.lang.Throwable cause) |
|
ParseException(java.lang.String description,
Template template,
freemarker.core.Token tk) |
|
ParseException(java.lang.String description,
Template template,
freemarker.core.Token tk,
java.lang.Throwable cause) |
|
ParseException(freemarker.core.Token currentTokenVal,
int[][] expectedTokenSequencesVal,
java.lang.String[] tokenImageVal)
This constructor is used by the method "generateParseException"
in the generated parser.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
add_escapes(java.lang.String str)
Used to convert raw characters to their escaped version
when these raw version cannot be used as part of an ASCII
string literal.
|
int |
getColumnNumber()
1-based column number of the failing section, or 0 is the information is not available.
|
java.lang.String |
getEditorMessage()
Returns the description of the error without error location or source quotations, or
null if there's no
description available. |
int |
getEndColumnNumber()
1-based column number of the last character of the failing section, or 0 if the information is not available.
|
int |
getEndLineNumber()
1-based line number of the last line that contains the failing section, or 0 if the information is not available.
|
int |
getLineNumber()
1-based line number of the failing section, or 0 is the information is not available.
|
java.lang.String |
getMessage()
Returns the error location plus the error description.
|
java.lang.String |
getTemplateName()
Returns the name (template-root relative path) of the template whose parsing was failed.
|
void |
setTemplateName(java.lang.String templateName)
Should be used internally only; sets the name of the template that contains the error.
|
public freemarker.core.Token currentToken
public int columnNumber
public int lineNumber
public int endColumnNumber
public int endLineNumber
public int[][] expectedTokenSequences
public java.lang.String[] tokenImage
protected java.lang.String eol
@Deprecated protected boolean specialConstructor
public static final int EOF
public static final int BLANK
public static final int START_TAG
public static final int END_TAG
public static final int CLOSE_TAG1
public static final int CLOSE_TAG2
public static final int ATTEMPT
public static final int RECOVER
public static final int IF
public static final int ELSE_IF
public static final int LIST
public static final int ITEMS
public static final int SEP
public static final int FOREACH
public static final int SWITCH
public static final int CASE
public static final int ASSIGN
public static final int GLOBALASSIGN
public static final int LOCALASSIGN
public static final int _INCLUDE
public static final int IMPORT
public static final int FUNCTION
public static final int MACRO
public static final int TRANSFORM
public static final int VISIT
public static final int STOP
public static final int RETURN
public static final int CALL
public static final int SETTING
public static final int OUTPUTFORMAT
public static final int AUTOESC
public static final int NOAUTOESC
public static final int COMPRESS
public static final int COMMENT
public static final int TERSE_COMMENT
public static final int NOPARSE
public static final int END_IF
public static final int END_LIST
public static final int END_ITEMS
public static final int END_SEP
public static final int END_RECOVER
public static final int END_ATTEMPT
public static final int END_FOREACH
public static final int END_LOCAL
public static final int END_GLOBAL
public static final int END_ASSIGN
public static final int END_FUNCTION
public static final int END_MACRO
public static final int END_OUTPUTFORMAT
public static final int END_AUTOESC
public static final int END_NOAUTOESC
public static final int END_COMPRESS
public static final int END_TRANSFORM
public static final int END_SWITCH
public static final int ELSE
public static final int BREAK
public static final int CONTINUE
public static final int SIMPLE_RETURN
public static final int HALT
public static final int FLUSH
public static final int TRIM
public static final int LTRIM
public static final int RTRIM
public static final int NOTRIM
public static final int DEFAUL
public static final int SIMPLE_NESTED
public static final int NESTED
public static final int SIMPLE_RECURSE
public static final int RECURSE
public static final int FALLBACK
public static final int ESCAPE
public static final int END_ESCAPE
public static final int NOESCAPE
public static final int END_NOESCAPE
public static final int UNIFIED_CALL
public static final int UNIFIED_CALL_END
public static final int FTL_HEADER
public static final int TRIVIAL_FTL_HEADER
public static final int UNKNOWN_DIRECTIVE
public static final int STATIC_TEXT_WS
public static final int STATIC_TEXT_NON_WS
public static final int STATIC_TEXT_FALSE_ALARM
public static final int DOLLAR_INTERPOLATION_OPENING
public static final int HASH_INTERPOLATION_OPENING
public static final int SQUARE_BRACKET_INTERPOLATION_OPENING
public static final int ESCAPED_CHAR
public static final int STRING_LITERAL
public static final int RAW_STRING
public static final int FALSE
public static final int TRUE
public static final int INTEGER
public static final int DECIMAL
public static final int DOT
public static final int DOT_DOT
public static final int DOT_DOT_LESS
public static final int DOT_DOT_ASTERISK
public static final int BUILT_IN
public static final int EXISTS
public static final int EQUALS
public static final int DOUBLE_EQUALS
public static final int NOT_EQUALS
public static final int PLUS_EQUALS
public static final int MINUS_EQUALS
public static final int TIMES_EQUALS
public static final int DIV_EQUALS
public static final int MOD_EQUALS
public static final int PLUS_PLUS
public static final int MINUS_MINUS
public static final int LESS_THAN
public static final int LESS_THAN_EQUALS
public static final int ESCAPED_GT
public static final int ESCAPED_GTE
public static final int LAMBDA_ARROW
public static final int PLUS
public static final int MINUS
public static final int TIMES
public static final int DOUBLE_STAR
public static final int ELLIPSIS
public static final int DIVIDE
public static final int PERCENT
public static final int AND
public static final int OR
public static final int EXCLAM
public static final int COMMA
public static final int SEMICOLON
public static final int COLON
public static final int OPEN_BRACKET
public static final int CLOSE_BRACKET
public static final int OPEN_PAREN
public static final int CLOSE_PAREN
public static final int OPENING_CURLY_BRACKET
public static final int CLOSING_CURLY_BRACKET
public static final int IN
public static final int AS
public static final int USING
public static final int ID
public static final int OPEN_MISPLACED_INTERPOLATION
public static final int NON_ESCAPED_ID_START_CHAR
public static final int ESCAPED_ID_CHAR
public static final int ID_START_CHAR
public static final int ASCII_DIGIT
public static final int DIRECTIVE_END
public static final int EMPTY_DIRECTIVE_END
public static final int NATURAL_GT
public static final int NATURAL_GTE
public static final int TERMINATING_WHITESPACE
public static final int TERMINATING_EXCLAM
public static final int TERSE_COMMENT_END
public static final int MAYBE_END
public static final int KEEP_GOING
public static final int LONE_LESS_THAN_OR_DASH
public static final int DEFAULT
public static final int NO_DIRECTIVE
public static final int FM_EXPRESSION
public static final int IN_PAREN
public static final int NAMED_PARAMETER_EXPRESSION
public static final int EXPRESSION_COMMENT
public static final int NO_SPACE_EXPRESSION
public static final int NO_PARSE
public ParseException(freemarker.core.Token currentTokenVal, int[][] expectedTokenSequencesVal, java.lang.String[] tokenImageVal)
@Deprecated protected ParseException()
@Deprecated public ParseException(java.lang.String description, int lineNumber, int columnNumber)
public ParseException(java.lang.String description, Template template, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber)
public ParseException(java.lang.String description, Template template, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber, java.lang.Throwable cause)
@Deprecated public ParseException(java.lang.String description, Template template, int lineNumber, int columnNumber)
ParseException(String, Template, int, int, int, int)
instead, as IDE-s need the end
position of the error too.@Deprecated public ParseException(java.lang.String description, Template template, int lineNumber, int columnNumber, java.lang.Throwable cause)
ParseException(String, Template, int, int, int, int, Throwable)
instead, as IDE-s need
the end position of the error too.public ParseException(java.lang.String description, Template template, freemarker.core.Token tk)
public ParseException(java.lang.String description, Template template, freemarker.core.Token tk, java.lang.Throwable cause)
public ParseException(java.lang.String description, freemarker.core.TemplateObject tobj)
public ParseException(java.lang.String description, freemarker.core.TemplateObject tobj, java.lang.Throwable cause)
public void setTemplateName(java.lang.String templateName)
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
getDescription()
,
getTemplateName()
,
getLineNumber()
,
getColumnNumber()
public java.lang.String getEditorMessage()
null
if there's no
description available. This is useful in editors (IDE-s) where the error markers and the editor window itself
already carry this information, so it's redundant the repeat in the error dialog.public java.lang.String getTemplateName()
null
if this is a non-stored template.public int getLineNumber()
public int getColumnNumber()
public int getEndLineNumber()
public int getEndColumnNumber()
protected java.lang.String add_escapes(java.lang.String str)