|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dv.sbu.filehandler.ftl.FtlFileHandler
public class FtlFileHandler
Handler for FREEMARKER template related files.
By default a DefaultSourceParser
instance will be used for source file parsing.
When running the layoutTemplate
(default is 'layout.ftl') on a source file
the parsing result will be provided to the template.
The following list of FTL root map entries is available for the template during that process:
file
(the current source file information)content
(the current parsing result, some text)dataprovider
(configured data providers)configuration
(the complete configuration)handlerinstance
(the controlling instance itself)The source parser might add additional entries. All properties can be overwritten by overlays.
Field Summary | |
---|---|
static java.lang.String |
CONFIGURATION_NAME
The builder configuration FTL root map entry name: 'configuration'. |
static java.lang.String |
CONTENT_NAME
The content-related FTL root map entry name: 'content'. |
static java.lang.String |
DATAPROVIDERS_NAME
The data-provider-related FTL root map entry name: 'dataprovider'. |
static java.lang.String |
FILE_NAME
The FTL root map name for the current source file information: 'file'. |
static java.lang.String |
HANDLER_NAME
The FTL root map name for the current FtlFileHandler instance : 'handlerinstance'. |
Constructor Summary | |
---|---|
FtlFileHandler()
|
Method Summary | |
---|---|
java.util.Map<java.lang.String,IDataProvider> |
getDataProviders()
Returns the registered data provider instances mapped by names. |
java.lang.String |
getEncoding()
Returns the used charset. |
java.lang.String |
getForcedSuffix()
If this property is set, the target files will have this suffix - either by replacing the existing one or by adding it if no suffix is present. |
java.lang.String |
getLayoutTemplate()
Returns the layout template path. |
java.util.Locale |
getLocale()
Returns the used locale. |
java.util.List<Overlay> |
getOverlays()
Returns the list of overlays. |
ISourceParser |
getSourceParser()
Returns the used source parser. |
void |
handleFile(SourceFileInformation fileInfo)
Handles a source file and will proceed related output file(s). |
void |
init(BuilderConfiguration builderConfiguration)
Called once for each processing job. |
void |
setDataProviders(java.util.Map<java.lang.String,IDataProvider> dataProviders)
Sets the data providers. |
void |
setEncoding(java.lang.String encoding)
sets the charset. |
void |
setForcedSuffix(java.lang.String forcedSuffix)
Sets or removes the forced file suffix. |
void |
setLayoutTemplate(java.lang.String layoutTemplate)
Sets the layout template path. |
void |
setLocale(java.util.Locale locale)
Sets the locale to use. |
void |
setOverlays(java.util.List<Overlay> overlays)
Sets the list of overlays. |
void |
setSourceParser(ISourceParser sourceParser)
Sets the source parser to use. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONFIGURATION_NAME
public static final java.lang.String DATAPROVIDERS_NAME
public static final java.lang.String CONTENT_NAME
public static final java.lang.String FILE_NAME
public static final java.lang.String HANDLER_NAME
FtlFileHandler
instance : 'handlerinstance'.
Constructor Detail |
---|
public FtlFileHandler()
Method Detail |
---|
public java.lang.String getLayoutTemplate()
public void setLayoutTemplate(java.lang.String layoutTemplate) throws java.lang.NullPointerException
layoutTemplate
- The path to set. Relative to the resource root.
java.lang.NullPointerException
- The argument is null
.public java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding) throws java.lang.NullPointerException
encoding
- The encoding to set.
java.lang.NullPointerException
- The encoding is null
.public java.util.Locale getLocale()
public void setLocale(java.util.Locale locale) throws java.lang.NullPointerException
locale
- The locale to use.
java.lang.NullPointerException
- The locale is null
.public java.lang.String getForcedSuffix()
null
.public void setForcedSuffix(java.lang.String forcedSuffix)
forcedSuffix
- The suffix to force or null
.public java.util.Map<java.lang.String,IDataProvider> getDataProviders()
public void setDataProviders(java.util.Map<java.lang.String,IDataProvider> dataProviders) throws java.lang.NullPointerException
dataProviders
- The mapping to set. Not expected to contain null
values.
java.lang.NullPointerException
- The mapping is null
.public ISourceParser getSourceParser()
public void setSourceParser(ISourceParser sourceParser) throws java.lang.NullPointerException
sourceParser
- The instance to set.
java.lang.NullPointerException
- The argument is null
.public java.util.List<Overlay> getOverlays()
public void setOverlays(java.util.List<Overlay> overlays)
overlays
- The overlays to use.public void init(BuilderConfiguration builderConfiguration)
init
in interface IFileHandler
builderConfiguration
- The used builder configuration.IFileHandler.init(de.dv.sbu.builder.BuilderConfiguration)
public void handleFile(SourceFileInformation fileInfo) throws java.lang.Exception
handleFile
in interface IFileHandler
fileInfo
- The file information of the related file.
java.lang.Exception
- Any exception to forward.IFileHandler.handleFile(de.dv.sbu.SourceFileInformation)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |