// Path: heroku-api/src/main/java/com/heroku/api/exception/ParseException.java
// public class ParseException extends HerokuAPIException {
//     public ParseException(String msg) {
//         super(msg);
//     }
// 
//     public ParseException(Throwable throwable) {
//         super(throwable);
//     }
// 
//     public ParseException(String msg, Throwable throwable) {
//         super(msg, throwable);
//     }
// }


import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.heroku.api.exception.ParseException;
import java.io.IOException;
import java.lang.reflect.Type;
package com.heroku.api.parser;



/**
 *
 * @author Naaman Newbold
 */
public class JacksonParser implements Parser {
    @Override
    public String encode(Object object) {
        ObjectMapper mapper = new ObjectMapper();
        mapper.setVisibilityChecker(mapper.getSerializationConfig().getDefaultVisibilityChecker()
            .withFieldVisibility(JsonAutoDetect.Visibility.NONE)
            .withGetterVisibility(JsonAutoDetect.Visibility.ANY)
            .withSetterVisibility(JsonAutoDetect.Visibility.NONE)
            .withCreatorVisibility(JsonAutoDetect.Visibility.NONE));
        try {
            return mapper.writeValueAsString(object);
        } catch (IOException e) {
// Path: heroku-api/src/main/java/com/heroku/api/exception/ParseException.java
// public class ParseException extends HerokuAPIException {
//     public ParseException(String msg) {
//         super(msg);
//     }
// 
//     public ParseException(Throwable throwable) {
//         super(throwable);
//     }
// 
//     public ParseException(String msg, Throwable throwable) {
//         super(msg, throwable);
//     }
// }


// Path: heroku-json-jackson/src/main/java/com/heroku/api/parser/JacksonParser.java
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.heroku.api.exception.ParseException;
import java.io.IOException;
import java.lang.reflect.Type;

package com.heroku.api.parser;



/**
 *
 * @author Naaman Newbold
 */
public class JacksonParser implements Parser {
    @Override
    public String encode(Object object) {
        ObjectMapper mapper = new ObjectMapper();
        mapper.setVisibilityChecker(mapper.getSerializationConfig().getDefaultVisibilityChecker()
            .withFieldVisibility(JsonAutoDetect.Visibility.NONE)
            .withGetterVisibility(JsonAutoDetect.Visibility.ANY)
            .withSetterVisibility(JsonAutoDetect.Visibility.NONE)
            .withCreatorVisibility(JsonAutoDetect.Visibility.NONE));
        try {
            return mapper.writeValueAsString(object);
        } catch (IOException e) {
            throw new ParseException("Unable to encode object.", e);