Examples of scanSymbol()


Examples of com.alibaba.fastjson.parser.JSONScanner.scanSymbol()

                } else if (ch == '\'') {
                    if (!parser.isEnabled(Feature.AllowSingleQuotes)) {
                        throw new JSONException("syntax error");
                    }

                    key = lexer.scanSymbol(parser.getSymbolTable(), '\'');
                    lexer.skipWhitespace();
                    ch = lexer.getCurrent();
                    if (ch != ':') {
                        throw new JSONException("expect ':' at " + lexer.pos());
                    }
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONScanner.scanSymbol()

                ch = lexer.getCurrent();

                lexer.resetStringPosition();

                if (key == JSON.DEFAULT_TYPE_KEY) {
                    String typeName = lexer.scanSymbol(parser.getSymbolTable(), '"');
                    Class<?> clazz = TypeUtils.loadClass(typeName);

                    if (clazz == map.getClass()) {
                        lexer.nextToken(JSONToken.COMMA);
                        if (lexer.token() == JSONToken.RBRACE) {
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONScanner.scanSymbol()

        final Object[] args = new Object[1];

        for (;;) {
            // lexer.scanSymbol
            String key = lexer.scanSymbol(parser.getSymbolTable());

            if (key == null) {
                if (lexer.token() == JSONToken.RBRACE) {
                    lexer.nextToken(JSONToken.COMMA);
                    break;
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONScanner.scanSymbol()

    public void test_0() throws Exception {
        SymbolTable symbolTable = new SymbolTable();

        JSONScanner lexer = new JSONScanner("\"name\"");
        String symbol = lexer.scanSymbol(symbolTable, '"');
        Assert.assertTrue("name".equals(symbol));

        String symbol2 = lexer.symbol(symbolTable);
        Assert.assertTrue("name".equals(symbol2));
    }
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONScanner.scanSymbol()

    public void test_1() throws Exception {
        SymbolTable symbolTable = new SymbolTable();

        JSONScanner lexer = new JSONScanner("\"nick name\"");
        String symbol = lexer.scanSymbol(symbolTable, '"');
        Assert.assertTrue("nick name".equals(symbol));
    }

    public void test_2() throws Exception {
        SymbolTable symbolTable = new SymbolTable();
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONScanner.scanSymbol()

    public void test_2() throws Exception {
        SymbolTable symbolTable = new SymbolTable();

        JSONScanner lexer = new JSONScanner("\"nick \\\"name\"");
        String symbol = lexer.scanSymbol(symbolTable, '"');
        Assert.assertTrue("nick \"name" == symbol);
    }

    public void test_2_1() throws Exception {
        SymbolTable symbolTable = new SymbolTable();
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONScanner.scanSymbol()

    public void test_3() throws Exception {
        SymbolTable symbolTable = new SymbolTable();

        JSONScanner lexer = new JSONScanner("\"nick \\\\name\"");
        String symbol = lexer.scanSymbol(symbolTable, '"');
        Assert.assertTrue("nick \\name" == symbol);
    }

    public void test_4() throws Exception {
        SymbolTable symbolTable = new SymbolTable();
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONScanner.scanSymbol()

    public void test_4() throws Exception {
        SymbolTable symbolTable = new SymbolTable();

        JSONScanner lexer = new JSONScanner("\"nick \\/name\"");
        String symbol = lexer.scanSymbol(symbolTable, '"');
        Assert.assertTrue("nick /name" == symbol);
    }

    public void test_5() throws Exception {
        SymbolTable symbolTable = new SymbolTable();
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONScanner.scanSymbol()

    public void test_5() throws Exception {
        SymbolTable symbolTable = new SymbolTable();

        JSONScanner lexer = new JSONScanner("\"nick \\bname\"");
        String symbol = lexer.scanSymbol(symbolTable, '"');
        Assert.assertTrue("nick \bname" == symbol);
    }

    public void test_6() throws Exception {
        SymbolTable symbolTable = new SymbolTable();
View Full Code Here

Examples of com.alibaba.fastjson.parser.JSONScanner.scanSymbol()

    public void test_6() throws Exception {
        SymbolTable symbolTable = new SymbolTable();

        JSONScanner lexer = new JSONScanner("\"nick \\f name\"");
        String symbol = lexer.scanSymbol(symbolTable, '"');
        Assert.assertTrue("nick \f name" == symbol);
    }

    public void test_7() throws Exception {
        SymbolTable symbolTable = new SymbolTable();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.