Class JSONImage
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap
fr.opensagres.xdocreport.document.json.JSONObject
fr.opensagres.xdocreport.document.json.JSONImage
- All Implemented Interfaces:
IImageProvider,IJSONNode,Serializable,Cloneable,Map
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields inherited from class fr.opensagres.xdocreport.document.json.JSONObject
DEFAULT_UPPER_CASE, NULL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfr.opensagres.xdocreport.template.formatter.NullImageBehaviourReturns the behaviour to use when the stream of the image is null.Returns the height image with pixel unit.fr.opensagres.xdocreport.core.document.ImageFormatReturns the image format.Returns the width image with pixel unit.booleanisResize()Returns true if call ofIImageProvider.setWidth(Float)must compute image height with ratio or if call ofIImageProvider.setHeight(Float)must compute image with with ratio and false otherwise.booleanReturns true if image size comes from the image and false otherwise.booleanisValid()Returns true if the image provider is valid (ex : input stream not null) and false otherwise.voidsetBehaviour(fr.opensagres.xdocreport.template.formatter.NullImageBehaviour behaviour) Set the behaviour to use when the stream of the image is null.voidSet the height image with pixel unit.voidsetResize(boolean resize) Set true if call ofIImageProvider.setWidth(Float)must compute image height with ratio or if call ofIImageProvider.setHeight(Float)must compute image with with ratio and false otherwise.voidSet the width and height image with pixel unit.voidsetUseImageSize(boolean useImageSize) Set true if image size comes from the image and false otherwise.voidSet the width image with pixel unit.voidwrite(OutputStream outputStream) Write the binary data of the image in the given output stream.Methods inherited from class fr.opensagres.xdocreport.document.json.JSONObject
accumulate, append, doubleToString, get, getBoolean, getDate, getDouble, getInt, getJSONArray, getJSONObject, getLong, getNames, getNames, getString, has, increment, isDate, isImage, isNull, isUpperCaseFirstChar, keys, length, names, numberToString, opt, optBoolean, optBoolean, optDouble, optDouble, optInt, optInt, optJSONArray, optJSONObject, optLong, optLong, optString, optString, put, put, put, put, put, put, put, putOnce, putOpt, quote, remove, stringToValue, testValidity, toJSONArray, toString, toString, valueToString, wrap, writeMethods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode
-
Constructor Details
-
JSONImage
public JSONImage()
-
-
Method Details
-
write
Description copied from interface:IImageProviderWrite the binary data of the image in the given output stream.- Specified by:
writein interfaceIImageProvider- Throws:
IOException
-
getImageFormat
public fr.opensagres.xdocreport.core.document.ImageFormat getImageFormat()Description copied from interface:IImageProviderReturns the image format.- Specified by:
getImageFormatin interfaceIImageProvider- Returns:
-
getWidth
Description copied from interface:IImageProviderReturns the width image with pixel unit.- Specified by:
getWidthin interfaceIImageProvider- Parameters:
defaultWidth- as pixel- Returns:
- Throws:
IOException
-
setWidth
Description copied from interface:IImageProviderSet the width image with pixel unit.- Specified by:
setWidthin interfaceIImageProvider
-
getHeight
Description copied from interface:IImageProviderReturns the height image with pixel unit.- Specified by:
getHeightin interfaceIImageProvider- Parameters:
defaultHeight- as pixel- Returns:
- Throws:
IOException
-
setHeight
Description copied from interface:IImageProviderSet the height image with pixel unit.- Specified by:
setHeightin interfaceIImageProvider
-
setSize
Description copied from interface:IImageProviderSet the width and height image with pixel unit.- Specified by:
setSizein interfaceIImageProvider
-
isUseImageSize
public boolean isUseImageSize()Description copied from interface:IImageProviderReturns true if image size comes from the image and false otherwise.- Specified by:
isUseImageSizein interfaceIImageProvider- Returns:
-
setUseImageSize
public void setUseImageSize(boolean useImageSize) Description copied from interface:IImageProviderSet true if image size comes from the image and false otherwise.- Specified by:
setUseImageSizein interfaceIImageProvider
-
setResize
public void setResize(boolean resize) Description copied from interface:IImageProviderSet true if call ofIImageProvider.setWidth(Float)must compute image height with ratio or if call ofIImageProvider.setHeight(Float)must compute image with with ratio and false otherwise.- Specified by:
setResizein interfaceIImageProvider
-
isResize
public boolean isResize()Description copied from interface:IImageProviderReturns true if call ofIImageProvider.setWidth(Float)must compute image height with ratio or if call ofIImageProvider.setHeight(Float)must compute image with with ratio and false otherwise.- Specified by:
isResizein interfaceIImageProvider- Returns:
-
getBehaviour
public fr.opensagres.xdocreport.template.formatter.NullImageBehaviour getBehaviour()Description copied from interface:IImageProviderReturns the behaviour to use when the stream of the image is null.- Specified by:
getBehaviourin interfaceIImageProvider- Returns:
-
setBehaviour
public void setBehaviour(fr.opensagres.xdocreport.template.formatter.NullImageBehaviour behaviour) Description copied from interface:IImageProviderSet the behaviour to use when the stream of the image is null.- Specified by:
setBehaviourin interfaceIImageProvider
-
isValid
public boolean isValid()Description copied from interface:IImageProviderReturns true if the image provider is valid (ex : input stream not null) and false otherwise.- Specified by:
isValidin interfaceIImageProvider- Returns:
-