Package com.fasterxml.jackson.core

Examples of com.fasterxml.jackson.core.JsonLocation


    }
   
    private JsonLocation _extractLocation(XMLStreamLocation2 location)
    {
        if (location == null) { // just for impls that might pass null...
            return new JsonLocation(_sourceReference, -1, -1, -1);
        }
        return new JsonLocation(_sourceReference,
                location.getCharacterOffset(),
                location.getLineNumber(),
                location.getColumnNumber());
    }
View Full Code Here


    }
   
    private JsonLocation _extractLocation(XMLStreamLocation2 location)
    {
        if (location == null) { // just for impls that might pass null...
            return new JsonLocation(_sourceReference, -1, -1, -1);
        }
        return new JsonLocation(_sourceReference,
                location.getCharacterOffset(),
                location.getLineNumber(),
                location.getColumnNumber());
    }
View Full Code Here

     *     {@code null} if the entry is an 'is_deleted' entry.
     */
    public static <C> WithChildrenC<C> extract(JsonParser parser, Collector<DbxEntry,? extends C> collector)
        throws IOException, JsonExtractionException
    {
        JsonLocation top = JsonExtractor.expectObjectStart(parser);

        String size = null;
        long bytes = -1;
        String path = null;
        Boolean is_dir = null;
View Full Code Here

        throws IOException, JsonExtractionException
    {
        if (parser.getCurrentToken() != JsonToken.START_OBJECT) {
            throw new JsonExtractionException("expecting the start of an object (\"{\")", parser.getTokenLocation());
        }
        JsonLocation loc = parser.getTokenLocation();
        nextToken(parser);
        return loc;
    }
View Full Code Here

        throws IOException, JsonExtractionException
    {
        if (parser.getCurrentToken() != JsonToken.START_ARRAY) {
            throw new JsonExtractionException("expecting the start of an array (\"[\")", parser.getTokenLocation());
        }
        JsonLocation loc = parser.getTokenLocation();
        nextToken(parser);
        return loc;
    }
View Full Code Here

        }

        public static <C, MD extends DbxDataObject> DbxDeltaC<C,MD> extract(JsonParser parser, JsonExtractor<MD> metadataExtractor, Collector<DbxDeltaC.Entry<MD>, C> entryCollector)
            throws IOException, JsonExtractionException
        {
            JsonLocation top = JsonExtractor.expectObjectStart(parser);

            Boolean reset = null;
            C entries = null;
            String cursor = null;
            Boolean has_more = null;
View Full Code Here

            }

            public static <MD extends DbxDataObject> Entry<MD> extract(JsonParser parser, JsonExtractor<MD> metadataExtractor)
                throws IOException, JsonExtractionException
            {
                JsonLocation arrayStart = JsonExtractor.expectArrayStart(parser);

                if (JsonExtractor.isArrayEnd(parser)) {
                    throw new JsonExtractionException("expecting a two-element array of [path, metadata], found a zero-element array", arrayStart);
                }
View Full Code Here

        }

        public static <MD extends DbxDataObject> DbxDelta<MD> extract(JsonParser parser, JsonExtractor<MD> metadataExtractor)
            throws IOException, JsonExtractionException
        {
            JsonLocation top = JsonExtractor.expectObjectStart(parser);

            Boolean reset = null;
            ArrayList<Entry<MD>> entries = null;
            String cursor = null;
            Boolean has_more = null;
View Full Code Here

            }

            public static <MD extends DbxDataObject> Entry<MD> extract(JsonParser parser, JsonExtractor<MD> metadataExtractor)
                throws IOException, JsonExtractionException
            {
                JsonLocation arrayStart = JsonExtractor.expectArrayStart(parser);

                if (JsonExtractor.isArrayEnd(parser)) {
                    throw new JsonExtractionException("expecting a two-element array of [path, metadata], found a zero-element array", arrayStart);
                }
View Full Code Here

    public static boolean isRealLocation(JsonLocation jsonLocation) {
        return (jsonLocation != null) && (jsonLocation != JsonLocation.NA);
    }

    public static JsonMappingException maybeImproveLocation(JsonLocation wrapLoc, JsonMappingException cause) {
        JsonLocation exLoc = cause.getLocation();
        if (isRealLocation(wrapLoc) && !isRealLocation(exLoc)) {
            if (wrapLoc.getSourceRef() instanceof ConfigValue) {
                ConfigValue locRef = (ConfigValue) wrapLoc.getSourceRef();
                List<JsonMappingException.Reference> paths = cause.getPath();
                for (JsonMappingException.Reference path : paths) {
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.core.JsonLocation

Copyright © 2018 www.massapicom. 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.