|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jostraca.BasicTemplate
Basic implementation of template functionality.
The text of the the file generated by the template can be accessed using
getResult() but only if the template script is Java and the
template is executed internally in the Jostraca process. Also, the
template can chose to return a custom data structure with getResult.
| Field Summary | |
protected TemplatePath[] |
iAlsoGenerate
|
protected BuildResource |
iBuildResource
|
protected boolean |
iCodeWriterChanged
|
protected FileRef |
iCodeWriterExecRef
|
protected FileRef |
iCodeWriterRef
|
protected java.lang.String |
iCodeWriterSource
|
protected RegExp |
iConfRegExp
|
protected java.lang.Object |
iContext
|
protected java.lang.String |
iForcedIncludeBase
|
protected boolean |
iForceIncludeBase
|
protected RegExp |
iIncludeBaseRegExp
|
protected RegExp |
iIncludeBlockRegExp
|
protected RegExp |
iIncludeRegExp
|
protected long |
iLastMod
|
protected java.io.File |
iMetaFile
|
static java.lang.String |
INCLUDE_MOD_if_exists
|
static java.lang.String |
INCLUDE_MOD_output_relative
|
static java.lang.String |
INCLUDE_MOD_template_relative
|
protected OrderedPropertySetManager |
iOrderedPSM
|
protected java.lang.String |
iPath
|
protected java.lang.Object |
iResult
|
protected java.util.List |
iSavedFiles
|
protected SectionSet |
iSectionSet
|
protected java.lang.String |
iSource
|
protected TemplatePath |
iTemplatePath
|
protected TemplateScript |
iTemplateScript
|
| Fields inherited from interface org.jostraca.Template |
CN, MN_setCodeWriter |
| Constructor Summary | |
BasicTemplate()
Create with empty template path |
|
BasicTemplate(java.lang.String pName)
Create with name of template. |
|
BasicTemplate(TemplatePath pTemplatePath)
Create a template using a TemplatePath object. |
|
| Method Summary | |
void |
forceIncludeBase(java.lang.String pIncludeBase)
Force template to use a specified include base. |
TemplatePath[] |
getAlsoGenerate()
Get list of templates to which should also be generated. |
BuildResource |
getBuildResource()
Get the set of build resources for this template |
boolean |
getCodeWriterChanged()
|
java.io.File |
getCodeWriterExecutablePath()
|
java.lang.String |
getCodeWriterLang()
Get code writer lang if defined, else return empty String. |
java.io.File |
getCodeWriterPath()
|
java.lang.String |
getCodeWriterSource()
|
java.lang.Object |
getContext()
Get context object for internal code writers. |
long |
getLastMod()
Get last modified date of template source file |
PropertySet |
getMergedPropertySet()
|
java.io.File |
getMetaFile()
|
PropertySet |
getPropertySet(java.lang.String pConfName)
Get template PropertySet. |
java.lang.Object |
getResult()
Get result object from CodeWriter (may be null). |
java.util.List |
getSavedFiles()
|
SectionSet |
getSectionSet()
Get the data cotnainer for the insert section text of this template. |
java.lang.String |
getSource()
Get template source. |
TemplatePath |
getTemplatePath()
Get the TemplatePath to this template |
boolean |
hasMetaFile()
|
void |
load(TemplatePath pTemplatePath)
Load template and parse for PropertySet. |
void |
modifyForOldVersion()
Modify template properties to handle older template versions. |
void |
setCodeWriterChanged(boolean pChanged)
|
void |
setCodeWriterExecutablePath(java.io.File pCodeWriterExecutablePath)
|
void |
setCodeWriterPath(java.io.File pCodeWriter)
Set the code writer when known |
void |
setCodeWriterSource(java.lang.String pCodeWriterSource)
|
void |
setContext(java.lang.Object pContext)
Set context object for internal code writers. |
void |
setMetaFile(java.io.File pMetaFile)
|
void |
setPropertySet(java.lang.String pConfName,
PropertySet pPropertySet)
|
void |
setResult(java.lang.Object pResult)
Set result object from CodeWriter (optional). |
void |
setSavedFiles(java.util.List pSavedFiles)
|
void |
setSectionSet(SectionSet pSectionSet)
Set the data container for the insert section text of this template. |
void |
setSource(java.lang.String pSource)
Set template source and parse for PropertySet. |
java.lang.String |
toString()
Provide a user-friendly description of the template. |
java.lang.String |
traceProperty(java.lang.String pName)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String INCLUDE_MOD_if_exists
public static final java.lang.String INCLUDE_MOD_template_relative
public static final java.lang.String INCLUDE_MOD_output_relative
protected TemplatePath iTemplatePath
protected TemplateScript iTemplateScript
protected java.lang.String iPath
protected java.lang.String iSource
protected boolean iForceIncludeBase
protected java.lang.String iForcedIncludeBase
protected RegExp iConfRegExp
protected RegExp iIncludeRegExp
protected RegExp iIncludeBaseRegExp
protected RegExp iIncludeBlockRegExp
protected TemplatePath[] iAlsoGenerate
protected SectionSet iSectionSet
protected long iLastMod
protected BuildResource iBuildResource
protected java.lang.Object iContext
protected java.lang.Object iResult
protected java.lang.String iCodeWriterSource
protected boolean iCodeWriterChanged
protected FileRef iCodeWriterRef
protected FileRef iCodeWriterExecRef
protected OrderedPropertySetManager iOrderedPSM
protected java.util.List iSavedFiles
protected java.io.File iMetaFile
| Constructor Detail |
public BasicTemplate()
public BasicTemplate(java.lang.String pName)
public BasicTemplate(TemplatePath pTemplatePath)
TemplatePath object. This is the standard method for
creating template objects, as the TemplatePath object does path and library resolution.
| Method Detail |
public void setSectionSet(SectionSet pSectionSet)
Template
setSectionSet in interface TemplatepSectionSet - container for section textpublic SectionSet getSectionSet()
Template
getSectionSet in interface Templatepublic void setContext(java.lang.Object pContext)
Template
setContext in interface TemplatepContext - context objectpublic java.lang.Object getContext()
Template
getContext in interface Templatepublic void setResult(java.lang.Object pResult)
Template
setResult in interface Templatepublic java.lang.Object getResult()
Template
getResult in interface Template
public void load(TemplatePath pTemplatePath)
throws TemplateException
Template
load in interface TemplatepTemplatePath - Path to load template from.
TemplateExceptionpublic TemplatePath getTemplatePath()
Template
getTemplatePath in interface Template
public void setSource(java.lang.String pSource)
throws TemplateException
Template
setSource in interface TemplateTemplateExceptionpublic java.lang.String getSource()
Template
getSource in interface Templatepublic PropertySet getPropertySet(java.lang.String pConfName)
Template
getPropertySet in interface Template
public void setPropertySet(java.lang.String pConfName,
PropertySet pPropertySet)
setPropertySet in interface Templatepublic PropertySet getMergedPropertySet()
getMergedPropertySet in interface Templatepublic java.lang.String traceProperty(java.lang.String pName)
traceProperty in interface Templatepublic TemplatePath[] getAlsoGenerate()
Template
getAlsoGenerate in interface Templatepublic java.lang.String getCodeWriterLang()
Template
getCodeWriterLang in interface Templatepublic long getLastMod()
Template
getLastMod in interface Templatepublic BuildResource getBuildResource()
Template
getBuildResource in interface Templatepublic void setCodeWriterPath(java.io.File pCodeWriter)
Template
setCodeWriterPath in interface Templatepublic java.io.File getCodeWriterPath()
getCodeWriterPath in interface Templatepublic void setCodeWriterSource(java.lang.String pCodeWriterSource)
setCodeWriterSource in interface Templatepublic java.lang.String getCodeWriterSource()
getCodeWriterSource in interface Templatepublic void setCodeWriterChanged(boolean pChanged)
setCodeWriterChanged in interface Templatepublic boolean getCodeWriterChanged()
getCodeWriterChanged in interface Templatepublic void setCodeWriterExecutablePath(java.io.File pCodeWriterExecutablePath)
setCodeWriterExecutablePath in interface Templatepublic java.io.File getCodeWriterExecutablePath()
getCodeWriterExecutablePath in interface Templatepublic void setSavedFiles(java.util.List pSavedFiles)
setSavedFiles in interface Templatepublic java.util.List getSavedFiles()
getSavedFiles in interface Templatepublic void setMetaFile(java.io.File pMetaFile)
setMetaFile in interface Templatepublic java.io.File getMetaFile()
getMetaFile in interface Templatepublic boolean hasMetaFile()
hasMetaFile in interface Templatepublic java.lang.String toString()
Template
toString in interface Templatepublic void forceIncludeBase(java.lang.String pIncludeBase)
pIncludeBase - include base folder pathpublic void modifyForOldVersion()
modifyForOldVersion in interface Template
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||