Search in sources :

Example 31 with JSONScanner

use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.

the class JSONScannerTest_colon method test_2.

public void test_2() throws Exception {
    JSONScanner lexer = new JSONScanner("\n:\ntrue");
    lexer.nextTokenWithColon();
    Assert.assertEquals(JSONToken.TRUE, lexer.token());
}
Also used : JSONScanner(com.alibaba.fastjson.parser.JSONScanner)

Example 32 with JSONScanner

use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.

the class JSONScannerTest_colon method test_3.

public void test_3() throws Exception {
    JSONScanner lexer = new JSONScanner("\r:\rtrue");
    lexer.nextTokenWithColon();
    Assert.assertEquals(JSONToken.TRUE, lexer.token());
}
Also used : JSONScanner(com.alibaba.fastjson.parser.JSONScanner)

Example 33 with JSONScanner

use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.

the class JSONScannerTest_colon method test_0.

public void test_0() throws Exception {
    JSONScanner lexer = new JSONScanner(":true");
    lexer.nextTokenWithColon();
    Assert.assertEquals(JSONToken.TRUE, lexer.token());
}
Also used : JSONScanner(com.alibaba.fastjson.parser.JSONScanner)

Example 34 with JSONScanner

use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.

the class JSONScannerTest_false method test_scan_false_14.

public void test_scan_false_14() throws Exception {
    JSONScanner lexer = new JSONScanner("false}");
    lexer.scanFalse();
}
Also used : JSONScanner(com.alibaba.fastjson.parser.JSONScanner)

Example 35 with JSONScanner

use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.

the class JSONScannerTest_false method test_scan_false_0.

public void test_scan_false_0() throws Exception {
    JSONScanner lexer = new JSONScanner("false");
    lexer.scanFalse();
}
Also used : JSONScanner(com.alibaba.fastjson.parser.JSONScanner)

Aggregations

JSONScanner (com.alibaba.fastjson.parser.JSONScanner)179 JSONException (com.alibaba.fastjson.JSONException)37 SymbolTable (com.alibaba.fastjson.parser.SymbolTable)15 JSONReader (com.alibaba.fastjson.JSONReader)11 ParseException (java.text.ParseException)5 BigInteger (java.math.BigInteger)3 DateFormat (java.text.DateFormat)3 SimpleDateFormat (java.text.SimpleDateFormat)3 Date (java.util.Date)3 JSONLexer (com.alibaba.fastjson.parser.JSONLexer)2 JSONObject (com.alibaba.fastjson.JSONObject)1 AccessibleObject (java.lang.reflect.AccessibleObject)1 BigDecimal (java.math.BigDecimal)1 AccessControlException (java.security.AccessControlException)1 Calendar (java.util.Calendar)1