@OpenApiAll public class PPTXEngine extends DefaultTemplateEngine implements StyledDocument
velocityContext
context, isAborted, preProcessFile, processFile, properties
Constructor and Description |
---|
PPTXEngine()
A class constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
addColor(java.awt.Color color)
Add color for html to PPTX.
|
int |
addFont(java.awt.Font font)
Add font for html to PPTX.
|
void |
addImage(java.lang.String format)
Add image format to list.
|
int |
addList(List list)
Add list for html to PPTX.
|
int |
addObject(java.lang.Object object)
Appends object content into the document.
|
void |
addRowSpanID(java.lang.String id,
int value)
Add rowspan id and its value to map
|
int |
addStyle(javax.swing.text.Style style)
Add style for html to PPTX.
|
protected ParseErrorException |
createParseErrorWrapper(ParseErrorException parseError,
java.io.Reader source)
Create a ParseErrorException from the message.
|
Template |
createTemplate()
Creates a new
Template object for generating report by this engine. |
Template |
createTemplate(java.io.File input,
java.io.File output)
Creates a new
Template object. |
Template |
createTemplate(java.io.File input,
java.io.File output,
boolean ignoreLocation)
Creates a new
Template object. |
void |
evaluate(Template template)
Merge a template with current context and rendered stream into the writer.
|
java.util.Set<java.lang.String> |
getEntrySet()
Return PPTX entry set.
|
Template |
getTemplate()
Return template.
|
protected void |
handleForColumn(Template template,
java.lang.StringBuffer inProcessBuffer)
Handle the #forcol directive.
|
protected void |
handleForPage(Template template,
java.lang.StringBuffer inProcessBuffer)
Handle the #forpage directive.
|
protected void |
handleForRow(Template template,
java.lang.StringBuffer inProcessBuffer)
Handle the #forrow directive.
|
protected void |
handleIncludeSection(Template template,
java.lang.StringBuffer inProcessBuffer)
Handle the #includeSection directive.
|
protected void |
handleMergeColumns(Template template,
java.lang.StringBuffer inProcessBuffer)
Handle $tableprop.mergeColumns directive
|
protected void |
handleMergeRows(Template template,
java.lang.StringBuffer inProcessBuffer)
Handle $tableprop.mergeRows directive
|
protected void |
handleSectionBegin(Template template,
java.lang.StringBuffer inProcessBuffer)
Handle the #sectionBegin directive.
|
protected int |
lineCount(java.lang.String content)
Count number of line from given content string.
|
protected void |
postProcess(Template template)
Perform a post-processing after the template has been evaluated.
|
protected TemplateException |
processException(Template template,
ParseErrorException e)
Call this method to process a
ParseErrorException . |
protected TemplateException |
processVelocityException(Template template,
org.apache.velocity.exception.ParseErrorException e)
Call this method to process an Velocity exception and return in new format.
|
protected void |
translate(Template template,
java.lang.StringBuffer inProcessBuffer)
Process the template in
inProcessBuffer into valid format. |
abort, checkFileNotFoundException, createComment, destroy, getClassLoader, getFormatter, handleImport, isNoSpaceException, preProcess, process, process, processVelocityException, setClassLoader, setFormatter, setLatestLocation, setLocation, setProperty, trimTrailSpace
addContext, addInvalidReferenceHandler, addObserver, addReferenceInsertionHandler, evaluate, getConcurrentToolException, getContext, getCurrentRuntimeInstance, getInvalidReferenceHandler, getProcessSize, getProperties, getProperty, getReferenceInsertionHandler, isMemoryMode, notifyObservers, observers, setConcurrentToolException, setContext, setCurrentRuntimeInstance
public Template createTemplate()
Template
object for generating report by this engine.createTemplate
in interface ITemplateEngine
createTemplate
in class DefaultTemplateEngine
Template
DefaultTemplateEngine.createTemplate(File, File)
public Template createTemplate(java.io.File input, java.io.File output) throws java.io.IOException
Template
object.createTemplate
in interface ITemplateEngine
createTemplate
in class DefaultTemplateEngine
input
- template file.output
- output file.Template
java.io.FileNotFoundException
- if the file does not exist, is a directory rather than a regular file,
or for some other reason cannot be opened.java.io.IOException
- If an I/O error occurspublic Template createTemplate(java.io.File input, java.io.File output, boolean ignoreLocation) throws java.io.IOException
Template
object.createTemplate
in class DefaultTemplateEngine
input
- template file.output
- output file.ignoreLocation
- true to ignore location property for child documentTemplate
java.io.FileNotFoundException
- if the file does not exist, is a directory rather than a regular file,
or for some other reason cannot be opened.java.io.IOException
- If an I/O error occurspublic Template getTemplate()
public java.util.Set<java.lang.String> getEntrySet()
public void addImage(java.lang.String format)
format
- format of imagepublic void addRowSpanID(java.lang.String id, int value)
id
- rowspan idvalue
- number of rows to be mergedpublic void evaluate(Template template) throws TemplateException
evaluate
in interface ITemplateEngine
evaluate
in class AbstractTemplateEngine
template
- Template being evaluatedParseErrorException
- if a syntax or other error which prevents it from being
parsed.InitializationEngineException
- error while initializing engineTemplateException
- other error while processing the templateITemplateEngine.evaluate(Template)
protected void translate(Template template, java.lang.StringBuffer inProcessBuffer) throws ParseErrorException, java.io.IOException
inProcessBuffer
into valid format.translate
in class DefaultTemplateEngine
template
- Template source.inProcessBuffer
- in process buffer.ParseErrorException
- when error while translation, or syntax not recognized.java.io.IOException
- if IO Error occurs while reading template.protected ParseErrorException createParseErrorWrapper(ParseErrorException parseError, java.io.Reader source)
parseError
- root causesource
- source templateprotected TemplateException processException(Template template, ParseErrorException e)
ParseErrorException
. This method call internally by
postProcess(Template)
. If code was performed by Velocity (DefaultTemplateEngine.process(Template)
), uses method
processVelocityException(Template, org.apache.velocity.exception.ParseErrorException)
. By default
this method try to calculate line number from ParseErrorException.getSource()
.processException
in class DefaultTemplateEngine
template
- Templatee
- MagicReport parse error exceptionprotected TemplateException processVelocityException(Template template, org.apache.velocity.exception.ParseErrorException e)
DefaultTemplateEngine.processVelocityException(Template, org.apache.velocity.exception.ParseErrorException)
to return exception with valid ODF line count.processVelocityException
in class DefaultTemplateEngine
template
- Templatee
- Velocity exceptionprotected int lineCount(java.lang.String content)
lineCount
in class DefaultTemplateEngine
content
- the input stringprotected void handleForColumn(Template template, java.lang.StringBuffer inProcessBuffer) throws ParseErrorException
template
- Template source.inProcessBuffer
- in process buffer.ParseErrorException
- when error while translation, or syntax not recognized.protected void handleMergeColumns(Template template, java.lang.StringBuffer inProcessBuffer) throws ParseErrorException
template
- Template source.inProcessBuffer
- in process buffer.ParseErrorException
- when error while translation, or syntax not recognized.protected void handleMergeRows(Template template, java.lang.StringBuffer inProcessBuffer) throws ParseErrorException
template
- Template source.inProcessBuffer
- in process buffer.ParseErrorException
- when error while translation, or syntax not recognized.protected void handleForRow(Template template, java.lang.StringBuffer inProcessBuffer) throws ParseErrorException
handleForRow
in class DefaultTemplateEngine
template
- Template source.inProcessBuffer
- in process buffer.ParseErrorException
- when error while translation, or syntax not recognized.protected void handleForPage(Template template, java.lang.StringBuffer inProcessBuffer) throws ParseErrorException
handleForPage
in class DefaultTemplateEngine
template
- Template source.inProcessBuffer
- in process buffer.ParseErrorException
- when error while translation, or syntax not recognized.protected void handleSectionBegin(Template template, java.lang.StringBuffer inProcessBuffer) throws ParseErrorException
handleSectionBegin
in class DefaultTemplateEngine
template
- Template source.inProcessBuffer
- in process buffer.ParseErrorException
- when error while translation, or syntax not recognized.protected void handleIncludeSection(Template template, java.lang.StringBuffer inProcessBuffer) throws ParseErrorException
handleIncludeSection
in class DefaultTemplateEngine
template
- Template source.inProcessBuffer
- in process buffer.ParseErrorException
- when error while translation, or syntax not recognized.protected void postProcess(Template template) throws TemplateException
postProcess
in class DefaultTemplateEngine
template
- template after evaluated.ParseErrorException
- if a syntax or other error which prevents it from being
parsed.InitializationEngineException
- error while initializing engineTemplateException
- other error while processing the templateDefaultTemplateEngine.postProcess(com.nomagic.magicreport.Template)
public int addFont(java.awt.Font font)
addFont
in interface StyledDocument
font
- fontpublic int addList(List list)
addList
in interface StyledDocument
list
- listpublic int addStyle(javax.swing.text.Style style)
addStyle
in interface StyledDocument
style
- stylepublic int addColor(java.awt.Color color)
addColor
in interface StyledDocument
color
- colorpublic int addObject(java.lang.Object object)
addObject
in interface StyledDocument
object
- adding objectCopyright © 2010 - No Magic Asia