Class SmartExecutorExceptionMapper
java.lang.Object
org.gcube.vremanagement.executor.exception.SmartExecutorExceptionMapper
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.gcube.com.fasterxml.jackson.databind.ObjectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.gcube.com.fasterxml.jackson.databind.ObjectMapperstatic <EE extends ExecutorException>
Stringmarshal(EE object) Return the String serialization of a given resourcestatic <T extends OutputStream,EE extends ExecutorException>
Tmarshal(EE object, T stream) Write the serialization of a given resource to a givenOutputStream.static <EE extends ExecutorException>
EEunmarshal(Class<EE> clz, InputStream stream) Creates a resource of given class from its serialization in a givenInputStream.static <EE extends ExecutorException>
EECreates a resource of given class from its serialization in a givenReader.static <EE extends ExecutorException>
EECreates a resource of given class from its serialization in a given String
-
Field Details
-
mapper
protected static final org.gcube.com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Constructor Details
-
SmartExecutorExceptionMapper
public SmartExecutorExceptionMapper()
-
-
Method Details
-
getObjectMapper
public static org.gcube.com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()- Returns:
- the ObjectMapper
-
marshal
public static <T extends OutputStream,EE extends ExecutorException> T marshal(EE object, T stream) throws org.gcube.com.fasterxml.jackson.core.JsonGenerationException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException Write the serialization of a given resource to a givenOutputStream.- Parameters:
object- the resourcestream- the stream in input- Throws:
IOExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionorg.gcube.com.fasterxml.jackson.core.JsonGenerationException
-
marshal
public static <T extends Writer,EE extends ExecutorException> T marshal(EE object, T writer) throws org.gcube.com.fasterxml.jackson.core.JsonGenerationException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException Write the serialization of a given resource to a givenWriter.- Parameters:
object- the resourcewriter- the writer in input- Throws:
IOExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionorg.gcube.com.fasterxml.jackson.core.JsonGenerationException
-
marshal
public static <EE extends ExecutorException> String marshal(EE object) throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException Return the String serialization of a given resource- Parameters:
object- the resource- Returns:
- the String serialization of a given resource
- Throws:
org.gcube.com.fasterxml.jackson.core.JsonProcessingException
-
unmarshal
public static <EE extends ExecutorException> EE unmarshal(Class<EE> clz, Reader reader) throws org.gcube.com.fasterxml.jackson.core.JsonParseException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException Creates a resource of given class from its serialization in a givenReader.- Parameters:
clz- the class of the resourcereader- the reader- Returns:
- the resource
- Throws:
org.gcube.com.fasterxml.jackson.core.JsonParseExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionIOException
-
unmarshal
public static <EE extends ExecutorException> EE unmarshal(Class<EE> clz, InputStream stream) throws org.gcube.com.fasterxml.jackson.core.JsonParseException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException Creates a resource of given class from its serialization in a givenInputStream.- Parameters:
clz- the class of the resourcestream- the stream- Returns:
- the resource
- Throws:
IOExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionorg.gcube.com.fasterxml.jackson.core.JsonParseException
-
unmarshal
public static <EE extends ExecutorException> EE unmarshal(Class<EE> clz, String string) throws org.gcube.com.fasterxml.jackson.core.JsonParseException, org.gcube.com.fasterxml.jackson.databind.JsonMappingException, IOException Creates a resource of given class from its serialization in a given String- Parameters:
clz- the class of the resourcestring-- Returns:
- the resource
- Throws:
org.gcube.com.fasterxml.jackson.core.JsonParseExceptionorg.gcube.com.fasterxml.jackson.databind.JsonMappingExceptionIOException
-