public class TextTemplateUtil extends Object
| Constructor and Description |
|---|
TextTemplateUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
balancedCapture(char[] chars,
int start,
char type,
String templateFileName)
This is an important aspect of the core parser tools.
|
static int |
balancedCapture(char[] chars,
int start,
int end,
char type,
String templateFileName) |
static int |
captureStringLiteral(char type,
char[] expr,
int cursor,
int end,
String templateFileName) |
static org.everit.templating.util.CompileException |
createCompileException(String templateName,
String message,
char[] expr,
int cursor,
Throwable cause)
Instantiates a new
CompileException based on the parameters. |
static ContentRange |
createStringTrimmed(char[] s,
int start,
int length) |
static boolean |
isWhitespace(char c) |
static char[] |
subset(char[] array,
int start,
int length) |
public static int balancedCapture(char[] chars,
int start,
char type,
String templateFileName)
If a balanced capture is performed from position 2, we get "(foo + bar + (bar - foo))" back.
If a balanced capture is performed from position 15, we get "(bar - foo)" back.
Etc.
chars - -start - -type - -templateFileName - -public static int balancedCapture(char[] chars,
int start,
int end,
char type,
String templateFileName)
public static int captureStringLiteral(char type,
char[] expr,
int cursor,
int end,
String templateFileName)
public static org.everit.templating.util.CompileException createCompileException(String templateName, String message, char[] expr, int cursor, Throwable cause)
CompileException based on the parameters.templateName - The name of the template or null if no template name is available. If
defined, the template name will be concatenated with the message.message - The message of the exception.expr - The expression that caused the exceptioncursor - The cursor within the expression character array.cause - The cause of the exception.CompileException.public static ContentRange createStringTrimmed(char[] s, int start, int length)
public static boolean isWhitespace(char c)
public static char[] subset(char[] array,
int start,
int length)
Copyright © 2011–2016 Everit Kft.. All rights reserved.