org.wurbelizer
Class AbstractWurblet

java.lang.Object
  extended by org.wurbelizer.AbstractWurblet
All Implemented Interfaces:
Wurblet

public abstract class AbstractWurblet
extends Object
implements Wurblet

Provides basic functionality of a wurblet. A wurblet is a code generator that is invoked from within a container, the so-called wurbler. Wurblets generate code to one or more output streams. The default output stream and the fixed source list is provided by the wurbler.


Field Summary
protected  Wurbler container
           
protected  PrintStream out
           
protected  String[] source
           
 
Constructor Summary
AbstractWurblet()
           
 
Method Summary
 Wurbler getContainer()
          Gets the current container.
 void run()
          Runs the wurblet.
 void setContainer(Wurbler container)
          Sets the container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

container

protected Wurbler container

out

protected PrintStream out

source

protected String[] source
Constructor Detail

AbstractWurblet

public AbstractWurblet()
Method Detail

run

public void run()
         throws Exception
Runs the wurblet. This method needs to be overwritten in order to do something useful. Overriding methods should invoke super.run().

Specified by:
run in interface Wurblet
Throws:
Exception - if running the wurblet failed for whatever reason

setContainer

public void setContainer(Wurbler container)
Sets the container. The wurbler attaches the wurblet before invoking the run-method of the wurblet.

Specified by:
setContainer in interface Wurblet
Parameters:
container - the wurbler the wurblet is attached to, null to detach

getContainer

public Wurbler getContainer()
Gets the current container. Wurblets use this method to access the container's utility methods.

Specified by:
getContainer in interface Wurblet
Returns:
the container, null if detached


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