Class TestDCH

  • All Implemented Interfaces:
    jakarta.activation.DataContentHandler

    public class TestDCH
    extends java.lang.Object
    implements jakarta.activation.DataContentHandler
    Test DCH that does nothing. Just provides an object
    • Constructor Summary

      Constructors 
      Constructor Description
      TestDCH()  
      TestDCH​(java.lang.String mimeType)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getContent​(jakarta.activation.DataSource ds)
      Return an object representing the data in its most preferred form.
      static java.lang.String getDataFlavorName()  
      static java.lang.String getDefaultMimeType()  
      java.lang.String getMimeType()  
      static java.lang.Object getObject()  
      java.lang.Object getTransferData​(jakarta.activation.ActivationDataFlavor df, jakarta.activation.DataSource ds)  
      jakarta.activation.ActivationDataFlavor[] getTransferDataFlavors()  
      void writeTo​(java.lang.Object obj, java.lang.String mimeType, java.io.OutputStream os)
      Convert the object to a byte stream of the specified MIME type and write it to the output stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TestDCH

        public TestDCH​(java.lang.String mimeType)
      • TestDCH

        public TestDCH()
    • Method Detail

      • getDefaultMimeType

        public static java.lang.String getDefaultMimeType()
      • getDataFlavorName

        public static java.lang.String getDataFlavorName()
      • getObject

        public static java.lang.Object getObject()
      • getTransferDataFlavors

        public jakarta.activation.ActivationDataFlavor[] getTransferDataFlavors()
        Specified by:
        getTransferDataFlavors in interface jakarta.activation.DataContentHandler
      • getTransferData

        public java.lang.Object getTransferData​(jakarta.activation.ActivationDataFlavor df,
                                                jakarta.activation.DataSource ds)
                                         throws java.io.IOException
        Specified by:
        getTransferData in interface jakarta.activation.DataContentHandler
        Throws:
        java.io.IOException
      • getContent

        public java.lang.Object getContent​(jakarta.activation.DataSource ds)
                                    throws java.io.IOException
        Return an object representing the data in its most preferred form. Generally this will be the form described by the first ActivationDataFlavor returned by the getTransferDataFlavors method.
        Specified by:
        getContent in interface jakarta.activation.DataContentHandler
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(java.lang.Object obj,
                            java.lang.String mimeType,
                            java.io.OutputStream os)
                     throws java.io.IOException
        Convert the object to a byte stream of the specified MIME type and write it to the output stream.
        Specified by:
        writeTo in interface jakarta.activation.DataContentHandler
        Throws:
        java.io.IOException
      • getMimeType

        public java.lang.String getMimeType()