本文整理汇总了Java中com.alibaba.fastjson.serializer.SerializeConfig.getGlobalInstance方法的典型用法代码示例。如果您正苦于以下问题:Java SerializeConfig.getGlobalInstance方法的具体用法?Java SerializeConfig.getGlobalInstance怎么用?Java SerializeConfig.getGlobalInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.fastjson.serializer.SerializeConfig
的用法示例。
在下文中一共展示了SerializeConfig.getGlobalInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.alibaba.fastjson.serializer.SerializeConfig; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
SerializeConfig config = SerializeConfig.getGlobalInstance();
config.put(MediaContent.class, new MediaContentSerializer());
config.put(Media.class, new MediaSerializer());
config.put(Image.class, new ImageSerializer());
System.out.println(System.getProperty("java.vm.name") + " " + System.getProperty("java.runtime.version"));
List<String> arguments = ManagementFactory.getRuntimeMXBean().getInputArguments();
System.out.println(arguments);
MediaContent content = EishayDecodeBytes.instance.getContent();
String text = encode(content);
System.out.println(text);
for (int i = 0; i < 10; ++i) {
perf(text);
}
}
示例2: FastJsonConfig
import com.alibaba.fastjson.serializer.SerializeConfig; //导入方法依赖的package包/类
/**
* init param.
*/
public FastJsonConfig() {
this.charset = Charset.forName("UTF-8");
this.serializeConfig = SerializeConfig.getGlobalInstance();
this.parserConfig = new ParserConfig();
this.serializerFeatures = new SerializerFeature[] {
SerializerFeature.BrowserSecure
};
this.serializeFilters = new SerializeFilter[0];
this.features = new Feature[0];
}
示例3: JSONPath
import com.alibaba.fastjson.serializer.SerializeConfig; //导入方法依赖的package包/类
public JSONPath(String path){
this(path, SerializeConfig.getGlobalInstance(), ParserConfig.getGlobalInstance());
}
示例4: benchSetup
import com.alibaba.fastjson.serializer.SerializeConfig; //导入方法依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) {
testObject = TestObject.createTestObject();
byteArrayOutputStream = new ByteArrayOutputStream();
serializeConfig = SerializeConfig.getGlobalInstance();
}