|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.ejen.ext.StringUtil
String operations utilities (static methods).
Usage (XSL stylesheet) |
---|
<?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ... xmlns:stu="org.ejen.ext.StringUtil" version="1.0"> <xsl:output method="text" encoding="iso-8859-1"/> <xsl:template match="ejen"> Date: <xsl:value-of select="stu: |
Field Summary | |
static String |
LINE_SEPARATOR
|
Constructor Summary | |
protected |
StringUtil()
Protected constructor (prevents instanciation). |
Method Summary | |
static String |
dateFormat(ExpressionContext context,
String format)
Formats and returns current date. |
static boolean |
equals(ExpressionContext context,
String s1,
String s2)
Compares the String s1 to the String s2. |
static boolean |
equalsIgnoreCase(ExpressionContext context,
String s1,
String s2)
Compares the String s1 to the String s2, ignoring case considerations. |
static String |
indent(ExpressionContext context,
int newLines,
int tabs)
Returns a String starting with 'newLines' new lines followed by 'tabs' tabs. |
static String |
replace(ExpressionContext context,
String s1,
String s2,
String s3)
Returns a new string resulting from replacing all occurrences of s2 in s1 with s3. |
static String |
toLowerCase(ExpressionContext context,
String s)
Converts all of the characters in the String s to lower case using the rules of the default locale. |
static String |
toULowerCase(ExpressionContext context,
String s)
Converts the first character in the String s to uppercase and the remaining characters to lower case using the rules of the default locale. |
static String |
toUpperCase(ExpressionContext context,
String s)
Converts all of the characters in the String s to upper case using the rules of the default locale. |
protected static String |
unescape(String s)
Returns a String with common escape sequences ("\t", "\n", "\r", "\f") converted to their respective values. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String LINE_SEPARATOR
Constructor Detail |
protected StringUtil()
Method Detail |
public static String dateFormat(ExpressionContext context, String format)
<xsl:value-of select="stu:dateFormat('yyyy/MM/dd')"/> |
See SimpleDateFormat
.
context
- automatically passed by the xalan extension mechanism.format
- time pattern.
public static boolean equals(ExpressionContext context, String s1, String s2)
<xsl:if test="stu:equals('abc','abc')"> ... </xsl:if> |
context
- automatically passed by the xalan extension mechanism.s1
- the first String.s2
- the second String.
public static boolean equalsIgnoreCase(ExpressionContext context, String s1, String s2)
<xsl:if test="stu:equals('abc','ABc')"> ... </xsl:if> |
context
- automatically passed by the xalan extension mechanism.s1
- [AVT] - the first String.s2
- [AVT] - the second String.
public static String toLowerCase(ExpressionContext context, String s)
<xsl:value-of select="stu:toLowerCase('aBc')"/> |
context
- automatically passed by the xalan extension mechanism.s
- the String to be converted.
public static String toUpperCase(ExpressionContext context, String s)
<xsl:value-of select="stu:toUpperCase('aBc')"/> |
context
- automatically passed by the xalan extension mechanism.s
- the String to be converted.
public static String toULowerCase(ExpressionContext context, String s)
<xsl:value-of select="stu:toULowerCase('aBc')"/> |
context
- automatically passed by the xalan extension mechanism.s
- the String to be converted.
public static String indent(ExpressionContext context, int newLines, int tabs)
<xsl:value-of select="stu:indent(1,2)"/> |
This call will return "\n\t\t"
.
context
- automatically passed by the xalan extension mechanism.newLines
- number of new lines.tabs
- number of tabs.
public static String replace(ExpressionContext context, String s1, String s2, String s3)
<xsl:value-of select="stu:replace('ab-ab-ab','ab','cde')"/> |
This call will return "cde-cde-cde"
.
"unescaped" means: common escape sequences ("\t", "\n", "\r", "\f") converted to their respective values.
context
- automatically passed by the xalan extension mechanism.s1
- the first String.s2
- the second String (will be unescaped).s3
- the third String (will be unescaped).
protected static String unescape(String s)
s
- String to unescape.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |