Package org.zkoss.image.encoder
Class ImageEncoders
java.lang.Object
org.zkoss.image.encoder.ImageEncoders
The factory of the image encodes.
- Since:
- 3.0.7
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassgetEncoderClass(String format) Returns the class of the image encoder for the specified format, or null if not specified yet.static ImageEncodernewInstance(String format) Instantiates and returns the image encoder for the specified format.static ClasssetEncoderClass(String format, Class klass) Sets the class of the image encoder for the specified format.
-
Constructor Details
-
ImageEncoders
public ImageEncoders()
-
-
Method Details
-
newInstance
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 foundSystemException- if failed to instantiate the encoder
-
setEncoderClass
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 implementImageEncoder.- Returns:
- the previous encoder, or null if not set yet.
-
getEncoderClass
Returns the class of the image encoder for the specified format, or null if not specified yet.
-