Class MediaTypeProvider

  • All Implemented Interfaces:
    jakarta.ws.rs.ext.RuntimeDelegate.HeaderDelegate<jakarta.ws.rs.core.MediaType>, HeaderDelegateProvider<jakarta.ws.rs.core.MediaType>

    @Singleton
    public class MediaTypeProvider
    extends Object
    implements HeaderDelegateProvider<jakarta.ws.rs.core.MediaType>
    Header delegate provider for MediaType.
    Author:
    Marc Hadley, Marek Potociar, Martin Matula
    • Constructor Detail

      • MediaTypeProvider

        public MediaTypeProvider()
    • Method Detail

      • supports

        public boolean supports​(Class<?> type)
        Description copied from interface: HeaderDelegateProvider
        Ascertain if the Provider supports a particular type.
        Specified by:
        supports in interface HeaderDelegateProvider<jakarta.ws.rs.core.MediaType>
        Parameters:
        type - the type that is to be supported.
        Returns:
        true if the type is supported, otherwise false.
      • toString

        public String toString​(jakarta.ws.rs.core.MediaType header)
        Specified by:
        toString in interface jakarta.ws.rs.ext.RuntimeDelegate.HeaderDelegate<jakarta.ws.rs.core.MediaType>
      • fromString

        public jakarta.ws.rs.core.MediaType fromString​(String header)
        Specified by:
        fromString in interface jakarta.ws.rs.ext.RuntimeDelegate.HeaderDelegate<jakarta.ws.rs.core.MediaType>
      • valueOf

        public static jakarta.ws.rs.core.MediaType valueOf​(HttpHeaderReader reader)
                                                    throws ParseException
        Create a new MediaType instance from a header reader.
        Parameters:
        reader - header reader.
        Returns:
        new MediaType instance.
        Throws:
        ParseException - in case of a header parsing error.