Package com.clumd.projects.javajson.api
Interface JsonMapper<E>
- Type Parameters:
E- The class type which the implementor will convert any provided JSON object into
public interface JsonMapper<E>
This interface defines the method used to unwrap a Java-JSON representation into a 'fully-qualified' Java object,
devoid of any control, functionality or influence from this framework.
-
Method Summary
Modifier and Type Method Description EmapToClass(Json json)Used to convert the given JSON into a pure, top level Java object.
-
Method Details
-
mapToClass
Used to convert the given JSON into a pure, top level Java object.- Parameters:
json- The JSON to convert into a pure Java object.- Returns:
- The successfully converted Java Object instance.
- Throws:
Exception- Can be thrown by an implementor if the provided JSON did not satisfy some constraint of the conversion process - e.g. missing a required property.For more advanced implementations, consider writing a JSON schema, and using the methods in
JsonSchemaEnforceableto enforce the structure and any additional constraints of a JSON object and its properties before attempting to convert it to Java.
-