Class ImageProcessor
- java.lang.Object
-
- jadex.commons.transformation.traverser.ImageProcessor
-
- All Implemented Interfaces:
ITraverseProcessor
public class ImageProcessor extends java.lang.Object implements ITraverseProcessor
-
-
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.
-
-
-
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 interfaceITraverseProcessor
- 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 interfaceITraverseProcessor
- 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
-
-