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 TypeMethodDescriptionboolean
isResponsible
(Class<?> type, String contentType) Returnstrue
if the transformer is responsible for the given object and content type.com.google.common.io.ByteSource
Marshalls the given object into aByteSource
.<T> T
unmarshall
(Class<T> type, com.google.common.io.ByteSource content) Unmarshall theByteSource
content to an object of the given type.
-
Method Details
-
isResponsible
Returnstrue
if 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 theByteSource
content to an object of the given type.- Type Parameters:
T
- type of result object- Parameters:
type
- type of result objectcontent
- content
-