|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.helma.util.ScriptUtils
public class ScriptUtils
A collection of Rhino utility methods.
| Constructor Summary | |
|---|---|
ScriptUtils()
|
|
| Method Summary | |
|---|---|
static void |
checkArguments(java.lang.Object[] args,
int min,
int max)
Make sure that number of arguments is valid. |
static org.mozilla.javascript.Scriptable |
getClassOrObjectProto(org.mozilla.javascript.Scriptable scope,
java.lang.String className)
Return a class prototype, or the object prototype if the class is not defined. |
static java.lang.Object |
getObjectArgument(java.lang.Object[] args,
int pos)
Get an argument as object |
static java.lang.String |
getStringArgument(java.lang.Object[] args,
int pos)
Get an argument as string |
static java.lang.Object |
javaToJS(java.lang.Object obj,
org.mozilla.javascript.Scriptable scope)
Coerce/wrap a java object to a JS object, and mask Lists and Maps as native JS objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ScriptUtils()
| Method Detail |
|---|
public static java.lang.Object javaToJS(java.lang.Object obj,
org.mozilla.javascript.Scriptable scope)
obj - the object to coerce/wrapscope - the scope
public static org.mozilla.javascript.Scriptable getClassOrObjectProto(org.mozilla.javascript.Scriptable scope,
java.lang.String className)
scope - the scopeclassName - the class name
public static void checkArguments(java.lang.Object[] args,
int min,
int max)
args - the argument arraymin - the minimum number of argumentsmax - the maximum number of arguments
java.lang.IllegalArgumentException - if the number of arguments is not valid
public static java.lang.String getStringArgument(java.lang.Object[] args,
int pos)
args - the argument arraypos - the position of the requested argument
public static java.lang.Object getObjectArgument(java.lang.Object[] args,
int pos)
args - the argument arraypos - the position of the requested argument
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||