本文整理汇总了Java中com.alibaba.fastjson.parser.JSONScanner.scanSymbol方法的典型用法代码示例。如果您正苦于以下问题:Java JSONScanner.scanSymbol方法的具体用法?Java JSONScanner.scanSymbol怎么用?Java JSONScanner.scanSymbol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.fastjson.parser.JSONScanner
的用法示例。
在下文中一共展示了JSONScanner.scanSymbol方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_0
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_0() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("name".equals(symbol));
lexer.close();
}
示例2: test_1
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_1() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick name".equals(symbol));
lexer.close();
}
示例3: test_2
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_2() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\\"name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick \"name" == symbol);
lexer.close();
}
示例4: test_3
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_3() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\\\name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick \\name" == symbol);
lexer.close();
}
示例5: test_4
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_4() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\/name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick /name" == symbol);
lexer.close();
}
示例6: test_5
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_5() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\bname\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick \bname" == symbol);
lexer.close();
}
示例7: test_6
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_6() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\f name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick \f name" == symbol);
lexer.close();
}
示例8: test_7
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_7() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\F name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick \f name" == symbol);
lexer.close();
}
示例9: test_8
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_8() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\n name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick \n name" == symbol);
lexer.close();
}
示例10: test_9
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_9() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\r name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick \r name" == symbol);
lexer.close();
}
示例11: test_10
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_10() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\t name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick \t name" == symbol);
lexer.close();
}
示例12: test_11
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_11() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\u4e2d name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick 中 name" == symbol);
lexer.close();
}
示例13: test_12
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_12() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner(
"\"\\tabcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("\tabcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrstuvwxyz01234567890" == symbol);
lexer.close();
}
示例14: test_error
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_error() throws Exception {
JSONException error = null;
try {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\a name\"");
lexer.scanSymbol(symbolTable, '"');
lexer.close();
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
示例15: test_error_2
import com.alibaba.fastjson.parser.JSONScanner; //导入方法依赖的package包/类
public void test_error_2() throws Exception {
JSONException error = null;
try {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"name");
lexer.scanSymbol(symbolTable, '"');
lexer.close();
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}