use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.
the class JSONScannerTest_true method test_scan_true_9.
public void test_scan_true_9() throws Exception {
JSONScanner lexer = new JSONScanner("true\na");
lexer.scanTrue();
}
use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.
the class JSONScannerTest_true method test_scan_false_14.
public void test_scan_false_14() throws Exception {
JSONScanner lexer = new JSONScanner("true}");
lexer.scanTrue();
}
use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.
the class MediaContentDeserializer method deserialze.
public <T> T deserialze(DefaultJSONParser parser, Type clazz, Object fieldName) {
final JSONScanner lexer = (JSONScanner) parser.getLexer();
MediaContent object = new MediaContent();
lexer.matchField(mediaPrefix);
if (mediaDeserializer == null) {
//mediaDeserializer = parser.getMapping().getDeserializer(ObjectDeserializer.class);
}
mediaDeserializer.deserialze(parser, clazz, null);
lexer.matchField(imagePrefix);
imageDeserializer.deserialze(parser, clazz, null);
// TODO Auto-generated method stub
return null;
}
use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.
the class LexerTest method test_empty.
public void test_empty() throws Exception {
JSONScanner lexer = new JSONScanner("".toCharArray(), 0);
lexer.nextToken();
Assert.assertEquals(JSONToken.EOF, lexer.token());
}
use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.
the class LexerTest method test_float.
public void test_float() throws Exception {
String text = "123456789.0123";
JSONScanner lexer = new JSONScanner(text);
lexer.nextToken();
BigDecimal decimalValue = lexer.decimalValue();
Assert.assertEquals(new BigDecimal("123456789.0123"), decimalValue);
}
Aggregations