|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfmpp.localdatabuilders.BshLocalDataBuilder
public class BshLocalDataBuilder
Deduces the file name of a BeanShell scrip file from the source file name, and executes that script to create local data.
The script must return a java.util.Map, which stores the
variables that will be added to the local data.
The following variables are accessible for the scripts:
engine: the Engine instance.
templateEnvironment: the TemplateEnvironment
instance.
| Constructor Summary | |
|---|---|
BshLocalDataBuilder()
Creates new instance. |
|
| Method Summary | |
|---|---|
java.util.Map |
build(Engine eng,
TemplateEnvironment env)
Returns the variables that could be added to the local data. |
static BshLocalDataBuilder |
createInstanceForSetting(java.lang.String fName,
java.util.List params)
|
java.lang.String |
getEncoding()
|
java.lang.String |
getEnding()
|
boolean |
getIgnoreMissing()
Set if it will be ignored no script file found for the source file, rather than throwing an exception. |
boolean |
getRemoveExtension()
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding of the script files. |
void |
setEnding(java.lang.String ending)
Sets the string appended at the end of the source file name. |
void |
setIgnoreMissing(boolean ignoreMissing)
|
void |
setRemoveExtension(boolean removeExtension)
Sets if the extension from the source file name should be removed before appending the ending. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BshLocalDataBuilder()
| Method Detail |
|---|
public static BshLocalDataBuilder createInstanceForSetting(java.lang.String fName,
java.util.List params)
throws SettingException
SettingException
public java.util.Map build(Engine eng,
TemplateEnvironment env)
throws java.io.FileNotFoundException,
DataModelBuildingException
LocalDataBuilder
build in interface LocalDataBuildernull. The returned map will not be modified
(although technically, badly behaved 3rd party code can modify
the values soted in the map...).
java.io.FileNotFoundException
DataModelBuildingExceptionpublic java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding)
null then
the value of the sourceEncoding setting will be used.
public java.lang.String getEnding()
public void setEnding(java.lang.String ending)
".bsh".
public boolean getIgnoreMissing()
false.
public void setIgnoreMissing(boolean ignoreMissing)
public boolean getRemoveExtension()
public void setRemoveExtension(boolean removeExtension)
ending. The extension is the part after the
last dot of the file name. The dot itself is also removed.
Defaults to false.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||