public interface ScriptExpr
If the expression have properties or methods this interface provides methods to generate JavaScript code to access or call them.
ScriptUtil.createScriptExpr(Object)| Modifier and Type | Method and Description |
|---|---|
String |
getCallMethodCode(String methodName,
Object[] params)
Generates the JavaScript code to call the specified method of the result of this expression.
|
String |
getCallMethodCode(String methodName,
Object[] params,
boolean endSentence)
Generates the JavaScript code to call the specified method of the result of this expression.
|
String |
getCode()
Returns the JavaScript code of this expression.
|
String |
getGetPropertyCode(String propName)
Generates the JavaScript code to get the value of the specified property of the result of this expression.
|
String |
getGetPropertyCode(String propName,
boolean endSentence)
Generates the JavaScript code to get the value of the specified property of the result of this expression.
|
String |
getSetPropertyCode(String propName,
Object value)
Generates the JavaScript code to set a value to the specified property of the result of this expression.
|
String |
getSetPropertyCode(String propName,
Object value,
boolean endSentence)
Generates the JavaScript code to set a value to the specified property of the result of this expression.
|
String getCode()
The specified object is converted to JavaScript following the rules
of ScriptUtil.toScript(Object) with an exception: if a String the
content is not converted to a JavaScript string literal.
String getSetPropertyCode(String propName, Object value, boolean endSentence)
propName - property name.value - the value to set. Is converted to JavaScript calling ScriptUtil.toScript(Object).endSentence - if true adds a ; at the end.ScriptUtil.getSetPropertyCode(Object,String,Object,boolean)String getSetPropertyCode(String propName, Object value)
propName - property name.value - the value to set. Is converted to JavaScript calling ScriptUtil.toScript(Object).ScriptUtil.getSetPropertyCode(Object,String,Object)String getGetPropertyCode(String propName, boolean endSentence)
propName - property name.endSentence - if true adds a ; at the end.ScriptUtil.getGetPropertyCode(Object,String,boolean)String getGetPropertyCode(String propName)
propName - property name.ScriptUtil.getGetPropertyCode(Object,String)String getCallMethodCode(String methodName, Object[] params, boolean endSentence)
methodName - method name.params - the parameter list. Are converted to JavaScript calling ScriptUtil.toScript(Object).endSentence - if true adds a ; at the end.ScriptUtil.getCallMethodCode(Object,String,Object[],boolean)String getCallMethodCode(String methodName, Object[] params)
methodName - method name.params - the parameter list. Are converted to JavaScript calling ScriptUtil.toScript(Object).ScriptUtil.getCallMethodCode(Object,String,Object[])Copyright © Innowhere Software, Jose Maria Arranz Santamaria.