|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.velocity.convert.WebMacro
This class will convert a WebMacro template to a Velocity template. Uses the ORO Regexp package to do the rewrites. Note, it isn't 100% perfect, but will definitely get you about 99.99% of the way to a converted system. Please see the website documentation for more information on how to use this class.
Field Summary | |
protected static java.lang.String[] |
perLineREs
The regexes to use for line by line substition. |
protected static java.lang.String |
VM_EXT
|
protected static java.lang.String |
WM_EXT
|
Constructor Summary | |
WebMacro()
|
Method Summary | |
void |
convert(java.lang.String target)
Iterate through the set of find/replace regexes that will convert a given WM template to a VM template |
private java.lang.String |
convertName(java.lang.String name)
Simple extension conversion of .wm to .vm |
java.lang.String |
convertTemplate(java.lang.String template)
Apply find/replace regexes to our WM template |
private java.lang.String |
extractPath(java.lang.String file)
Gets the path segment of the full path to a file (i.e. |
static void |
main(java.lang.String[] args)
Main hook for the conversion process. |
private java.lang.String |
makeSubstRE(int i)
Makes a Perl 5 regular expression for use by ORO. |
private static void |
usage()
How to use this little puppy :-) |
private boolean |
writeTemplate(java.lang.String file,
java.lang.String basedir,
java.lang.String newBasedir)
Write out the converted template to the given named file and base directory. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected static final java.lang.String VM_EXT
protected static final java.lang.String WM_EXT
protected static java.lang.String[] perLineREs
Constructor Detail |
public WebMacro()
Method Detail |
public void convert(java.lang.String target)
private boolean writeTemplate(java.lang.String file, java.lang.String basedir, java.lang.String newBasedir)
private final java.lang.String extractPath(java.lang.String file)
private java.lang.String convertName(java.lang.String name)
private static final void usage()
public java.lang.String convertTemplate(java.lang.String template)
private final java.lang.String makeSubstRE(int i)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |