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

org.web3j.mavenplugin.JsonParser Maven / Gradle / Ivy

package org.web3j.mavenplugin;

import org.apache.maven.plugin.MojoExecutionException;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

import java.util.Map;

public class JsonParser {

    JSONParser jsonParser;


    public JsonParser() {
        jsonParser = new JSONParser();
    }

    public Map parseJson(String jsonString) throws MojoExecutionException {

        try {
            return (Map) jsonParser.parse(jsonString);
        } catch (ParseException e) {
            throw new MojoExecutionException("Could not parse SolC result", e);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy