Class ImageEncoders


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

      Constructors 
      Constructor Description
      ImageEncoders()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Class getEncoderClass​(java.lang.String format)
      Returns the class of the image encoder for the specified format, or null if not specified yet.
      static ImageEncoder newInstance​(java.lang.String format)
      Instantiates and returns the image encoder for the specified format.
      static java.lang.Class setEncoderClass​(java.lang.String format, java.lang.Class klass)
      Sets the class of the image encoder for the specified format.
      • Methods inherited from class java.lang.Object

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

      • ImageEncoders

        public ImageEncoders()
    • Method Detail

      • newInstance

        public static ImageEncoder newInstance​(java.lang.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:
        java.lang.IllegalArgumentException - if the encoder of the specified format is not found
        SystemException - if failed to instantiate the encoder
      • setEncoderClass

        public static java.lang.Class setEncoderClass​(java.lang.String format,
                                                      java.lang.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 java.lang.Class getEncoderClass​(java.lang.String format)
        Returns the class of the image encoder for the specified format, or null if not specified yet.