public class ManualAdapterModuleImpl extends Object implements HalHttpMessageConverterModule
HalHttpMessageConverterModule
that allows manual registration of RepresentationWriter
and RepresentationReader for a given Class| Constructor and Description |
|---|
ManualAdapterModuleImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead(Class<?> type)
Can this module
read the supplied type?
|
boolean |
canWrite(Class<?> type)
Can this module write the
supplied type?
|
Object |
read(com.theoryinpractise.halbuilder.api.ReadableRepresentation representation,
Class<?> type)
Convert a HAL
ReadableRepresentation
to an object |
void |
registerReader(RepresentationReader<?> reader)
Register a
RepresentationReader
Note: uses a bit of reflection magic that I
feel occasionally a bit nervous about due
to type erasure but it seems to work. |
void |
registerWriter(RepresentationWriter<?> writer)
Register a
RepresentationWriter
Note: uses a bit of reflection magic that I
feel occasionally a bit nervous about due
to type erasure but it seems to work. |
com.theoryinpractise.halbuilder.api.ReadableRepresentation |
write(Object target,
com.theoryinpractise.halbuilder.api.RepresentationFactory factory)
Convert an object to
a
ReadableRepresentation
using the supplied
RepresentationFactory |
public boolean canRead(Class<?> type)
HalHttpMessageConverterModulecanRead in interface HalHttpMessageConverterModulepublic boolean canWrite(Class<?> type)
HalHttpMessageConverterModulecanWrite in interface HalHttpMessageConverterModulepublic com.theoryinpractise.halbuilder.api.ReadableRepresentation write(Object target, com.theoryinpractise.halbuilder.api.RepresentationFactory factory)
HalHttpMessageConverterModuleReadableRepresentation
using the supplied
RepresentationFactorywrite in interface HalHttpMessageConverterModuletarget - the Object to convertfactory - the RepresentationFactory to useReadableRepresentation of the converted objectpublic Object read(com.theoryinpractise.halbuilder.api.ReadableRepresentation representation, Class<?> type)
HalHttpMessageConverterModuleReadableRepresentation
to an objectread in interface HalHttpMessageConverterModulerepresentation - Hal ReadableRepresentation to convertReadableRepresentationpublic void registerReader(RepresentationReader<?> reader)
RepresentationReader
Note: uses a bit of reflection magic that I
feel occasionally a bit nervous about due
to type erasure but it seems to work.reader - public void registerWriter(RepresentationWriter<?> writer)
RepresentationWriter
Note: uses a bit of reflection magic that I
feel occasionally a bit nervous about due
to type erasure but it seems to work.writer - Copyright © 2013. All Rights Reserved.