// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package retrofit.converter; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.type.TypeFactory; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.lang.reflect.Type; import retrofit.mime.TypedByteArray; import retrofit.mime.TypedInput; import retrofit.mime.TypedOutput; // Referenced classes of package retrofit.converter: // Converter, ConversionException public class JacksonConverter implements Converter { private static final String MIME_TYPE = "application/json; charset=UTF-8"; private final ObjectMapper objectMapper; public JacksonConverter() { this(new ObjectMapper()); } public JacksonConverter(ObjectMapper objectmapper) { objectMapper = objectmapper; } public Object fromBody(TypedInput typedinput, Type type) throws ConversionException { try { type = objectMapper.getTypeFactory().constructType(type); typedinput = ((TypedInput) (objectMapper.readValue(typedinput.in(), type))); } // Misplaced declaration of an exception variable catch (TypedInput typedinput) { throw new ConversionException(typedinput); } // Misplaced declaration of an exception variable catch (TypedInput typedinput) { throw new ConversionException(typedinput); } // Misplaced declaration of an exception variable catch (TypedInput typedinput) { throw new ConversionException(typedinput); } return typedinput; } public TypedOutput toBody(Object obj) { try { obj = new TypedByteArray("application/json; charset=UTF-8", objectMapper.writeValueAsString(obj).getBytes("UTF-8")); } // Misplaced declaration of an exception variable catch (Object obj) { throw new AssertionError(obj); } // Misplaced declaration of an exception variable catch (Object obj) { throw new AssertionError(obj); } return ((TypedOutput) (obj)); } }