当前位置: 首页>>代码示例>>Java>>正文


Java JSON.DEFAULT_PARSER_FEATURE属性代码示例

本文整理汇总了Java中com.alibaba.fastjson.JSON.DEFAULT_PARSER_FEATURE属性的典型用法代码示例。如果您正苦于以下问题:Java JSON.DEFAULT_PARSER_FEATURE属性的具体用法?Java JSON.DEFAULT_PARSER_FEATURE怎么用?Java JSON.DEFAULT_PARSER_FEATURE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.alibaba.fastjson.JSON的用法示例。


在下文中一共展示了JSON.DEFAULT_PARSER_FEATURE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test_date_2

public void test_date_2() throws Exception {
    int features = JSON.DEFAULT_PARSER_FEATURE;
    DefaultJSONParser parser = new DefaultJSONParser("new Date(1294552193254)", ParserConfig.getGlobalInstance(), features);

    java.sql.Timestamp date = parser.parseObject(java.sql.Timestamp.class);

    Assert.assertEquals(new java.sql.Timestamp(1294552193254L), date);
    parser.close();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:DateParserTest_sql_timestamp.java

示例2: test_date_1

public void test_date_1() throws Exception {
    int features = JSON.DEFAULT_PARSER_FEATURE;
    features = Feature.config(features, Feature.AllowISO8601DateFormat, true);
    DefaultJSONParser parser = new DefaultJSONParser("\"2011-01-09T13:49:53.254\"", ParserConfig.getGlobalInstance(), features);

    java.util.Date date = parser.parseObject(java.util.Date.class);

    Assert.assertEquals(new java.util.Date(1294552193254L), date);
    parser.close();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:DateParserTest.java

示例3: test_date_2

public void test_date_2() throws Exception {
    int features = JSON.DEFAULT_PARSER_FEATURE;
    DefaultJSONParser parser = new DefaultJSONParser("new Date(1294552193254)", ParserConfig.getGlobalInstance(), features);

    java.util.Date date = parser.parseObject(java.util.Date.class);

    Assert.assertEquals(new java.util.Date(1294552193254L), date);
    parser.close();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:DateParserTest.java

示例4: test_date_6

public void test_date_6() throws Exception {
    int features = JSON.DEFAULT_PARSER_FEATURE;
    features = Feature.config(features, Feature.AllowISO8601DateFormat, true);

    java.util.Date date = JSON.parseObject("{d:\"2011-01-09T13:49:53\"}", Entity.class, Feature.AllowISO8601DateFormat).getD();

    Assert.assertEquals(new java.util.Date(1294552193000L), date);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:DateParserTest.java

示例5: test_url

public void test_url() throws Exception {
    UUID id = UUID.randomUUID();
    Assert.assertEquals(id, JSON.parseObject("'" + id.toString() + "'", UUID.class));

    Assert.assertEquals(null, JSON.parseObject("null", UUID.class));

    DefaultJSONParser parser = new DefaultJSONParser("null", ParserConfig.getGlobalInstance(), JSON.DEFAULT_PARSER_FEATURE);
    Assert.assertEquals(null, MiscCodec.instance.deserialze(parser, null, null));
    Assert.assertEquals(JSONToken.LITERAL_STRING, MiscCodec.instance.getFastMatchToken());

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:UUIDDeserializerTest.java

示例6: test_string_null

public void test_string_null() throws Exception {
    String input = "null";
    DefaultJSONParser parser = new DefaultJSONParser(input, ParserConfig.getGlobalInstance(), JSON.DEFAULT_PARSER_FEATURE);
    
    StringCodec deser = new StringCodec();
    
    Assert.assertNull(deser.deserialze(parser, null, null));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:InetAddressDeserializerTest.java

示例7: test_date_4

public void test_date_4() throws Exception {
    int features = JSON.DEFAULT_PARSER_FEATURE;
    features = Feature.config(features, Feature.AllowISO8601DateFormat, true);
    DefaultJSONParser parser = new DefaultJSONParser("\"2011-01-09\"", ParserConfig.getGlobalInstance(), features);

    java.sql.Timestamp date = parser.parseObject(java.sql.Timestamp.class);

    Assert.assertEquals(new java.sql.Timestamp(1294502400000L), date);
    parser.close();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:DateParserTest_sql_timestamp.java

示例8: test_date_1

public void test_date_1() throws Exception {
    int features = JSON.DEFAULT_PARSER_FEATURE;
    features = Feature.config(features, Feature.AllowISO8601DateFormat, true);
    DefaultJSONParser parser = new DefaultJSONParser("\"2011-01-09T13:49:53.254\"", ParserConfig.getGlobalInstance(), features);

    java.sql.Timestamp date = parser.parseObject(java.sql.Timestamp.class);

    Assert.assertEquals(new java.sql.Timestamp(1294552193254L), date);
    parser.close();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:DateParserTest_sql_timestamp.java

示例9: test_date_1

public void test_date_1() throws Exception {
    int features = JSON.DEFAULT_PARSER_FEATURE;
    features = Feature.config(features, Feature.AllowISO8601DateFormat, true);
    DefaultJSONParser parser = new DefaultJSONParser("\"2011-01-09T13:49:53.254\"", ParserConfig.getGlobalInstance(), features);

    java.sql.Date date = parser.parseObject(java.sql.Date.class);

    Assert.assertEquals(new java.sql.Date(1294552193254L), date);
    parser.close();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:DateParserTest_sql.java

示例10: test_date_3

public void test_date_3() throws Exception {
    int features = JSON.DEFAULT_PARSER_FEATURE;
    features = Feature.config(features, Feature.AllowISO8601DateFormat, true);
    DefaultJSONParser parser = new DefaultJSONParser("\"2011-01-09T13:49:53\"", ParserConfig.getGlobalInstance(), features);

    java.sql.Date date = parser.parseObject(java.sql.Date.class);

    Assert.assertEquals(new java.sql.Date(1294552193000L), date);
    parser.close();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:DateParserTest_sql.java

示例11: test_bigdecimal

public void test_bigdecimal() throws Exception {
    Assert.assertEquals(1309861159710L, JSON.parseObject("1309861159710", java.sql.Date.class).getTime());
    Assert.assertEquals(1309861159710L, JSON.parseObject("1309861159710.0", java.sql.Date.class).getTime());
    Assert.assertEquals(1309861159710L, JSON.parseObject("'1309861159710'", java.sql.Date.class).getTime());

    Assert.assertEquals(null, JSON.parseObject("null", Integer.class));

    DefaultJSONParser parser = new DefaultJSONParser("null", ParserConfig.getGlobalInstance(), JSON.DEFAULT_PARSER_FEATURE);
    Assert.assertEquals(null, SqlDateDeserializer.instance.deserialze(parser, null, null));
    Assert.assertEquals(JSONToken.LITERAL_INT, SqlDateDeserializer.instance.getFastMatchToken());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:SqlDateDeserializerTest.java

示例12: DefaultJSONParser

public DefaultJSONParser(String input){
    this(input, ParserConfig.getGlobalInstance(), JSON.DEFAULT_PARSER_FEATURE);
}
 
开发者ID:uavorg,项目名称:uavstack,代码行数:3,代码来源:DefaultJSONParser.java

示例13: JSONReaderScanner

public JSONReaderScanner(char[] input, int inputLength){
    this(input, inputLength, JSON.DEFAULT_PARSER_FEATURE);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:3,代码来源:JSONReaderScanner.java

示例14: DefaultJSONParser

public DefaultJSONParser(String input, ParserConfig config) {
    this((Object) input, new JSONScanner(input, JSON.DEFAULT_PARSER_FEATURE), config);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:3,代码来源:DefaultJSONParser.java

示例15: test_char

public void test_char() throws Exception {
    DefaultJSONParser parser = new DefaultJSONParser("null", ParserConfig.getGlobalInstance(), JSON.DEFAULT_PARSER_FEATURE);
    
    Assert.assertNull(new CharacterCodec().deserialze(parser, null, null));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:TestNull.java


注:本文中的com.alibaba.fastjson.JSON.DEFAULT_PARSER_FEATURE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。