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


Java JSONScanner.scanSymbol方法代码示例

本文整理汇总了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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:JSONScannerTest_symbol.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:JSONScannerTest_symbol.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:JSONScannerTest_symbol.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:JSONScannerTest_symbol.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:JSONScannerTest_symbol.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:JSONScannerTest_symbol.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:JSONScannerTest_symbol.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:JSONScannerTest_symbol.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:JSONScannerTest_symbol.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:JSONScannerTest_symbol.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:JSONScannerTest_symbol.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:JSONScannerTest_symbol.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:JSONScannerTest_symbol.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:JSONScannerTest_symbol.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:JSONScannerTest_symbol.java


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