HttpMessageConverter that can write a single
ResourceRegion or Collections of ResourceRegions.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | canRead(Class<?>
the class to test for readability clazz, MediaType the media type to read (can be mediaType)null if not specified);
typically the value of a Content-Type header.Overrides org. Implements org. Indicates whether the given class can be read by this converter. |
| public boolean | canRead(Type
the (potentially generic) type to test for readability type, Class<?> a context class for the target type, for example a class
in which the target type appears in a method signature (can be contextClass, MediaType null)the media type to read, can be mediaType)null if not specified.
Typically, the value of a Content-Type header.Overrides org. Implements org. Indicates whether the given type can be read by this converter. |
| public boolean | canWrite(Class<?>
the class to test for writability clazz, MediaType the media type to write (can be mediaType)null if not specified);
typically the value of an Accept header.Overrides org. Implements org. Indicates whether the given class can be written by this converter. |
| public boolean | canWrite(Type
the (potentially generic) type to test for writability
(can be type, Class<?> null if not specified)the source object class to test for writability clazz, MediaType the media type to write (can be mediaType)null if not specified);
typically the value of an Accept header.Overrides org. Implements org. Indicates whether the given class can be written by this converter. |
| protected MediaType | getDefaultContentType(Object
the type to return the content type for object)Overrides org. Returns the default content type for the given type. |
| private static void | |
| private static void | |
| public Object | read(Type
the (potentially generic) type of object to return. This type must have
previously been passed to the type, Class<?> canRead method of this interface,
which must have returned true.a context class for the target type, for example a class
in which the target type appears in a method signature (can be contextClass, HttpInputMessage null)the HTTP input message to read from inputMessage)Implements org. Read an object of the given type form the given input message, and returns it. |
| protected ResourceRegion | readInternal(Class<?>
the type of object to return clazz, HttpInputMessage the HTTP input message to read from inputMessage)Implements abstract org. Abstract template method that reads the actual object. |
| protected boolean | supportsRepeatableWrites(Object
the object t object)Overrides org. Indicates whether this message converter can write the given object multiple times. |
| private boolean | supportsRepeatableWrites(ResourceRegion
the object t region)Overrides org. Indicates whether this message converter can write the given object multiple times. |
| protected void | writeInternal(Object
the object to write to the output message object, Type the type of object to write (may be type, HttpOutputMessage null)the HTTP output message to write to outputMessage)Implements abstract org. Abstract template method that writes the actual body. |
| protected void | |
| private void | writeResourceRegionCollection(Collection<ResourceRegion> resourceRegions, HttpOutputMessage outputMessage)
|
| ResourceRegionHttpMessageConverter | back to summary |
|---|---|
| public ResourceRegionHttpMessageConverter() | |
| canRead | back to summary |
|---|---|
| public boolean canRead(Class<?> clazz, MediaType mediaType) Overrides org. Implements org. Doc from org. Indicates whether the given class can be read by this converter. | |
| canRead | back to summary |
|---|---|
| public boolean canRead(Type type, Class<?> contextClass, MediaType mediaType) Overrides org. Implements org. Doc from org. Indicates whether the given type can be read by this converter.
This method should perform the same checks as
| |
| canWrite | back to summary |
|---|---|
| public boolean canWrite(Class<?> clazz, MediaType mediaType) Overrides org. Implements org. Doc from org. Indicates whether the given class can be written by this converter. | |
| canWrite | back to summary |
|---|---|
| public boolean canWrite(Type type, Class<?> clazz, MediaType mediaType) Overrides org. Implements org. Doc from org. Indicates whether the given class can be written by this converter. This method should perform the same checks as
| |
| getDefaultContentType | back to summary |
|---|---|
| protected MediaType getDefaultContentType(Object object) Overrides org. Doc from org. Returns the default content type for the given type. Called when By default, this returns the first element of the
| |
| back to summary | |
|---|---|
| private static void print(OutputStream os, String buf) throws IOException | |
| println | back to summary |
|---|---|
| private static void println(OutputStream os) throws IOException | |
| read | back to summary |
|---|---|
| public Object read(Type type, Class<?> contextClass, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException Implements org. Doc from org. Read an object of the given type form the given input message, and returns it.
| |
| readInternal | back to summary |
|---|---|
| protected ResourceRegion readInternal(Class<?> clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException Implements abstract org. Doc from org. Abstract template method that reads the actual object. Invoked from
| |
| supportsRepeatableWrites | back to summary |
|---|---|
| protected boolean supportsRepeatableWrites(Object object) Overrides org. Doc from org. Indicates whether this message converter can write the given object multiple times. Default implementation returns
| |
| supportsRepeatableWrites | back to summary |
|---|---|
| private boolean supportsRepeatableWrites(ResourceRegion region) Overrides org. Doc from org. Indicates whether this message converter can write the given object multiple times. Default implementation returns
| |
| writeInternal | back to summary |
|---|---|
| protected void writeInternal(Object object, Type type, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException Implements abstract org. Doc from org. Abstract template method that writes the actual body. Invoked from
| |
| writeResourceRegion | back to summary |
|---|---|
| protected void writeResourceRegion(ResourceRegion region, HttpOutputMessage outputMessage) throws IOException | |
| writeResourceRegionCollection | back to summary |
|---|---|
| private void writeResourceRegionCollection(Collection<ResourceRegion> resourceRegions, HttpOutputMessage outputMessage) throws IOException | |