org.wurbelizer
Class DefaultWurbler

java.lang.Object
  extended by org.wurbelizer.AbstractWurbler
      extended by org.wurbelizer.DefaultWurbler
All Implemented Interfaces:
Wurbler

public class DefaultWurbler
extends AbstractWurbler

The default implementation of a wurblet container. Running standalone from the command line.
Because ANT does not provide a foreach "out of the box", the main-method supports file lists as follows:

java org.wurbelizer.DefaultWurbler --glob="blahdir/.*\.map$"  .... @ ....
The @ will be replaced by the filename and the wurblet is invoked for each such file. Note that it's not a real globbing, but uses regex. This is not the most generic solution, but it does the job for wurblets like CreateTableSql.


Field Summary
 
Fields inherited from interface org.wurbelizer.Wurbler
FILE_SOURCE_EXTENSION, PROPSPACE_ENV, PROPSPACE_EXTRA, PROPSPACE_WURBLET
 
Constructor Summary
DefaultWurbler(String[] args)
          Creates an instance of a command line wurbler.
 
Method Summary
 File getInfoFile(String name)
          Gets an information file.
 int getInvocationCount()
          Gets the loop count.
 void logMessage(String msg)
          Log some message.
static void main(String[] args)
          Invokes the wurbler from the command line.
 
Methods inherited from class org.wurbelizer.AbstractWurbler
getArgs, getPrintStream, getProperties, getProperty, getSource, getWurblet, isFixedArgs, loadWurblet, run, setArgs, setFixedArgs, setPrintStream, setSource, setWurblet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWurbler

public DefaultWurbler(String[] args)
               throws FileNotFoundException,
                      ClassNotFoundException,
                      InstantiationException,
                      IllegalAccessException,
                      IOException
Creates an instance of a command line wurbler.

Parameters:
args - the command line arguments
Throws:
FileNotFoundException
ClassNotFoundException
InstantiationException
IllegalAccessException
IOException
Method Detail

getInvocationCount

public int getInvocationCount()
Gets the loop count.

Returns:
the invocation count, starting at 1

getInfoFile

public File getInfoFile(String name)
Gets an information file. Some wurblets need extra information which is provided in files in the so-called infodir (example in ant: infodir=${apt})

Parameters:
name - is the filename relative to the infodir.
Returns:
the file

logMessage

public void logMessage(String msg)
Log some message.

Parameters:
msg - the message

main

public static void main(String[] args)
Invokes the wurbler from the command line.

Parameters:
args - the command line arguments


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de