Package com.heroku.api.exception

Examples of com.heroku.api.exception.ParseException


        mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        JavaType javaType = TypeFactory.type(type);
        try {
            return mapper.readValue(data, 0, data.length, javaType);
        } catch (IOException e) {
            throw new ParseException("Unable to parse data.", e);
        }
    }
View Full Code Here


        mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        JavaType javaType = mapper.constructType(type);
        try {
            return mapper.readValue(data, javaType);
        } catch (IOException e) {
            throw new ParseException("Unable to parse data.", e);
        }
    }
View Full Code Here

     * @return T
     */
    public static <T> T parse(byte[] data, Class<? extends Request<T>> classType) {
        Type[] types = doResolveTypeArguments(classType, classType, Request.class);
        if (types == null || types.length == 0) {
            throw new ParseException("Request<T> was not found for " + classType);
        }
        Type type = types[0];
        try {
            return Holder.parser.parse(data, type);
        } catch (RuntimeException e) {
            String json = HttpUtil.getUTF8String(data);
            throw new ParseException("Failed to parse JSON:" + json, e);
        }
    }
View Full Code Here

TOP

Related Classes of com.heroku.api.exception.ParseException

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.