當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。