Class YamlMediaTypeFactory

  • 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 YamlMediaTypeFactory
    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.
    • Constructor Detail

      • YamlMediaTypeFactory

        public YamlMediaTypeFactory​()
        Instantiates a new application YAML factory.
    • 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 aHttpBody,
                                   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