All Downloads are FREE. Search and download functionalities are using the official Maven repository.

zygf.jackshaft.impl.JacksonWrapper Maven / Gradle / Ivy

Go to download

Incremental (non-blocking) parsing for Scala JSON ASTs, based on jackson-core.

There is a newer version: 0.2.2
Show newest version
package zygf.jackshaft.impl;

import com.fasterxml.jackson.core.JsonParser;

import java.io.IOException;

public abstract class JacksonWrapper
{
    /**
     * Dispatch to another parsing method dynamically.
     *
     * @param jax A jackson parser instance
     * @param mode Parsing mode
     * @param consumer A callback that gets called for each JSON value
     * @return True if the array has finished parsing, false otherwise 
     */
    public abstract boolean parseAsync(JsonParser jax, ParsingMode mode, java.util.function.Consumer consumer) throws IOException;
    
    /**
     * Parse a single JSON value.
     *
     * @param jax A jackson parser instance
     * @return An AST node or null if not enough input was given
     */
    public abstract J parseValue(JsonParser jax) throws IOException;
    
    /**
     * Parse a JSON array asynchronously.
     *
     * @param jax A jackson parser instance
     * @param consumer A callback that gets called for each array member
     * @return True if the array has finished parsing, false otherwise 
     */
    public abstract boolean parseArray(JsonParser jax, java.util.function.Consumer consumer) throws IOException;
    
    /**
     * Parse a stream of whitespace-separated JSON values asynchronously.
     *
     * @param jax A jackson parser instance
     * @param consumer A callback that gets called for each JSON value
     * @return True if the array has finished parsing, false otherwise 
     */
    public abstract void parseStream(JsonParser jax, java.util.function.Consumer consumer) throws IOException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy