Class TargetClassResolver

java.lang.Object
cz.cvut.kbss.jsonld.deserialization.util.TargetClassResolver

public class TargetClassResolver extends Object
Resolves the type of instance into which a JSON-LD object will be deserialized.
  • Constructor Details

  • Method Details

    • getTargetClass

      public <T> Class<? extends T> getTargetClass(Class<T> expectedClass, Collection<String> types)
      Resolves object deserialization target class based on the specified type info.
      Type Parameters:
      T - The type of the expected target class
      Parameters:
      expectedClass - Expected class as specified by deserialization return type of field type
      types - Types of the JSON-LD object to deserialize
      Returns:
      Resolved target class. It has to be a subtype of the expectedClass
      Throws:
      TargetTypeException - If the resulting candidate is not assignable to the expected class or it cannot be determined