public class TMLScript
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TMLScript.ObjectType |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
callMethod(java.lang.Object object,
java.lang.String method)
Calls a method without paramters or retrieves a property from a TMLScript object
|
java.lang.Object |
callMethod(java.lang.Object object,
java.lang.String method,
java.util.Map<java.lang.String,java.lang.Object> namedParams,
java.util.List<java.lang.Object> unnamedParams)
Calls a method or retrieves a property from a TMLScript object.
|
java.lang.Object |
callMethod(java.lang.Object object,
java.lang.String method,
java.util.Map<java.lang.String,java.lang.Object> namedParams,
java.util.List<java.lang.Object> unnamedParams,
CallMethodConfig config)
Calls a method or retrieves a property from a TMLScript object.
|
java.lang.Object |
createObject(Design resolve)
Creates a WebTML object from a script module
|
java.lang.Object |
createObject(Design resolve,
java.util.List<java.lang.Object> params)
Creates a WebTML object from a script module
|
java.lang.Object |
createObject(Design resolve,
java.util.Map<java.lang.String,java.lang.Object> namedParams)
Creates a WebTML object from a script module
|
java.lang.Object |
createObject(Design resolve,
TMLScript.ObjectType objectType)
Creates a WebTML object from a script module
|
java.lang.Object |
createObject(Design design,
TMLScript.ObjectType objectType,
java.util.Map<java.lang.String,java.lang.Object> namedParams,
java.util.List<java.lang.Object> unnamedParams)
Creates a WebTML object from a script module
|
<T> T |
descriptify(java.lang.Object obj,
java.lang.Class<T> expectedType)
Converts TMLScript values to the corresponding Java types, eventually descending into JS arrays/objects to convert them to Lists/Maps.
|
<T> T |
descriptify(java.lang.Object obj,
java.lang.Class<T> expectedType,
DescriptificationConfig config)
Converts TMLScript values to the corresponding Java types, eventually descending into JS arrays/objects.
|
java.lang.Object |
exportJsonData(javax.json.JsonStructure dataObject)
Converts Json data into the TMLScript form, ready to be injected to a script
|
boolean |
hasProperty(java.lang.Object object,
java.lang.String prop)
Returns if the given TMLScript object has a property of the given name
|
javax.json.JsonStructure |
importJsonData(java.lang.Object dataObject)
Converts JSON data objects created in TMLScript into their Java form
|
boolean |
isNativeObject(java.lang.Object obj)
Determines if the given object is a native TMLScript object
|
java.lang.Object |
runExpression(Context context,
java.lang.String expression)
Runs a TMLScript expression
|
java.lang.Object |
runExpression(Context cx,
java.lang.String expression,
java.util.Map<java.lang.String,java.lang.Object> extraObjects)
Runs a TMLScript expression
|
java.lang.Object |
runExpression(Design design,
Context cx,
java.lang.String expression)
Runs a TMLScript expression
|
java.lang.Object |
runExpression(Design design,
Context cx,
java.lang.String expression,
java.util.Map<java.lang.String,java.lang.Object> extraObjects)
Runs a TMLScript expression
|
java.lang.Object |
runExpression(Design design,
java.lang.String expression)
Runs a TMLScript expression
Uses the WebTML context of the environment and is therefor only usable in WebTML/TMLScript environments.
|
java.lang.Object |
runScript(Context context,
java.lang.String expression)
Runs a TMLScript script
|
java.lang.Object |
runScript(Context cx,
java.lang.String expression,
java.util.Map<java.lang.String,java.lang.Object> extraObjects)
Runs a TMLScript script
|
java.lang.Object |
runScript(Design design,
Context cx,
java.lang.String expression)
Runs a TMLScript script
|
java.lang.Object |
runScript(Design design,
Context cx,
java.lang.String expression,
java.util.Map<java.lang.String,java.lang.Object> extraObjects)
Runs a TMLScript script
|
java.lang.Object |
runScript(Design design,
java.lang.String expression)
Runs a TMLScript script
Uses the WebTML context of the environment and is therefor only usable in WebTML/TMLScript environments.
|
java.lang.Object |
scriptify(java.lang.Object obj,
java.lang.Object scope)
Converts Java objects to the corresponding Java types.
|
public java.lang.Object runExpression(Design design, java.lang.String expression) throws de.innovationgate.webgate.api.WGException
design
- Base design context to run the expression underexpression
- The expressionWGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.Object runExpression(Context context, java.lang.String expression) throws de.innovationgate.webgate.api.WGException
context
- WebTML context under which the expression runs and whose design context is usedexpression
- The expressionWGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.Object runExpression(Design design, Context cx, java.lang.String expression) throws de.innovationgate.webgate.api.WGException
design
- Base design context to run the expression forcx
- WebTML context under which the expression runsexpression
- The expressionWGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.Object runExpression(Design design, Context cx, java.lang.String expression, java.util.Map<java.lang.String,java.lang.Object> extraObjects) throws de.innovationgate.webgate.api.WGException
design
- Base design context to run the expression forcx
- WebTML context under which the expression runsexpression
- The expressionextraObjects
- Objects to available to the expression. Keys are object names, their values the objects.WGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.Object runExpression(Context cx, java.lang.String expression, java.util.Map<java.lang.String,java.lang.Object> extraObjects) throws de.innovationgate.webgate.api.WGException
cx
- WebTML context under which the expression runs and whose design context is usedexpression
- The expressionextraObjects
- Objects to available to the expression. Keys are object names, their values the objects.WGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.Object runScript(Design design, java.lang.String expression) throws de.innovationgate.webgate.api.WGException
design
- Base design context to run the script underexpression
- The scriptWGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.Object runScript(Context context, java.lang.String expression) throws de.innovationgate.webgate.api.WGException
context
- WebTML context under which the expression runs and whose design context is usedexpression
- The scriptWGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.Object runScript(Design design, Context cx, java.lang.String expression) throws de.innovationgate.webgate.api.WGException
design
- Base design context to run the script undercx
- WebTML context under which the expression runsexpression
- The scriptWGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.Object runScript(Design design, Context cx, java.lang.String expression, java.util.Map<java.lang.String,java.lang.Object> extraObjects) throws de.innovationgate.webgate.api.WGException
design
- Base design context to run the script undercx
- WebTML context under which the expression runsexpression
- The scriptextraObjects
- Objects to available to the script. Keys are object names, their values the objects.WGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.Object runScript(Context cx, java.lang.String expression, java.util.Map<java.lang.String,java.lang.Object> extraObjects) throws de.innovationgate.webgate.api.WGException
cx
- WebTML context under which the expression runs and whose design context is usedexpression
- The scriptextraObjects
- Objects to available to the script. Keys are object names, their values the objects.WGAServerException
de.innovationgate.webgate.api.WGException
public javax.json.JsonStructure importJsonData(java.lang.Object dataObject) throws de.innovationgate.webgate.api.WGException
dataObject
- The data object created in TMLScriptde.innovationgate.webgate.api.WGException
public <T> T descriptify(java.lang.Object obj, java.lang.Class<T> expectedType) throws de.innovationgate.webgate.api.WGException
DescriptificationConfig
.obj
- The TMLScript valueexpectedType
- The java type expected to be returned for the top level object. Will throw exception if the converted type does not match it.de.innovationgate.webgate.api.WGException
public <T> T descriptify(java.lang.Object obj, java.lang.Class<T> expectedType, DescriptificationConfig config) throws de.innovationgate.webgate.api.WGException
obj
- The TMLScript valueexpectedType
- The java type expected to be returned for the top level object. Will throw exception if the converted type does not match it.config
- Configures descriptificationde.innovationgate.webgate.api.WGException
public java.lang.Object scriptify(java.lang.Object obj, java.lang.Object scope) throws de.innovationgate.webgate.api.WGException
obj
- The object to scriptifyscope
- The JS object in whose scope the scriptified objects should livede.innovationgate.webgate.api.WGException
public java.lang.Object exportJsonData(javax.json.JsonStructure dataObject) throws de.innovationgate.webgate.api.WGException
dataObject
- The data object created in TMLScriptde.innovationgate.webgate.api.WGException
public boolean isNativeObject(java.lang.Object obj) throws de.innovationgate.webgate.api.WGException
obj
- The objectde.innovationgate.webgate.api.WGException
public java.lang.Object createObject(Design design, TMLScript.ObjectType objectType, java.util.Map<java.lang.String,java.lang.Object> namedParams, java.util.List<java.lang.Object> unnamedParams) throws de.innovationgate.webgate.api.WGException
design
- The design reference pointing to the script moduleThe
- type of TMLScript object to createnamedParams
- Named parameters for the object constructor.unnamedParams
- Unnamed parameters for the object constructor.. Will be inserted on parameters that do not match named or substituted param names.de.innovationgate.webgate.api.WGException
public java.lang.Object createObject(Design resolve) throws de.innovationgate.webgate.api.WGException
design
- The design reference pointing to the script modulede.innovationgate.webgate.api.WGException
public java.lang.Object createObject(Design resolve, TMLScript.ObjectType objectType) throws de.innovationgate.webgate.api.WGException
design
- The design reference pointing to the script modulede.innovationgate.webgate.api.WGException
public java.lang.Object createObject(Design resolve, java.util.Map<java.lang.String,java.lang.Object> namedParams) throws de.innovationgate.webgate.api.WGException
design
- The design reference pointing to the script modulenamedParams
- Named parameters for the object constructor.de.innovationgate.webgate.api.WGException
public java.lang.Object createObject(Design resolve, java.util.List<java.lang.Object> params) throws de.innovationgate.webgate.api.WGException
design
- The design reference pointing to the script moduleparams
- Unnamed parameters for the object constructor.. Will be inserted on parameters that do not match named or substituted param names.de.innovationgate.webgate.api.WGException
public java.lang.Object callMethod(java.lang.Object object, java.lang.String method, java.util.Map<java.lang.String,java.lang.Object> namedParams, java.util.List<java.lang.Object> unnamedParams) throws de.innovationgate.webgate.api.WGException
object
- The objectmethod
- The method/property name. Use dots to chain multiple method calls/property retrievals together.namedParams
- Named parameters for method arguments. Assigned to arguments of the same nameunnamedParams
- Unnamed (ordinal) parameters for method arguments. Assigned to unnamed regular method arguments.config
- Detail configuration of/information about the method callde.innovationgate.webgate.api.WGException
public java.lang.Object callMethod(java.lang.Object object, java.lang.String method, java.util.Map<java.lang.String,java.lang.Object> namedParams, java.util.List<java.lang.Object> unnamedParams, CallMethodConfig config) throws de.innovationgate.webgate.api.WGException
object
- The objectmethod
- The method/property name. Use dots to chain multiple method calls/property retrievals together.namedParams
- Named parameters for method arguments. Assigned to arguments of the same nameunnamedParams
- Unnamed (ordinal) parameters for method arguments. Assigned to unnamed regular method arguments.config
- Detail configuration of/information about the method callde.innovationgate.webgate.api.WGException
public java.lang.Object callMethod(java.lang.Object object, java.lang.String method) throws de.innovationgate.webgate.api.WGException
object
- The objectmethod
- The method/property name. Use dots to chain multiple method calls/property retrievals together.de.innovationgate.webgate.api.WGException
public boolean hasProperty(java.lang.Object object, java.lang.String prop)
object
- The objectprop
- The property name