public interface MediaTypeFactory extends org.refcodes.factory.UnmarshalFactory<String>, org.refcodes.factory.MarshalFactory<String>, MediaTypeAccessor
MediaTypeFactory
creates instances from an HTTP body and creates
an HTTP body from given instances according to the MediaType
(as of
MediaTypeAccessor.getMediaType()
) for which the MediaTypeFactory
is
responsible.MediaTypeAccessor.MediaTypeBuilder<B extends MediaTypeAccessor.MediaTypeBuilder<B>>, MediaTypeAccessor.MediaTypeMutator, MediaTypeAccessor.MediaTypeProperty
Modifier and Type | Method and Description |
---|---|
String |
toMarshaled(Object aObject)
Marshals an object to an HTP body as of the according
MediaType
specified by MediaTypeAccessor.getMediaType() . |
<T> T |
toUnmarshaled(String aHttpBody,
Class<T> aType)
Unmarshals an object to an HTP body as of the according
MediaType
specified by MediaTypeAccessor.getMediaType() . |
getMediaType
String toMarshaled(Object aObject) throws org.refcodes.exception.MarshalException
MediaType
specified by MediaTypeAccessor.getMediaType()
.<T> T toUnmarshaled(String aHttpBody, Class<T> aType) throws org.refcodes.exception.UnmarshalException
MediaType
specified by MediaTypeAccessor.getMediaType()
.toUnmarshaled
in interface org.refcodes.factory.UnmarshalFactory<String>
aHttpBody
- The HTTP body to be converted to an instance of the
given type.aType
- The type being expected from unmarshaling the provided HTTP
body.MediaType
.org.refcodes.exception.UnmarshalException
Copyright © 2016. All rights reserved.