public final class HTMLTemplatingUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
attributeConstantEquals(String expectedValue,
String attributeValue)
Checks whether the value of an attribute is equal to the expected in the way that the value of
the attribute might be quoted with quotes or apostrophes.
|
static Coordinate |
calculateCoordinate(org.htmlparser.lexer.Page page,
int cursor,
Coordinate coordinateOffset)
Calculates the coordinate within a page based on an initial offset.
|
static String |
escape(String textString)
Escapes special characters (and, lt, gt, quot, apos) within the text.
|
static String |
repeatChar(char c,
int n)
Generates a String that contains the specified character N times.
|
static void |
throwCompileExceptionForAttribute(String message,
org.htmlparser.Tag tag,
org.htmlparser.lexer.PageAttribute attribute,
boolean positionOfAttributeValue,
Coordinate startPosition)
Throws an exception for an eht attribute with all information that can be useful for the
programmer.
|
static String |
unescape(String text)
Unescapes special expressions (amp, quot, apostrophe, gt, lt) of a text.
|
public static boolean attributeConstantEquals(String expectedValue, String attributeValue)
expectedValue - The expected value.attributeValue - The value of the attribute that might be quoted.public static Coordinate calculateCoordinate(org.htmlparser.lexer.Page page, int cursor, Coordinate coordinateOffset)
page - The HTML/XML page.cursor - The cursor on the page.coordinateOffset - The offset of the cursor.public static String escape(String textString)
textString - The text that should be escaped.public static String repeatChar(char c, int n)
c - The character that will be repeated.n - The length of the generated String.public static void throwCompileExceptionForAttribute(String message, org.htmlparser.Tag tag, org.htmlparser.lexer.PageAttribute attribute, boolean positionOfAttributeValue, Coordinate startPosition)
message - The message that should be part of the exception.tag - The tag that the attribute belongs to.attribute - The attribute that indicated the error.positionOfAttributeValue - The position of the attribute.startPosition - The starting position of the template.Copyright © 2011–2015 Everit Kft.. All rights reserved.