Class ImageEncoders

java.lang.Object
org.zkoss.image.encoder.ImageEncoders

public class ImageEncoders extends Object
The factory of the image encodes.
Since:
3.0.7
Author:
tomyeh
  • Constructor Details

    • ImageEncoders

      public ImageEncoders()
  • Method Details

    • newInstance

      public static ImageEncoder newInstance(String format)
      Instantiates and returns the image encoder for the specified format.
      Parameters:
      format - The image format of the ZK image being encoded to. It can be "png" or "jpeg".
      Throws:
      IllegalArgumentException - if the encoder of the specified format is not found
      SystemException - if failed to instantiate the encoder
    • setEncoderClass

      public static Class setEncoderClass(String format, Class klass)
      Sets the class of the image encoder for the specified format.

      An instance of the specified class is instantiated each time newInstance(java.lang.String) is called.

      Parameters:
      format - The image format of the ZK image being encoded to. It can be "png" or "jpeg".
      klass - the class of the image encoder. It must implement ImageEncoder.
      Returns:
      the previous encoder, or null if not set yet.
    • getEncoderClass

      public static Class getEncoderClass(String format)
      Returns the class of the image encoder for the specified format, or null if not specified yet.