@OpenApiAll public class DefaultImporterTool extends ImportTool
Constructor and Description |
---|
DefaultImporterTool(com.nomagic.magicreport.engine.ITemplateEngine iTemplateEngine)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getCanonicalTemplate(java.lang.String templateFileName)
Creates an absolute path from the template file name.
|
protected java.lang.String |
getEngineType() |
protected java.io.File |
getTemplateFile(java.lang.String templateFileName)
Creates template file from the template file name.
|
java.lang.CharSequence |
importer(java.io.File importedFile,
java.lang.String importedSectionName)
Gets the String content of the imported file.
|
java.lang.CharSequence |
importer(java.lang.Object importedObject,
java.lang.String importedSectionName)
Gets the String content of the import object (may be file or path).
|
java.lang.CharSequence |
importer(java.lang.String importedTemplateFileName,
java.lang.String importedSectionName)
Gets the String content of the imported template path.
|
protected boolean |
isSupport(java.lang.String engineType)
CHeck supported engine type
|
protected void |
setEngineType(java.lang.String engineType) |
protected com.nomagic.magicreport.engine.ITemplateEngine |
setTemplateEngine(java.lang.String fileName)
This will only create a new TemplateEngine in the case that the previous instance was of a different kind.
|
protected void |
setupEngine(com.nomagic.magicreport.engine.ITemplateEngine engine)
Set up engine.
Add properties and context to engine. |
fileImporter, getParentEngine, importer, include, include, include, include, includeSection, includeSection, isParentSupportChild, setParentEngine, setupTool, update
clone, getContext, getProperties, getProperty, getProperty, notifyObservers, setContext, setProperties
public DefaultImporterTool(com.nomagic.magicreport.engine.ITemplateEngine iTemplateEngine)
public java.lang.CharSequence importer(java.lang.Object importedObject, java.lang.String importedSectionName)
importedObject
- the imported object that may be string of template path or file of template.importedSectionName
- if there is a section else this is nullpublic java.lang.CharSequence importer(java.lang.String importedTemplateFileName, java.lang.String importedSectionName)
importer
in class ImportTool
importedTemplateFileName
- the path of childTemplate to be evaluatedimportedSectionName
- if there is a section else this is nullpublic java.lang.CharSequence importer(java.io.File importedFile, java.lang.String importedSectionName)
importedFile
- the childTemplate file to be evaluatedimportedSectionName
- if there is a section else this is nullprotected com.nomagic.magicreport.engine.ITemplateEngine setTemplateEngine(java.lang.String fileName)
fileName
- the templateFile that determines the engineTypeprotected void setupEngine(com.nomagic.magicreport.engine.ITemplateEngine engine)
engine
- current engineprotected java.io.File getTemplateFile(java.lang.String templateFileName) throws java.io.IOException
templateFileName
- the child Template pathjava.io.IOException
protected java.lang.String getCanonicalTemplate(java.lang.String templateFileName) throws java.io.IOException
templateFileName
- the child Template pathjava.io.IOException
- if the canonical file cannot be instantiated.protected boolean isSupport(java.lang.String engineType)
engineType
- engine typeprotected java.lang.String getEngineType()
protected void setEngineType(java.lang.String engineType)