org.apache.velocity.convert
Class WebMacro

java.lang.Object
  |
  +--org.apache.velocity.convert.WebMacro

public class WebMacro
extends java.lang.Object

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.

Version:
$Id: WebMacro.java,v 1.8 2001/03/20 06:39:01 dlr Exp $
Author:
Jason van Zyl

Field Summary
protected  java.lang.String orignalTemplate
          Name of the original webmacro template
protected  java.lang.String pathSeparator
          Path separator property
protected  org.apache.oro.text.perl.Perl5Util perl
          Regular expression tool
protected  java.lang.String[] res
           
protected static java.lang.String VM_EXT
           
protected static java.lang.String WM_EXT
           
 
Constructor Summary
WebMacro()
           
 
Method Summary
 void convert(java.lang.String[] args)
          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
static void main(java.lang.String[] args)
          Main hook for the conversion process.
 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
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

orignalTemplate

protected java.lang.String orignalTemplate
Name of the original webmacro template

perl

protected org.apache.oro.text.perl.Perl5Util perl
Regular expression tool

pathSeparator

protected java.lang.String pathSeparator
Path separator property

VM_EXT

protected static final java.lang.String VM_EXT

WM_EXT

protected static final java.lang.String WM_EXT

res

protected java.lang.String[] res
Constructor Detail

WebMacro

public WebMacro()
Method Detail

convert

public void convert(java.lang.String[] args)
Iterate through the set of find/replace regexes that will convert a given WM template to a VM template

writeTemplate

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.

convertName

private java.lang.String convertName(java.lang.String name)
Simple extension conversion of .wm to .vm

usage

public void usage()
How to use this little puppy :-)

convertTemplate

public java.lang.String convertTemplate(java.lang.String template)
Apply find/replace regexes to our WM template

main

public static void main(java.lang.String[] args)
Main hook for the conversion process.


Copyright © 2001 Apache Software Foundation. All Rights Reserved.