org.apache.ode.extension.e4x
Class TopLevelFunctions

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by org.mozilla.javascript.IdScriptableObject
          extended by org.mozilla.javascript.ImporterTopLevel
              extended by org.apache.ode.extension.e4x.TopLevelFunctions
All Implemented Interfaces:
java.io.Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.IdFunctionCall, org.mozilla.javascript.Scriptable

public class TopLevelFunctions
extends org.mozilla.javascript.ImporterTopLevel

Provides (global) top-level functions like "print" and "load" to our JS/E4X environment.

Author:
Tammo van Lessen (University of Stuttgart)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
TopLevelFunctions(ExtensionContext ectx, org.mozilla.javascript.Context cx, java.net.URI duDir)
           
 
Method Summary
static java.lang.String activityName(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          This method is exposed to the JS environment and returns the activity name of the running PI.
static org.mozilla.javascript.xml.XMLObject dom2js(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          This method is exposed to the JS environment and allows converting from W3C DOM nodes to JavaScript E4X objects.
static java.lang.String domToString(org.w3c.dom.Node n)
           
static org.w3c.dom.Node js2dom(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          This method is exposed to the JS environment and allows converting from JavaScript E4X objects to W3C DOM nodes.
static void load(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          This methods is exposed to the JS environment and supports loading JavaScript libraries from the deployment unit directory.
static long pid(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          This method is exposed to the JS environment and returns the process instance ID of the running PI.
static void print(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          Allows printing debug output to the console.
static void throwFault(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          This method is exposed to the JS environment and allows users to throw BPEL faults.
 
Methods inherited from class org.mozilla.javascript.ImporterTopLevel
execIdCall, findPrototypeId, get, getClassName, has, importPackage, init, initPrototypeId, initStandardObjects
 
Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultPut, delete, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, getAttributes, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, instanceIdInfo, put, setAttributes, setInstanceIdValue
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, equivalentValues, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, hasInstance, hasProperty, hasProperty, isConst, isGetterOrSetter, isSealed, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopLevelFunctions

public TopLevelFunctions(ExtensionContext ectx,
                         org.mozilla.javascript.Context cx,
                         java.net.URI duDir)
                  throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

print

public static void print(org.mozilla.javascript.Context cx,
                         org.mozilla.javascript.Scriptable thisObj,
                         java.lang.Object[] args,
                         org.mozilla.javascript.Function funObj)
Allows printing debug output to the console. Output will be redirected to the logger associated with org.apache.ode.extension.e4x.JavaScriptConsole. The target log level is INFO.


load

public static void load(org.mozilla.javascript.Context cx,
                        org.mozilla.javascript.Scriptable thisObj,
                        java.lang.Object[] args,
                        org.mozilla.javascript.Function funObj)
This methods is exposed to the JS environment and supports loading JavaScript libraries from the deployment unit directory.


pid

public static long pid(org.mozilla.javascript.Context cx,
                       org.mozilla.javascript.Scriptable thisObj,
                       java.lang.Object[] args,
                       org.mozilla.javascript.Function funObj)
This method is exposed to the JS environment and returns the process instance ID of the running PI.


activityName

public static java.lang.String activityName(org.mozilla.javascript.Context cx,
                                            org.mozilla.javascript.Scriptable thisObj,
                                            java.lang.Object[] args,
                                            org.mozilla.javascript.Function funObj)
This method is exposed to the JS environment and returns the activity name of the running PI.


js2dom

public static org.w3c.dom.Node js2dom(org.mozilla.javascript.Context cx,
                                      org.mozilla.javascript.Scriptable thisObj,
                                      java.lang.Object[] args,
                                      org.mozilla.javascript.Function funObj)
This method is exposed to the JS environment and allows converting from JavaScript E4X objects to W3C DOM nodes.


dom2js

public static org.mozilla.javascript.xml.XMLObject dom2js(org.mozilla.javascript.Context cx,
                                                          org.mozilla.javascript.Scriptable thisObj,
                                                          java.lang.Object[] args,
                                                          org.mozilla.javascript.Function funObj)
This method is exposed to the JS environment and allows converting from W3C DOM nodes to JavaScript E4X objects.


throwFault

public static void throwFault(org.mozilla.javascript.Context cx,
                              org.mozilla.javascript.Scriptable thisObj,
                              java.lang.Object[] args,
                              org.mozilla.javascript.Function funObj)
                       throws FaultException
This method is exposed to the JS environment and allows users to throw BPEL faults.

Throws:
FaultException

domToString

public static java.lang.String domToString(org.w3c.dom.Node n)
                                    throws javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerException


Copyright © 2015 WSO2. All Rights Reserved.