This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function logClass(target: any) { | |
// save a reference to the original constructor | |
var original = target; | |
// a utility function to generate instances of a class | |
function construct(constructor, args) { | |
var c : any = function () { | |
return constructor.apply(this, args); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package zebulon.test.zebulon.test.fastjson; | |
import android.text.TextUtils; | |
import com.alibaba.fastjson.JSON; | |
import com.alibaba.fastjson.TypeReference; | |
import com.alibaba.fastjson.parser.DefaultJSONParser; | |
import com.alibaba.fastjson.parser.ParserConfig; | |
import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer; | |
import com.alibaba.fastjson.serializer.JSONSerializer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String wrapStringForJsCallParams(String str){ | |
if(TextUtils.isEmpty(str)) return str; | |
str = str.replaceAll("\\\\" , "\\\\\\\\"); | |
str = str.replaceAll("'" , "\\\\'"); | |
str = str.replaceAll("\"" , "\\\\\""); | |
return str; | |
} |