|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.itim.fesiextensions.DataMapper
public class DataMapper
This class provides helper methods to convert object between FESI script environment and Java In the following case, we need to consider about object conversion from FESI to JAVA: 1. When a JAVA method is invoked within FESI script environment. 2. When object is returned from FESI script FESI would try to convert the script object into Java Object, for example, String in FESI would be converted to java.lang.String in Java. In the case that FESI does not know how to do the conversion, it would pass in a FESI.data.JSObject, in this case, conversion must be done explicitly using scriptToJava() method In the case that a JAVA object returned to FESI via registered Script Object, FESI will automatically convert it to FESI object; or if it does not know how to convert, it makes a wrapper object out of it, so that the Java object can be used in FESI script environment. If a JAVA object is registered as a Script Object, or returned to FESI via another Java method, it is recommended that a wrapper object to be created to wrap the original JAVA object and then invoke JSGlobalObject.makeObjectWrapper() to wrap it in FESI. {{TODO}}Methods in this class should be used in all itim FESI wrapper class to convert input parameters passed in from FESI and data returned to FESI if it is necessary. Because of the risks involved with possible regression, we only used this method in the get() and set() methods in RelevantDataWrapper class, and it is not validated against all other wrapper methods in 4.6 module, and an enhancement request (S15143) is created to revist this issue in the next ITIM release.
Constructor Summary | |
---|---|
DataMapper()
Deprecated. Constructor |
Method Summary | |
---|---|
java.lang.Object |
convertJSObjectToJava(FESI.jslib.JSObject jsObj)
Deprecated. Converts a FESI script object into a matching JAVA object |
java.lang.Object |
javaToScriptWrapper(java.lang.Object javaObj)
Deprecated. Returns the wrapper object for a Java object to be returned to FESI Script {{TODO}}The implementation does not take advantage of the JSGlobalObjectFactory to locate the corresponding JSxxxFactory object, it will require some refactory work to do so. |
java.lang.Object |
scriptToJava(java.lang.Object scriptObj)
Deprecated. Converts a FESI script object into a matching JAVA object If global factory exists, try to convert using it; |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataMapper()
Method Detail |
---|
public java.lang.Object scriptToJava(java.lang.Object scriptObj) throws ScriptEvaluatorException
scriptObj
- FESI script object
ScriptEvaluatorException
- when conversion wasn't successfulpublic java.lang.Object javaToScriptWrapper(java.lang.Object javaObj)
javaObj
- A Java Object
public java.lang.Object convertJSObjectToJava(FESI.jslib.JSObject jsObj) throws ScriptEvaluatorException
jsObj
- FESI script object
ScriptEvaluatorException
- when conversion wasn't successful
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |