|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.panopset.flywheel.Flywheel
public final class Flywheel
Panopset Flywheel.
${@f somefile.txt}
Output to the specified file, until the matching ${@q} is found.
${@p variableName}
Everything following this command is pushed into a String buffer, until a q
command is reached.
${@l someListFile.txt} or ${@l someFile.txt˜,}
Read the given file, and for each line execute the template from this list
command up until its matching q command. If no token is defined as a
variable, then each line will be stored in variable 1. If there is a
token defined after a ~, the line will be split by that token, and stored in
variables named after integers, in order.
${@q}
${@t someTemplateFile.txt}
Continue execution using the supplied template script file.
${variableName}
${@p name}panopset${q}
${@e com.panopset.Strings.capitalize(name)}
The above script will output:
Panopset
| Nested Class Summary | |
|---|---|
static class |
Flywheel.Builder
Flywheel builder. |
| Method Summary | |
|---|---|
void |
copyPackageResource(String resourcePath,
String targetPath)
Copy package resource. |
String |
exec()
Execute this script. |
String |
get(String key)
Get map value. |
Map<String,String> |
getAllValues()
|
String |
getBaseDirectoryPath()
Get the directory in which the script top template file resides. |
String |
getBaseRelativePath(String simpleFileName)
Append simple file name to getBaseDirectoryPath. |
Control |
getControl()
Get control. |
Map<String,Object> |
getRegisteredObjects()
|
protected List<String[]> |
getReplacements()
|
Command |
getResolvingCommand()
Used for debugging. |
File |
getTargetDirectory()
|
Template |
getTemplate()
|
StringWriter |
getWriter()
This method should only be used when a writer was specified in the builder. |
boolean |
isOutputEnabled()
|
boolean |
isReplacementsSuppressed()
Is replacements repressed. |
boolean |
isStopped()
Used by debuggers. |
boolean |
isTargetDirectoryValid()
Is target directory valid. |
String |
loadProperties(String relativePath)
Load properties. |
static void |
main(String... args)
|
void |
mergeMap(Map<String,String> map)
Merge a map into the script map. |
void |
put(String key,
String value)
Put map value, that will be available to future v commands. |
void |
setOutputEnabled(boolean value)
Set whether or not Flywheel will write output to text files. |
void |
setRegisteredObjects(Map<String,Object> registeredObjects)
|
void |
setWriter(StringWriter writer)
|
void |
stop(String message)
Called if something unexpected happens. |
void |
suppressReplacements(String value)
Suppress replacements. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public File getTargetDirectory()
public Command getResolvingCommand()
public Map<String,String> getAllValues()
public static void main(String... args)
args -
[0] = script file name, args[1] = target directory name.
or
[0] = properties file name where these properties are required:
com.panopset.flywheel.script=<your script file name>
com.panopset.flywheel.target=<your target file name>
public void copyPackageResource(String resourcePath,
String targetPath)
throws IOException
resourcePath - Java source path resource.targetPath - Target path, relative to Flywheel target directory.
IOException - IO Exception.public boolean isTargetDirectoryValid()
public StringWriter getWriter()
public void setWriter(StringWriter writer)
writer - Writer.
public void put(String key,
String value)
key - Variable name.value - Variable value.public String loadProperties(String relativePath)
relativePath - Path is relative to the parent of the main Flywheel script
file.
public void suppressReplacements(String value)
${@p foo}bar{@q}
${@e script.suppressReplacements(true)}
A: ${@v foo}
${@e script.suppressReplacements(false)}
B: ${@v foo}
Output
A: B: bar
value - If true, all v commands will be not output anything.public String get(String key)
get in interface MapProviderkey - Variable name.
public void mergeMap(Map<String,String> map)
map - Map to merge into the script map.public String exec()
public Template getTemplate()
public void stop(String message)
message - Log this messagepublic boolean isStopped()
public String getBaseDirectoryPath()
protected List<String[]> getReplacements()
public String getBaseRelativePath(String simpleFileName)
simpleFileName - Simple file name (no path).
public boolean isReplacementsSuppressed()
public void setRegisteredObjects(Map<String,Object> registeredObjects)
registeredObjects - Registered objects.public Map<String,Object> getRegisteredObjects()
public Control getControl()
public boolean isOutputEnabled()
public void setOutputEnabled(boolean value)
value - Value to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||