Java Code Examples for com.alibaba.fastjson.JSON#DEFAULT_PARSER_FEATURE
The following examples show how to use
com.alibaba.fastjson.JSON#DEFAULT_PARSER_FEATURE .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: actframework File: FastJsonKvCodecTest.java License: Apache License 2.0 | 5 votes |
@BeforeClass public static void prepare() { SerializeConfig config = SerializeConfig.getGlobalInstance(); config.put(KV.class, FastJsonKvCodec.INSTANCE); config.put(KVStore.class, FastJsonKvCodec.INSTANCE); ParserConfig parserConfig = ParserConfig.getGlobalInstance(); parserConfig.putDeserializer(KV.class, FastJsonKvCodec.INSTANCE); parserConfig.putDeserializer(KVStore.class, FastJsonKvCodec.INSTANCE); JSON.DEFAULT_PARSER_FEATURE = Feature.config(JSON.DEFAULT_PARSER_FEATURE, Feature.UseBigDecimal, false); }
Example 2
Source Project: aliyun-tsdb-java-sdk File: TSDBClientTest.java License: Apache License 2.0 | 4 votes |
@Before public void setup() { JSON.DEFAULT_PARSER_FEATURE &= ~Feature.UseBigDecimal.getMask(); }
Example 3
Source Project: uavstack File: JSONReaderScanner.java License: Apache License 2.0 | 4 votes |
public JSONReaderScanner(String input){ this(input, JSON.DEFAULT_PARSER_FEATURE); }
Example 4
Source Project: uavstack File: JSONReaderScanner.java License: Apache License 2.0 | 4 votes |
public JSONReaderScanner(char[] input, int inputLength){ this(input, inputLength, JSON.DEFAULT_PARSER_FEATURE); }
Example 5
Source Project: uavstack File: JSONReaderScanner.java License: Apache License 2.0 | 4 votes |
public JSONReaderScanner(Reader reader){ this(reader, JSON.DEFAULT_PARSER_FEATURE); }
Example 6
Source Project: uavstack File: JSONScanner.java License: Apache License 2.0 | 4 votes |
public JSONScanner(String input){ this(input, JSON.DEFAULT_PARSER_FEATURE); }
Example 7
Source Project: uavstack File: JSONScanner.java License: Apache License 2.0 | 4 votes |
public JSONScanner(char[] input, int inputLength){ this(input, inputLength, JSON.DEFAULT_PARSER_FEATURE); }
Example 8
Source Project: hsweb-framework File: HswebAutoConfiguration.java License: Apache License 2.0 | 4 votes |
@Bean @Primary @ConfigurationProperties(prefix = "fastjson") public FastJsonGenericHttpMessageConverter fastJsonGenericHttpMessageConverter(EntityFactory entityFactory) { JSON.DEFAULT_PARSER_FEATURE |= Feature.DisableFieldSmartMatch.getMask(); FastJsonGenericHttpMessageConverter converter = new FastJsonGenericHttpMessageConverter(); converter.setFeatures( SerializerFeature.WriteNullListAsEmpty, SerializerFeature.WriteNullNumberAsZero, SerializerFeature.WriteNullBooleanAsFalse ); converter.setConverters(converters); ParserConfig.global = new ParserConfig() { @Override public ObjectDeserializer getDeserializer(Type type) { ObjectDeserializer derializer = getDeserializers().get(type); if (derializer != null) { return derializer; } if (type instanceof Class) { Class classType = ((Class) type); if (classType.isEnum()) { return super.getDeserializer(type); } checkAutoType(type.getTypeName(), ((Class) type)); if (Modifier.isAbstract(classType.getModifiers()) || Modifier.isInterface(classType.getModifiers())) { Class realType; if (entityFactory != null && (realType = entityFactory.getInstanceType(classType)) != null) { return new JavaBeanDeserializer(this, realType, type); } } else { return new JavaBeanDeserializer(this, classType); } } return super.getDeserializer(type); } }; //fastjson.parser.autoTypeAccept ParserConfig.global.addAccept("org.hswebframework.web.entity."); ParserConfig.global.addDeny("org.hswebframework.ezorm.core.param.SqlTerm"); return converter; }