Examples of scanISO8601DateIfMatch()


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

                //
            }

            JSONScanner dateParser = new JSONScanner(strVal);
            Calendar calendar = null;
            if (dateParser.scanISO8601DateIfMatch(false)) {
                calendar = dateParser.getCalendar();
            }
            dateParser.close();

            if (calendar != null) {
View Full Code Here

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

            long longVal;

            JSONScanner dateLexer = new JSONScanner(strVal);
            try {
                if (dateLexer.scanISO8601DateIfMatch()) {
                    longVal = dateLexer.getCalendar().getTimeInMillis();
                } else {

                    DateFormat dateFormat = parser.getDateFormat();
                    try {
View Full Code Here

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

                return null;
            }

            JSONScanner dateLexer = new JSONScanner(strVal);
            try {
                if (dateLexer.scanISO8601DateIfMatch(false)) {
                    return (T) dateLexer.getCalendar().getTime();
                }
            } finally {
                dateLexer.close();
            }
View Full Code Here

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

                return null;
            }
           
            long longVal;
            JSONScanner dateLexer = new JSONScanner(strVal);
            if (dateLexer.scanISO8601DateIfMatch()) {
                longVal = dateLexer.getCalendar().getTimeInMillis();
            } else {
                longVal = Long.parseLong(strVal);
            }
            dateLexer.close();
View Full Code Here

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

            val = strVal;
            lexer.nextToken(JSONToken.COMMA);
           
            if (lexer.isEnabled(Feature.AllowISO8601DateFormat)) {
                JSONScanner iso8601Lexer = new JSONScanner(strVal);
                if (iso8601Lexer.scanISO8601DateIfMatch()) {
                    val = iso8601Lexer.getCalendar().getTime();
                }
                iso8601Lexer.close();
            }
        } else if (lexer.token() == JSONToken.NULL) {
View Full Code Here

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

                //
            }

            JSONScanner dateParser = new JSONScanner(strVal);
            Calendar calendar = null;
            if (dateParser.scanISO8601DateIfMatch(false)) {
                calendar = dateParser.getCalendar();
            }
            dateParser.close();

            if (calendar != null) {
View Full Code Here

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

    }

    public void test_2() throws Exception {
        JSONScanner lexer = new JSONScanner("2000-02-10T00:00:00.000");
        lexer.config(Feature.AllowISO8601DateFormat, true);
        Assert.assertEquals(true, lexer.scanISO8601DateIfMatch());
        Assert.assertEquals(JSONToken.LITERAL_ISO8601_DATE, lexer.token());
        lexer.nextToken();
        Assert.assertEquals(JSONToken.EOF, lexer.token());
    }
View Full Code Here

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

                //
            }

            JSONScanner dateParser = new JSONScanner(strVal);
            Calendar calendar = null;
            if (dateParser.scanISO8601DateIfMatch(false)) {
                calendar = dateParser.getCalendar();
            }
            dateParser.close();

            if (calendar != null) {
View Full Code Here

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

                return null;
            }

            JSONScanner dateLexer = new JSONScanner(strVal);
            try {
                if (dateLexer.scanISO8601DateIfMatch(false)) {
                    Calendar calendar = dateLexer.getCalendar();
                   
                    if (clazz == Calendar.class) {
                        return (T) calendar;
                    }
View Full Code Here

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

                //
            }

            JSONScanner dateParser = new JSONScanner(strVal);
            Calendar calendar = null;
            if (dateParser.scanISO8601DateIfMatch(false)) {
                calendar = dateParser.getCalendar();
            }
            dateParser.close();

            if (calendar != null) {
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.