|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.scape_project.xa.tw.gen.Substitutor
public abstract class Substitutor
GenericSubstitutor
Field Summary | |
---|---|
protected org.apache.velocity.app.VelocityEngine |
ve
|
Constructor Summary | |
---|---|
Substitutor()
Constructor of the generic substitutor which initialises the velocity engine and the context containing the key value pairs. |
Method Summary | |
---|---|
String |
applySubstitution(String content)
Apply substitution |
void |
applySubstitution(String srcFileAbsPath,
String trgtFileAbsPath)
Apply substitution |
org.apache.velocity.VelocityContext |
getContext()
|
void |
processDirectory(File path)
Process directory recursively, only if a file is found, the subsitution is applied. |
protected abstract void |
processFile(File path)
|
void |
putKeyValuePair(String key,
String val)
Add a new key-value pair to the velocity context, note that the dot (.) in the variable is replaced by underscore (_) because this character is used for accessing sub-properties in the Velocity VTL. |
protected String |
replaceVars(String inputText)
Replace variables |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.velocity.app.VelocityEngine ve
Constructor Detail |
---|
public Substitutor()
Method Detail |
---|
public void putKeyValuePair(String key, String val)
key
- Keyval
- Valuepublic void applySubstitution(String srcFileAbsPath, String trgtFileAbsPath) throws GeneratorException
srcFileAbsPath
- Source filetrgtFileAbsPath
- Target file
GeneratorException
public String applySubstitution(String content)
content
- Content string
public void processDirectory(File path) throws IOException, GeneratorException
path
- Path to start with
IOException
GeneratorException
protected String replaceVars(String inputText)
inputText
- Text where substitution will be applied
protected abstract void processFile(File path) throws GeneratorException
GeneratorException
public org.apache.velocity.VelocityContext getContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |