|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.tacos.util.ScriptUtils
public final class ScriptUtils
Provides commonly used string functions not provided by other String based libraries.
Field Summary | |
---|---|
static String |
BEGIN_COMMENT
XML cdata start |
static String |
END_COMMENT
XML character data end |
static Pattern |
SCRIPT_INCLUDE_PATTERN
regexp pattern matching js package include statements |
static Pattern |
SCRIPT_PATTERN
Regexp represenging javascript matches |
Constructor Summary | |
---|---|
ScriptUtils()
|
Method Summary | |
---|---|
static Map |
createParamsMap(String initializer,
String delim)
Creates a parameters map using the specified initializer and delimiter. |
static String |
ensureValidScriptTags(String input)
Takes any tags found in the specified input string and replaces their contents into one large block (meaning if multiple script blocks are found, they will be turned into one), with the addition of BEGIN_COMMENT inserted before the logic block and
END_COMMENT inserted after the logic block. |
static String |
escapeJavaScriptHash(String jshash)
input: {paramA:{param1: val"u\e1 , param2: "value2"}, "paramB":'valueB'} output: {'paramA':{'param1': 'val\"u\\e1' , 'param2': 'value2'}, 'paramB':'valueB'} |
static org.apache.tapestry.IComponent |
getContainer(org.apache.tapestry.IComponent comp)
Returns the component's container, or the page if it's null. |
static String |
getFieldId(org.apache.tapestry.IComponent comp,
String uniqueId)
Gets the unique ID from a component. |
static void |
parseJSIncludes(String input,
StringBuffer appender)
Parses any tags found
in input string. |
static String |
toJsStringArray(Iterator values)
Create a list of quoted strings. |
static String |
toJsStringArray(String[] a,
int offset,
int length)
Create a list of quoted strings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String BEGIN_COMMENT
public static final String END_COMMENT
public static final Pattern SCRIPT_PATTERN
public static final Pattern SCRIPT_INCLUDE_PATTERN
Constructor Detail |
---|
public ScriptUtils()
Method Detail |
---|
public static String ensureValidScriptTags(String input)
BEGIN_COMMENT
inserted before the logic block and
END_COMMENT
inserted after the logic block.
input
- The string to replace tags on
public static void parseJSIncludes(String input, StringBuffer appender)
tags found
in input string. The formatted and dojo-bound script loading logic
is appended to the appender
parameter.
input
- The string to grab js includes fromappender
- The buffer to add dojo js load calls intopublic static String toJsStringArray(String[] a, int offset, int length)
public static String toJsStringArray(Iterator values)
public static String escapeJavaScriptHash(String jshash)
jshash
-
public static Map createParamsMap(String initializer, String delim)
initializer
- the initializer.
public static String getFieldId(org.apache.tapestry.IComponent comp, String uniqueId)
comp
- the component to extract the id from.uniqueId
- optional unique id. Overrides the component's id.
public static org.apache.tapestry.IComponent getContainer(org.apache.tapestry.IComponent comp)
comp
- the component.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |