Package com.alibaba.fastjson.parser

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


    }
   
    public void test_next_8() throws Exception {
        String text = "\n\r\t\f\b :{";
        JSONScanner lexer = new JSONScanner(text);
        lexer.nextTokenWithColon(JSONToken.LBRACE);
        Assert.assertEquals(JSONToken.LBRACE, lexer.token());
    }
   
    public void test_next_9() throws Exception {
        String text = "\n\r\t\f\b :[";
View Full Code Here


    }
   
    public void test_next_9() throws Exception {
        String text = "\n\r\t\f\b :[";
        JSONScanner lexer = new JSONScanner(text);
        lexer.nextTokenWithColon(JSONToken.LBRACE);
        Assert.assertEquals(JSONToken.LBRACKET, lexer.token());
    }
   
    public void test_next_10() throws Exception {
        String text = "\n\r\t\f\b :";
View Full Code Here

    }
   
    public void test_next_10() throws Exception {
        String text = "\n\r\t\f\b :";
        JSONScanner lexer = new JSONScanner(text);
        lexer.nextTokenWithColon(JSONToken.LBRACE);
        Assert.assertEquals(JSONToken.EOF, lexer.token());
    }
   
    public void test_next_11() throws Exception {
        String text = "\n\r\t\f\b :{";
View Full Code Here

    }
   
    public void test_next_11() throws Exception {
        String text = "\n\r\t\f\b :{";
        JSONScanner lexer = new JSONScanner(text);
        lexer.nextTokenWithColon(JSONToken.LBRACKET);
        Assert.assertEquals(JSONToken.LBRACE, lexer.token());
    }
   
    public void test_next_12() throws Exception {
        String text = "\n\r\t\f\b :";
View Full Code Here

    }
   
    public void test_next_12() throws Exception {
        String text = "\n\r\t\f\b :";
        JSONScanner lexer = new JSONScanner(text);
        lexer.nextTokenWithColon(JSONToken.LBRACKET);
        Assert.assertEquals(JSONToken.EOF, lexer.token());
    }
    public void test_next_13() throws Exception {
        String text = "\n\r\t\f\b :\n\r\t\f\b ";
        JSONScanner lexer = new JSONScanner(text);
View Full Code Here

        Assert.assertEquals(JSONToken.EOF, lexer.token());
    }
    public void test_next_13() throws Exception {
        String text = "\n\r\t\f\b :\n\r\t\f\b ";
        JSONScanner lexer = new JSONScanner(text);
        lexer.nextTokenWithColon(JSONToken.LBRACKET);
        Assert.assertEquals(JSONToken.EOF, lexer.token());
    }
}
View Full Code Here

                }

                if (lexer.token() == JSONToken.LITERAL_STRING && lexer.isRef()) {
                    Object object = null;

                    lexer.nextTokenWithColon(JSONToken.LITERAL_STRING);
                    if (lexer.token() == JSONToken.LITERAL_STRING) {
                        String ref = lexer.stringVal();
                        if ("@".equals(ref)) {
                            object = context.getObject();
                        } else if ("..".equals(ref)) {
View Full Code Here

                    return object;
                }

                if (map.size() == 0 && lexer.token() == JSONToken.LITERAL_STRING && "@type".equals(lexer.stringVal())) {
                    lexer.nextTokenWithColon(JSONToken.LITERAL_STRING);
                    lexer.nextToken(JSONToken.COMMA);
                    lexer.nextToken(keyDeserializer.getFastMatchToken());
                }

                Object key = keyDeserializer.deserialze(parser, keyType, null);
View Full Code Here

            if (fieldDeser == null) {
                if (!parser.isEnabled(Feature.IgnoreNotMatch)) {
                    throw new JSONException("setter not found, class " + clazz.getName() + ", property " + key);
                }

                lexer.nextTokenWithColon();
                parser.parse(); // skip

                if (lexer.token() == JSONToken.RBRACE) {
                    lexer.nextToken();
                    return;
View Full Code Here

            } else {
                Method method = fieldDeser.getMethod();
                Class<?> fieldClass = method.getParameterTypes()[0];
                Type fieldType = method.getGenericParameterTypes()[0];
                if (fieldClass == int.class) {
                    lexer.nextTokenWithColon(JSONToken.LITERAL_INT);
                    args[0] = IntegerDeserializer.deserialze(parser);
                } else if (fieldClass == String.class) {
                    lexer.nextTokenWithColon(JSONToken.LITERAL_STRING);
                    args[0] = StringDeserializer.deserialze(parser);
                } else if (fieldClass == long.class) {
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.