Class ImageProcessor

    • Constructor Summary

      Constructors 
      Constructor Description
      ImageProcessor()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.awt.Image imageFromBytes​(byte[] data, java.lang.Class<?> clazz)  
      static byte[] imageToStandardBytes​(java.awt.Image image, java.lang.String mimeType)
      Convert image to bytes.
      protected static byte[] imageToStandardBytesImpl​(java.awt.image.RenderedImage renderedImage, java.lang.String mimeType)
      Convert image to bytes.
      boolean isApplicable​(java.lang.Object object, java.lang.reflect.Type type, java.lang.ClassLoader targetcl, java.lang.Object context)
      Test if the processor is applicable.
      java.lang.Object process​(java.lang.Object object, java.lang.reflect.Type type, Traverser traverser, java.util.List<ITraverseProcessor> conversionprocessors, java.util.List<ITraverseProcessor> processors, IStringConverter converter, Traverser.MODE mode, java.lang.ClassLoader targetcl, java.lang.Object context)
      Process an object.
      • Methods inherited from class java.lang.Object

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

      • ImageProcessor

        public ImageProcessor()
    • Method Detail

      • isApplicable

        public boolean isApplicable​(java.lang.Object object,
                                    java.lang.reflect.Type type,
                                    java.lang.ClassLoader targetcl,
                                    java.lang.Object context)
        Test if the processor is applicable.
        Specified by:
        isApplicable in interface ITraverseProcessor
        Parameters:
        object - The object.
        targetcl - If not null, the traverser should make sure that the result object is compatible with the class loader, e.g. by cloning the object using the class loaded from the target class loader.
        Returns:
        True, if is applicable.
      • process

        public java.lang.Object process​(java.lang.Object object,
                                        java.lang.reflect.Type type,
                                        Traverser traverser,
                                        java.util.List<ITraverseProcessor> conversionprocessors,
                                        java.util.List<ITraverseProcessor> processors,
                                        IStringConverter converter,
                                        Traverser.MODE mode,
                                        java.lang.ClassLoader targetcl,
                                        java.lang.Object context)
        Process an object.
        Specified by:
        process in interface ITraverseProcessor
        Parameters:
        object - The object.
        targetcl - If not null, the traverser should make sure that the result object is compatible with the class loader, e.g. by cloning the object using the class loaded from the target class loader.
        Returns:
        The processed object.
      • imageFromBytes

        public static java.awt.Image imageFromBytes​(byte[] data,
                                                    java.lang.Class<?> clazz)
      • imageToStandardBytes

        public static byte[] imageToStandardBytes​(java.awt.Image image,
                                                  java.lang.String mimeType)
        Convert image to bytes. Method is a direct copy from protected method sun.awt.datatransfer.DataTransferer
      • imageToStandardBytesImpl

        protected static byte[] imageToStandardBytesImpl​(java.awt.image.RenderedImage renderedImage,
                                                         java.lang.String mimeType)
                                                  throws java.io.IOException
        Convert image to bytes. Method is a direct copy from protected method sun.awt.datatransfer.DataTransferer
        Throws:
        java.io.IOException