Package sonia.scm.net.ahc
Interface ContentTransformer
@ExtensionPoint
public interface ContentTransformer
Transforms
ByteSource content to an object and vice versa. This class
is an extension point, this means that plugins can define their own
ContentTransformer implementations by implementing the interface and
annotate the implementation with the Extension
annotation.- Since:
- 1.46
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisResponsible(Class<?> type, String contentType) Returnstrueif the transformer is responsible for the given object and content type.com.google.common.io.ByteSourceMarshalls the given object into aByteSource.<T> Tunmarshall(Class<T> type, com.google.common.io.ByteSource content) Unmarshall theByteSourcecontent to an object of the given type.
-
Method Details
-
isResponsible
Returnstrueif the transformer is responsible for the given object and content type.- Parameters:
type- object typecontentType- content type
-
marshall
Marshalls the given object into aByteSource.- Parameters:
object- object to marshall- Returns:
- string content
-
unmarshall
Unmarshall theByteSourcecontent to an object of the given type.- Type Parameters:
T- type of result object- Parameters:
type- type of result objectcontent- content
-