Class HtmlMediaTypeFactory

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


    public class HtmlMediaTypeFactory
    extends java.lang.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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.factory.MarshalFactory

        org.refcodes.factory.MarshalFactory.MarshalFactoryComplement<C extends java.lang.Object>, org.refcodes.factory.MarshalFactory.MarshalFactoryComposite<T extends java.lang.Object,C extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.factory.UnmarshalFactory

        org.refcodes.factory.UnmarshalFactory.UnmarshalFactoryComplement<C extends java.lang.Object>, org.refcodes.factory.UnmarshalFactory.UnmarshalFactoryComposite<T extends java.lang.Object,C extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T fromMarshaled​(java.io.InputStream aContentInputStream, java.lang.Class<T> aType)
      java.lang.Object fromMarshaled​(java.io.InputStream aContentInputStream, java.util.Map<java.lang.String,java.lang.String> aProperties, java.lang.Class<?>... aTypes)
      MediaType[] getMediaTypes​()
      Retrieves the Media-Types from the Media-Types property.
      protected java.io.InputStream toInputStream​(java.lang.String aString)
      Converts the given String to an InputStream.
      java.lang.String toMarshaled​(java.lang.Object aObject)
      protected java.lang.String toPrettyPrint​(java.lang.String aHtml)
      Pretty printing yet to be implemented!
      <T> T toUnmarshaled​(java.lang.String aContext, java.lang.Class<T> aType)
      <T> T toUnmarshaled​(java.lang.String aHttpBody, java.lang.Class<T> aType, java.util.Map<java.lang.String,java.lang.String> aProperties)
      • Methods inherited from interface org.refcodes.factory.MarshalFactory

        toMarshaled
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.refcodes.factory.UnmarshalFactory

        toUnmarshaled, toUnmarshaled
    • Constructor Detail

      • HtmlMediaTypeFactory

        public HtmlMediaTypeFactory​()
    • Method Detail

      • 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 java.lang.String toMarshaled​(java.lang.Object aObject)
                                     throws org.refcodes.exception.MarshalException
        Specified by:
        toMarshaled in interface org.refcodes.factory.MarshalFactory<java.lang.String>
        Throws:
        org.refcodes.exception.MarshalException
      • toUnmarshaled

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

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

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

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

        protected java.lang.String toPrettyPrint​(java.lang.String aHtml)
        Pretty printing yet to be implemented!
        Parameters:
        aHtml - The HTML to be pretty printed.
        Returns:
        The pretty printed HTML.
      • toInputStream

        protected java.io.InputStream toInputStream​(java.lang.String aString)
        Converts the given String to an InputStream.
        Parameters:
        aString - The String to be converted.
        Returns:
        The according InputStream.