Class handler_base

    • Constructor Detail

      • handler_base

        public handler_base()
    • Method Detail

      • getDataFlavors

        protected abstract ActivationDataFlavor[] getDataFlavors()
        Return an array of ActivationDataFlavors that we support. Usually there will be only one.
        Returns:
        array of ActivationDataFlavors that we support
      • getData

        protected java.lang.Object getData​(ActivationDataFlavor aFlavor,
                                           DataSource ds)
                                    throws java.io.IOException
        Given the flavor that matched, return the appropriate type of object. Usually there's only one flavor so just call getContent.
        Parameters:
        aFlavor - the ActivationDataFlavor
        ds - DataSource containing the data
        Returns:
        the object
        Throws:
        java.io.IOException - for errors reading the data
      • getTransferData

        public java.lang.Object getTransferData​(ActivationDataFlavor df,
                                                DataSource ds)
                                         throws java.io.IOException
        Return the Transfer Data of type DataFlavor from InputStream.
        Specified by:
        getTransferData in interface DataContentHandler
        Parameters:
        df - The DataFlavor
        ds - The DataSource corresponding to the data
        Returns:
        the object
        Throws:
        java.io.IOException - for errors reading the data