Skip to content

Commit

Permalink
Upgraded the dependency of jackson from 2.3.1 to 2.9.8 (to read/write…
Browse files Browse the repository at this point in the history
… json files)
  • Loading branch information
crux82 committed Mar 8, 2019
1 parent 1ede8ef commit 2874673
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.databind.DatabindContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.jsontype.TypeIdResolver;
import com.fasterxml.jackson.databind.type.TypeFactory;

/**
* It is a class implementing <code>TypeIdResolver</code> which will be used by
Expand Down Expand Up @@ -90,13 +90,12 @@ public void init(JavaType arg0) {
mBaseType = arg0;
}

public JavaType typeFromId(String arg0) {
public JavaType typeFromId(DatabindContext context, String arg0) {

Class<? extends StructureElementSimilarityI> clazz = idToClassMapping
.get(arg0);
if (clazz != null) {
JavaType type = TypeFactory.defaultInstance()
.constructSpecializedType(mBaseType, clazz);
JavaType type = context.constructSpecializedType(mBaseType, clazz);
return type;
}
throw new IllegalStateException("cannot find mapping for '" + arg0
Expand All @@ -107,4 +106,9 @@ public String idFromValueAndType(Object arg0, Class<?> arg1) {
return classToIdMapping.get(arg0.getClass());
}

@Override
public String getDescForKnownTypeIds() {
return "";
}

}

0 comments on commit 2874673

Please sign in to comment.