|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.velocity.internal.util.VelocityParser
public class VelocityParser
Provide helpers to parse velocity scripts.
| Field Summary | |
|---|---|
static java.util.Set<java.lang.String> |
VELOCITYDIRECTIVE_ALL
All the velocity reserved directives. |
static java.util.Set<java.lang.String> |
VELOCITYDIRECTIVE_BEGIN
The directives which start a new level which will have to be close by a #end. |
static java.util.Set<java.lang.String> |
VELOCITYDIRECTIVE_END
Close an opened level. |
static java.util.Set<java.lang.String> |
VELOCITYDIRECTIVE_NOPARAM
Reserved directives without parameters like #else. |
static java.util.Set<java.lang.String> |
VELOCITYDIRECTIVE_PARAM
Reserved directive containing parameter(s) like #if. |
| Constructor Summary | |
|---|---|
VelocityParser()
|
|
| Method Summary | |
|---|---|
int |
getDirective(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Get any valid Velocity block starting with a sharp character except comments. |
int |
getDirectiveEndOfLine(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Get the newline consumed by Velocity directive other than macros. |
int |
getDirectiveName(char[] array,
int currentIndex,
java.lang.StringBuffer directiveName,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Get a Velocity directive name block. |
int |
getEscape(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
|
int |
getKeyWord(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Get any valid Velocity block starting with a sharp character (#if, #somemaccro(), ##comment etc.). |
int |
getMacroParameter(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
|
int |
getMacroParametersSeparator(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
|
int |
getMethodOrProperty(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Get a velocity method call or a property starting with a .. |
int |
getMethodParameters(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Get the Velocity method parameters (including ( and )). |
int |
getMultilinesComment(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Get multilines comment (between #* and *#). |
int |
getParameters(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
char endingChar,
VelocityParserContext context)
Get a group of parameters between two characters. |
int |
getSimpleComment(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Get comment single line comment (starting with ##). |
int |
getSpaces(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Match a group of space characters (ASCII 32). |
int |
getTableElement(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Get a Velocity table. |
int |
getVar(char[] array,
int currentIndex,
java.lang.StringBuffer varName,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Get any valid Velocity starting with a $. |
int |
getVar(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Get any valid Velocity starting with a $. |
int |
getVelocityIdentifier(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Get a valid Velocity identifier used for variable of macro. |
int |
getWhiteSpaces(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Match a group of Character.isWhitespace(char). |
boolean |
isValidVelocityIdentifierChar(char c)
Indicate if the provided character is valid in a velocity identifier. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Set<java.lang.String> VELOCITYDIRECTIVE_BEGIN
public static final java.util.Set<java.lang.String> VELOCITYDIRECTIVE_END
public static final java.util.Set<java.lang.String> VELOCITYDIRECTIVE_PARAM
public static final java.util.Set<java.lang.String> VELOCITYDIRECTIVE_NOPARAM
public static final java.util.Set<java.lang.String> VELOCITYDIRECTIVE_ALL
| Constructor Detail |
|---|
public VelocityParser()
| Method Detail |
|---|
public int getKeyWord(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
throws InvalidVelocityException
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
InvalidVelocityException - not a valid velocity block
public int getDirective(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
throws InvalidVelocityException
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
InvalidVelocityException - not a valid velocity block
public int getVelocityIdentifier(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
throws InvalidVelocityException
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
InvalidVelocityException - not a valid velocity blockpublic boolean isValidVelocityIdentifierChar(char c)
c - the character
public int getDirectiveName(char[] array,
int currentIndex,
java.lang.StringBuffer directiveName,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
throws InvalidVelocityException
getVelocityIdentifier(char[], int, StringBuffer, VelocityParserContext) because is include the optional
{ and }.
array - the source to parsecurrentIndex - the current index in the arraydirectiveName - the buffer where to append the name of the directivevelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
InvalidVelocityException - not a valid velocity block
public int getDirectiveEndOfLine(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
public int getSimpleComment(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
##).
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
public int getMultilinesComment(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
#* and *#).
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
public int getVar(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
throws InvalidVelocityException
$.
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
InvalidVelocityException - not a valid velocity block
public int getVar(char[] array,
int currentIndex,
java.lang.StringBuffer varName,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
throws InvalidVelocityException
$.
array - the source to parsecurrentIndex - the current index in the arrayvarName - the buffer where to append the name of the variablevelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
InvalidVelocityException - not a valid velocity block
public int getMethodOrProperty(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
throws InvalidVelocityException
..
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
InvalidVelocityException - not a valid velocity block
public int getTableElement(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
public int getMethodParameters(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
( and )).
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
public int getParameters(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
char endingChar,
VelocityParserContext context)
getTableElement(char[], int, StringBuffer, VelocityParserContext) and
getMethodParameters(char[], int, StringBuffer, VelocityParserContext).
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockendingChar - the char to end tocontext - the parser context to put some informations
array after the matched block
public int getEscape(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
public int getWhiteSpaces(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
Character.isWhitespace(char).
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
public int getSpaces(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
public int getMacroParametersSeparator(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
public int getMacroParameter(char[] array,
int currentIndex,
java.lang.StringBuffer velocityBlock,
VelocityParserContext context)
array - the source to parsecurrentIndex - the current index in the arrayvelocityBlock - the buffer where to append matched velocity blockcontext - the parser context to put some informations
array after the matched block
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||