Class HttpImageResolver
java.lang.Object
org.mapfish.print.processor.jasper.HttpImageResolver
- All Implemented Interfaces:
ConfigurationObject,TableColumnConverter<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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(String text) Returns true if the converter can convert the given input.resolve(MfClientHttpRequestFactory requestFactory, String text) Convert the value.voidsetUrlExtractor(String pattern) Sets the RegExp pattern to use for extracting the url from the text.voidsetUrlGroup(int urlGroup) Select the group in the regular expression that contains the url.voidvalidate(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.
-
Constructor Details
-
HttpImageResolver
public HttpImageResolver()Constructor.
-
-
Method Details
-
setUrlExtractor
Sets the RegExp pattern to use for extracting the url from the text. By default, the whole string is used.For example:
.*&img src="([^"]+)".*- Parameters:
pattern- The url extractor regular expression. Default is"(.*)"
-
setUrlGroup
public void setUrlGroup(int urlGroup) Select the group in the regular expression that contains the url.- Parameters:
urlGroup- the index of the group (starting at 1) that contains the url.
-
resolve
Description copied from interface:TableColumnConverterConvert the value.- Specified by:
resolvein interfaceTableColumnConverter<BufferedImage>- Parameters:
requestFactory- for fetching file and http resources.text- the cell value.
-
validate
Description copied from interface:ConfigurationObjectvalidate that the configuration was correct.- Specified by:
validatein interfaceConfigurationObject- Parameters:
validationErrors- a list to add any detected errors to.configuration- the containing configuration
-
canConvert
Description copied from interface:TableColumnConverterReturns true if the converter can convert the given input.- Specified by:
canConvertin interfaceTableColumnConverter<BufferedImage>- Parameters:
text- the input to convert.
-