Interface HypermediaConverter

    • Method Detail

      • getMediaTypeMatcher

        @Nonnull
        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 ConverterContext
        resource - The Resource to render
        description - The ModelDescription describing the resource to be serialized
        Returns:
        The media type specific representation of the resource.
      • renderSubEntity

        @CheckForNull
        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 ConverterContext
        resource - The Resource to render
        description - The ModelDescription describing the resource to be serialized
        Returns:
        A JSONObject, JSONArray, or CharSequence serialization of the resource