Skip to content
This repository has been archived by the owner on Jun 26, 2021. It is now read-only.

Provide access to the associated ObjectMapper in JsonResource via default load/save options #96

Open
kchobantonov opened this issue Dec 12, 2016 · 0 comments

Comments

@kchobantonov
Copy link

kchobantonov commented Dec 12, 2016

When combined with EMF mongo project we do need an access to the object mapper associated with the JsonResource so that we can use the predefined ObjectMapper in MongoInputStream/MongoOutputStream instead of creating new ObjectMapper via EMFModule.setupDefaultMapper();

Possible implementation

 ```
  public JsonResource(URI uri, ObjectMapper mapper) {
	super(uri);
	this.mapper = mapper;
	
    defaultLoadOptions = new HashMap<Object, Object>();
    defaultSaveOptions = new HashMap<Object, Object>();
    
    defaultLoadOptions.put(ObjectMapper.class.getName(), mapper);
    defaultSaveOptions.put(ObjectMapper.class.getName(), mapper);
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant