Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added support of the Jackson Smile format. Suggested by Tim Peierls.

  • Loading branch information...
commit fbdc47893726e01751e200b6a8ec48c65e68f889 1 parent 89d45f9
Thierry Boileau authored
View
33 modules/org.restlet.ext.jackson/src/org/restlet/ext/jackson/JacksonConverter.java
@@ -195,6 +195,7 @@ public float score(Object source, Variant target, Resource resource) {
Resource resource) throws IOException {
Object result = null;
+
JacksonSmileRepresentation<?> bSource = null;
if (source instanceof JacksonSmileRepresentation) {
bSource = (JacksonSmileRepresentation<?>) source;
@@ -209,23 +210,23 @@ public float score(Object source, Variant target, Resource resource) {
} else {
result = bSource.getObject();
}
- }
-
- // The source for the Jackson conversion
- JacksonRepresentation<?> jacksonSource = null;
- if (source instanceof JacksonRepresentation) {
- jacksonSource = (JacksonRepresentation<?>) source;
- } else if (VARIANT_JSON.isCompatible(source)) {
- jacksonSource = create(source, target);
- }
+ } else {
+ // The source for the Jackson conversion
+ JacksonRepresentation<?> jacksonSource = null;
+ if (source instanceof JacksonRepresentation) {
+ jacksonSource = (JacksonRepresentation<?>) source;
+ } else if (VARIANT_JSON.isCompatible(source)) {
+ jacksonSource = create(source, target);
+ }
- if (jacksonSource != null) {
- // Handle the conversion
- if ((target != null)
- && JacksonRepresentation.class.isAssignableFrom(target)) {
- result = jacksonSource;
- } else {
- result = jacksonSource.getObject();
+ if (jacksonSource != null) {
+ // Handle the conversion
+ if ((target != null)
+ && JacksonRepresentation.class.isAssignableFrom(target)) {
+ result = jacksonSource;
+ } else {
+ result = jacksonSource.getObject();
+ }
}
}

0 comments on commit fbdc478

Please sign in to comment.
Something went wrong with that request. Please try again.