|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.xml.xpath.Function com.novell.xsl.extensions.ECMAScriptFunction com.novell.xsl.extensions.ECMAScriptFunctionImpl
This class represents a java class member with a particular name. This class is only used during the parsing stage. The getInstance() member returns the actual JavaMethodInstance object that is used by the FunctionCall object.
Field Summary | |
protected ClassLoader |
classLoader
|
static String |
ECMASCRIPT_EXTENSION_FUNCTION_NAMESPACE
The start of the URI used to signify extension functions and non-built in extension elements: "http://www.novell.com/nxsl/ecmascript" |
static String |
ECMASCRIPT_SCOPE_PROPERTY
The name of the property in the ExpressionContext that holds the ECMAScript execution environment |
protected static Class |
nativeReturnType
|
protected static Class |
undefinedReturnType
|
Fields inherited from class com.novell.xsl.extensions.ECMAScriptFunction |
defaultParameterType, defaultReturnType, optArgs, scriptAttr |
Constructor Summary | |
ECMAScriptFunctionImpl(ExpandedQName name,
ClassLoader classLoader)
Construct a placeholder for the function library for the desired java class member(s). |
Method Summary | |
boolean |
available(ExpressionContext eContext)
Checks whether or not the function that this object represents actual has an implementation |
static com.novell.soa.script.mozilla.javascript.Scriptable |
createScope(com.novell.soa.script.mozilla.javascript.Context jsContext)
Create a rhino scope to work with |
static ExpressionValue |
ECMAScriptToExpressionValue(Object value)
Convert a value returned from ECMAScript to an ExpressionValue to return back to XPATH |
static Object |
evaluate(ExpressionContext eContext,
String script,
String uri,
int line,
ClassLoader classLoader)
Evaluate a string as ECMAScript |
static Object |
evaluate(ExpressionContext eContext,
URL externalScript,
String encoding,
ClassLoader classLoader)
Evaluate a resource defined by a URI as ECMAScript |
static Object |
evaluateCommandLineScripts(List scripts,
ClassLoader classLoader)
Evaluate scripts passed in on the command line |
static Object |
expressionValueToECMAScript(ExpressionValue expressionValue,
com.novell.soa.script.mozilla.javascript.Scriptable scope)
Wrap or convert an ExpressionValue for use in ECMAScript |
static com.novell.soa.script.mozilla.javascript.Scriptable |
getScope(ExpressionContext eContext,
com.novell.soa.script.mozilla.javascript.Context jsContext)
Get (or create) a scope to work with from the ExpressionContext |
ExpressionValue |
invoke(Object[] args)
Invoke the function using the passed list of arguments. |
static void |
parse(StylesheetParser stylesheetParser,
Element element,
URL baseURI,
ClassLoader classLoader)
Parses the specified ecmascript:script element and returns the
result as a ECMAScriptParser object. |
Methods inherited from class com.novell.xsl.extensions.ECMAScriptFunction |
create, isECMAScriptAvailable |
Methods inherited from class com.novell.xml.xpath.Function |
getInstance, getSignature, isConstant, registerForReset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String ECMASCRIPT_EXTENSION_FUNCTION_NAMESPACE
"http://www.novell.com/nxsl/ecmascript"
public static final String ECMASCRIPT_SCOPE_PROPERTY
protected static final Class undefinedReturnType
protected static final Class nativeReturnType
protected ClassLoader classLoader
Constructor Detail |
public ECMAScriptFunctionImpl(ExpandedQName name, ClassLoader classLoader)
name
- The name of the functionclassLoader
- class loader to use (null for default)Method Detail |
public ExpressionValue invoke(Object[] args) throws XPathEvaluationException
invoke
in class ECMAScriptFunction
args
- List of arguments.
XPathEvaluationException
public boolean available(ExpressionContext eContext)
available
in class ECMAScriptFunction
eContext
- the ExpressionContext to get the scope from or put the new scope into
public static Object expressionValueToECMAScript(ExpressionValue expressionValue, com.novell.soa.script.mozilla.javascript.Scriptable scope) throws XPathConversionException
expressionValue
- The value passed in from XPATH as an argument
XPathConversionException
public static ExpressionValue ECMAScriptToExpressionValue(Object value)
value
- The value returned from ECMAScript
public static void parse(StylesheetParser stylesheetParser, Element element, URL baseURI, ClassLoader classLoader) throws XSLTParserException
ecmascript:script
element and returns the
result as a ECMAScriptParser
object.
stylesheetParser
- The StylesheetParser
for which the element is to be parsed.element
- the element to be parsedclassLoader
- class loader to use (null for default)
XSLTParserException
- if a fatal error occurs during parsingpublic static com.novell.soa.script.mozilla.javascript.Scriptable createScope(com.novell.soa.script.mozilla.javascript.Context jsContext)
jsContext
- Rhino Context to use to create the scope
public static com.novell.soa.script.mozilla.javascript.Scriptable getScope(ExpressionContext eContext, com.novell.soa.script.mozilla.javascript.Context jsContext)
eContext
- the ExpressionContext to get the scope from or put the new scope intojsContext
- the Rhino context to use to create the scope
public static Object evaluate(ExpressionContext eContext, String script, String uri, int line, ClassLoader classLoader)
eContext
- the ExpressionContext to get the scope from or put the new scope intoscript
- The scripturi
- The URI of the scriptline
- The line number within the URI where the script startedclassLoader
- class loader to use (null for default)
public static Object evaluate(ExpressionContext eContext, URL externalScript, String encoding, ClassLoader classLoader) throws IOException
eContext
- the ExpressionContext to get the scope from or put the new scope intoexternalScript
- URI of the external scriptencoding
- the character encoding of the external script or null to use the default encodingclassLoader
- class loader to use (null for default)
IOException
public static Object evaluateCommandLineScripts(List scripts, ClassLoader classLoader) throws XSLException, IOException
scripts
- a list of Strings containing URI of scripts to evaluateclassLoader
- class loader to use (null for default)
XSLException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |