This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed media container deserializing issue
- Loading branch information
1 parent
571e73e
commit 135adea
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...instagram/src/main/java/org/springframework/social/instagram/api/impl/MediaContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.springframework.social.instagram.api.impl; | ||
|
||
import org.codehaus.jackson.map.annotate.JsonDeserialize; | ||
import org.springframework.social.instagram.api.Media; | ||
|
||
@JsonDeserialize(using=MediaContainerDeserializer.class) | ||
public class MediaContainer { | ||
|
||
private Media media; | ||
|
||
public MediaContainer(Media media) { | ||
this.media = media; | ||
} | ||
|
||
public Media getMedia() { | ||
return media; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...c/main/java/org/springframework/social/instagram/api/impl/MediaContainerDeserializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.springframework.social.instagram.api.impl; | ||
|
||
import java.io.IOException; | ||
|
||
import org.codehaus.jackson.JsonParser; | ||
import org.codehaus.jackson.JsonProcessingException; | ||
import org.codehaus.jackson.map.DeserializationContext; | ||
import org.springframework.social.instagram.api.Media; | ||
|
||
public class MediaContainerDeserializer extends AbstractInstagramDeserializer<MediaContainer> { | ||
|
||
@Override | ||
public MediaContainer deserialize(JsonParser jp, DeserializationContext ctxt) | ||
throws IOException, JsonProcessingException { | ||
// TODO Auto-generated method stub | ||
return deserializeResponseObject(jp, MediaContainer.class, Media.class); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters