public class JxlsHelper extends Object
| Constructor and Description |
|---|
JxlsHelper() |
| Modifier and Type | Method and Description |
|---|---|
JxlsHelper |
buildExpressionNotation(String expressionNotationBegin,
String expressionNotationEnd)
Allows to set custom notation for expressions in the template
The notation is used in
createTransformer(InputStream, OutputStream) |
ExpressionEvaluator |
createExpressionEvaluator(String expression)
Creates
ExpressionEvaluator instance for evaluation of the given expression |
Transformer |
createTransformer(InputStream templateStream,
OutputStream targetStream)
Creates
Transformer instance connected to the given input stream
and output stream with the default or custom expression notation (see also buildExpressionNotation(String, String) |
AreaBuilder |
getAreaBuilder() |
ExpressionEvaluatorFactory |
getExpressionEvaluatorFactory() |
FormulaProcessor |
getFormulaProcessor() |
static JxlsHelper |
getInstance() |
static String |
getProperty(String key,
String defaultValue)
Returns the configuration property value
|
JxlsHelper |
gridExport(Collection headers,
Collection dataObjects,
String objectProps,
OutputStream outputStream)
Performs data grid export using
SimpleExporter |
boolean |
isDeleteTemplateSheet() |
boolean |
isHideTemplateSheet() |
boolean |
isProcessFormulas() |
boolean |
isUseFastFormulaProcessor() |
JxlsHelper |
processGridTemplate(InputStream templateStream,
OutputStream targetStream,
Context context,
String objectProps)
Processes the template with the
GridCommand |
void |
processGridTemplateAtCell(InputStream templateStream,
OutputStream targetStream,
Context context,
String objectProps,
String targetCell)
Processes the input template with
GridCommand at given target cell
using the given object properties and context |
void |
processTemplate(Context context,
Transformer transformer)
Processes a template with the given
Transformer instance and Context |
JxlsHelper |
processTemplate(InputStream templateStream,
OutputStream targetStream,
Context context)
Reads template from the source stream processes it using the supplied
Context and
writes the result to the target stream |
JxlsHelper |
processTemplateAtCell(InputStream templateStream,
OutputStream targetStream,
Context context,
String targetCell)
Processes the template from the given input stream
using the supplied
Context and the given target cell
and writes the result to the output stream |
JxlsHelper |
registerGridTemplate(InputStream inputStream)
Registers grid template to be used with
SimpleExporter |
JxlsHelper |
setAreaBuilder(AreaBuilder areaBuilder) |
JxlsHelper |
setDeleteTemplateSheet(boolean deleteTemplateSheet)
Marks template sheet for deletion
|
JxlsHelper |
setFormulaProcessor(FormulaProcessor formulaProcessor)
Sets formula processor implementation
|
JxlsHelper |
setHideTemplateSheet(boolean hideTemplateSheet)
Hides/shows template sheet
|
JxlsHelper |
setProcessFormulas(boolean processFormulas)
Enables or disables formula processing
|
JxlsHelper |
setUseFastFormulaProcessor(boolean useFastFormulaProcessor) |
public static JxlsHelper getInstance()
public AreaBuilder getAreaBuilder()
public JxlsHelper setAreaBuilder(AreaBuilder areaBuilder)
public FormulaProcessor getFormulaProcessor()
FormulaProcessor implementationpublic JxlsHelper setFormulaProcessor(FormulaProcessor formulaProcessor)
formulaProcessor - public boolean isProcessFormulas()
public JxlsHelper setProcessFormulas(boolean processFormulas)
processFormulas - enable/disable formula processing flagpublic boolean isHideTemplateSheet()
public JxlsHelper setHideTemplateSheet(boolean hideTemplateSheet)
hideTemplateSheet - true to hide template sheet or false to show itpublic boolean isDeleteTemplateSheet()
public JxlsHelper setDeleteTemplateSheet(boolean deleteTemplateSheet)
deleteTemplateSheet - true if template sheet should be deletedpublic boolean isUseFastFormulaProcessor()
FastFormulaProcessor should be usedpublic JxlsHelper setUseFastFormulaProcessor(boolean useFastFormulaProcessor)
useFastFormulaProcessor - if true the FastFormulaProcessor will be used to process
formulas otherwise StandardFormulaProcessor will be usedpublic JxlsHelper buildExpressionNotation(String expressionNotationBegin, String expressionNotationEnd)
createTransformer(InputStream, OutputStream)expressionNotationBegin - - notation prefixexpressionNotationEnd - - notation suffixpublic JxlsHelper processTemplate(InputStream templateStream, OutputStream targetStream, Context context) throws IOException
Context and
writes the result to the target streamtemplateStream - source input stream with the templatetargetStream - target output streamcontext - data mapIOExceptionpublic void processTemplate(Context context, Transformer transformer) throws IOException
Transformer instance and Contextcontext - data contexttransformer - transformer instanceIOExceptionpublic static String getProperty(String key, String defaultValue)
key - property keydefaultValue - default value to use if undefinedpublic ExpressionEvaluatorFactory getExpressionEvaluatorFactory()
ExpressionEvaluatorFactory implementationpublic ExpressionEvaluator createExpressionEvaluator(String expression)
ExpressionEvaluator instance for evaluation of the given expressionexpression - expression to evaluateExpressionEvaluator instance for evaluation the passed expressionpublic JxlsHelper processTemplateAtCell(InputStream templateStream, OutputStream targetStream, Context context, String targetCell) throws IOException
Context and the given target cell
and writes the result to the output streamtemplateStream - source input stream for the templatetargetStream - target output stream to write the processing resultcontext - data context maptargetCell - starting target cell into which the template area must be processedIOException - if input/output stream processing resolves in an errorpublic JxlsHelper processGridTemplate(InputStream templateStream, OutputStream targetStream, Context context, String objectProps) throws IOException
GridCommandtemplateStream - template input streamtargetStream - output stream for the resultcontext - context data mapobjectProps - object properties to use with the GridCommandIOExceptionpublic void processGridTemplateAtCell(InputStream templateStream, OutputStream targetStream, Context context, String objectProps, String targetCell) throws IOException
GridCommand at given target cell
using the given object properties and contexttemplateStream - template input streamtargetStream - result output streamcontext - context data mapobjectProps - object properties to use with GridCommandtargetCell - start target cell to use when processing the templateIOExceptionpublic JxlsHelper registerGridTemplate(InputStream inputStream) throws IOException
SimpleExporterinputStream - template input streamIOExceptionpublic JxlsHelper gridExport(Collection headers, Collection dataObjects, String objectProps, OutputStream outputStream)
SimpleExporterheaders - collection of headers to use for the exportdataObjects - collection of data objects to exportobjectProps - object properties (comma separated) to use with the GridCommandoutputStream - output stream to write the processing resultpublic Transformer createTransformer(InputStream templateStream, OutputStream targetStream)
Transformer instance connected to the given input stream
and output stream with the default or custom expression notation (see also buildExpressionNotation(String, String)templateStream - source template input streamtargetStream - target output stream to write the processing resultCopyright © 2017. All rights reserved.