Interface HypermediaConverter
-
- All Known Subinterfaces:
PaginatableHypermediaConverter
@ProviderType public interface HypermediaConverter
Interface for a hypermedia converter that can render a Resource into a particular hypermedia type.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MEDIA_TYPE_ADOBE_ASSETS
static java.lang.String
MEDIA_TYPE_ADOBE_DIRECTORY
static java.lang.String
MEDIA_TYPE_ADOBE_METADATA
static java.lang.String
MEDIA_TYPE_ADOBE_RENDITION
static java.lang.String
MEDIA_TYPE_ADOBE_VERSIONS
static java.lang.String
MEDIA_TYPE_SIREN
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getMediaTypeMatcher()
Return the media type string this converter supportsConverterResponse
render(ConverterContext context, Resource resource, ModelDescription description)
Serialize the resource into the media type specific representationjava.lang.Object
renderSubEntity(ConverterContext context, Resource resource, ModelDescription description)
Serialize a resource to be embedded into the main resource serialization as a child.
-
-
-
Field Detail
-
MEDIA_TYPE_SIREN
static final java.lang.String MEDIA_TYPE_SIREN
- See Also:
- Constant Field Values
-
MEDIA_TYPE_ADOBE_DIRECTORY
static final java.lang.String MEDIA_TYPE_ADOBE_DIRECTORY
- See Also:
- Constant Field Values
-
MEDIA_TYPE_ADOBE_ASSETS
static final java.lang.String MEDIA_TYPE_ADOBE_ASSETS
- See Also:
- Constant Field Values
-
MEDIA_TYPE_ADOBE_RENDITION
static final java.lang.String MEDIA_TYPE_ADOBE_RENDITION
- See Also:
- Constant Field Values
-
MEDIA_TYPE_ADOBE_METADATA
static final java.lang.String MEDIA_TYPE_ADOBE_METADATA
- See Also:
- Constant Field Values
-
MEDIA_TYPE_ADOBE_VERSIONS
static final java.lang.String MEDIA_TYPE_ADOBE_VERSIONS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMediaTypeMatcher
@Nonnull java.lang.String getMediaTypeMatcher()
Return the media type string this converter supports- Returns:
- The media type this converter supports
-
render
@CheckForNull ConverterResponse render(ConverterContext context, Resource resource, ModelDescription description)
Serialize the resource into the media type specific representation- Parameters:
context
- The ConverterContextresource
- The Resource to renderdescription
- The ModelDescription describing the resource to be serialized- Returns:
- The media type specific representation of the resource.
-
renderSubEntity
@CheckForNull java.lang.Object renderSubEntity(ConverterContext context, Resource resource, ModelDescription description)
Serialize a resource to be embedded into the main resource serialization as a child. The Object returned must be a JSONObject, JSONArray, or instance of CharSequence- Parameters:
context
- The ConverterContextresource
- The Resource to renderdescription
- The ModelDescription describing the resource to be serialized- Returns:
- A JSONObject, JSONArray, or CharSequence serialization of the resource
-
-