public final class HttpImageResolver extends java.lang.Object implements TableColumnConverter<java.awt.image.BufferedImage>
Interprets text in a table cell as an image URL.
See also: Configuration of tables with HTML images
[[examples=datasource_many_dynamictables_legend]]| Constructor and Description |
|---|
HttpImageResolver()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(java.lang.String text)
Returns true if the converter can convert the given input.
|
java.awt.image.BufferedImage |
resolve(MfClientHttpRequestFactory requestFactory,
java.lang.String text)
Convert the value.
|
void |
setUrlExtractor(java.lang.String pattern)
Sets the RegExp pattern to use for extracting the url from the text.
|
void |
setUrlGroup(int urlGroup)
Select the group in the regular expression that contains the url.
|
void |
validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
validate that the configuration was correct.
|
public void setUrlExtractor(java.lang.String pattern)
For example: .*&img src="([^"]+)".*
pattern - The url extractor regular expression. Default is "(.*)"public void setUrlGroup(int urlGroup)
urlGroup - the index of the group (starting at 1) that contains the url.public java.awt.image.BufferedImage resolve(MfClientHttpRequestFactory requestFactory, java.lang.String text)
TableColumnConverterresolve in interface TableColumnConverter<java.awt.image.BufferedImage>requestFactory - for fetching file and http resources.text - the cell value.public void validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
ConfigurationObjectvalidate in interface ConfigurationObjectvalidationErrors - a list to add any detected errors to.configuration - the containing configurationpublic boolean canConvert(java.lang.String text)
TableColumnConvertercanConvert in interface TableColumnConverter<java.awt.image.BufferedImage>text - the input to convert.