Class HtmlMediaTypeFactory

java.lang.Object
org.refcodes.web.HtmlMediaTypeFactory
All Implemented Interfaces:
org.refcodes.factory.MarshalFactory<String>, org.refcodes.factory.MarshalFactory.MarshalFactoryComplement<InputStream>, org.refcodes.factory.MarshalFactory.MarshalFactoryComposite<String,InputStream>, org.refcodes.factory.UnmarshalFactory<String>, org.refcodes.factory.UnmarshalFactory.UnmarshalFactoryComplement<InputStream>, org.refcodes.factory.UnmarshalFactory.UnmarshalFactoryComposite<String,InputStream>, MediaTypeFactory, MediaTypesAccessor

public class HtmlMediaTypeFactory extends Object implements MediaTypeFactory
Implements the MediaTypeFactory for Media-Type "application/YAML" ( MediaType.APPLICATION_YAML). CAUTION: This implementation uses field resolution instead of getter/setter property resolution as of the used marshaling API.
  • Constructor Details

    • HtmlMediaTypeFactory

      public HtmlMediaTypeFactory()
  • Method Details

    • getMediaTypes

      public MediaType[] getMediaTypes()
      Retrieves the Media-Types from the Media-Types property.
      Specified by:
      getMediaTypes in interface MediaTypesAccessor
      Returns:
      The Media-Types stored by the Media-Types property.
    • toMarshaled

      public <SRC> String toMarshaled(SRC aContext) throws org.refcodes.exception.MarshalException
      Specified by:
      toMarshaled in interface org.refcodes.factory.MarshalFactory<String>
      Throws:
      org.refcodes.exception.MarshalException
    • toMarshaled

      public <SRC> String toMarshaled(SRC aObject, Map<String,String> aProperties) throws org.refcodes.exception.MarshalException
      Specified by:
      toMarshaled in interface org.refcodes.factory.MarshalFactory<String>
      Throws:
      org.refcodes.exception.MarshalException
    • toUnmarshaled

      public <T> T toUnmarshaled(String aContext, Class<T> aType) throws org.refcodes.exception.UnmarshalException
      Specified by:
      toUnmarshaled in interface org.refcodes.factory.UnmarshalFactory<String>
      Throws:
      org.refcodes.exception.UnmarshalException
    • toUnmarshaled

      public <T> T toUnmarshaled(String aHttpBody, Class<T> aType, Map<String,String> aProperties) throws org.refcodes.exception.UnmarshalException
      Specified by:
      toUnmarshaled in interface org.refcodes.factory.UnmarshalFactory<String>
      Throws:
      org.refcodes.exception.UnmarshalException
    • fromMarshaled

      public <T> T fromMarshaled(InputStream aContentInputStream, Class<T> aType) throws org.refcodes.exception.UnmarshalException
      Specified by:
      fromMarshaled in interface MediaTypeFactory
      Specified by:
      fromMarshaled in interface org.refcodes.factory.UnmarshalFactory.UnmarshalFactoryComplement<InputStream>
      Throws:
      org.refcodes.exception.UnmarshalException
    • fromMarshaled

      public Object fromMarshaled(InputStream aContentInputStream, Map<String,String> aProperties, Class<?>... aTypes) throws org.refcodes.exception.UnmarshalException
      Specified by:
      fromMarshaled in interface MediaTypeFactory
      Specified by:
      fromMarshaled in interface org.refcodes.factory.UnmarshalFactory.UnmarshalFactoryComplement<InputStream>
      Throws:
      org.refcodes.exception.UnmarshalException