The Wurblet
The wurblet should create the Java code for the declaration of attributes and their getter- and setter methods, like this:
private String name; // the object's name
private long id; // the object's id
...
/**
* Sets attribute name.
*
* @param name the object's name
*/
public String setName(String name) {
this.name = name;
}
...
The model is simply a list of attributes, each described by a name, a Java type
and some optional comment.In real life, models are much more extensive, but this is for demonstration only.
A wurblet can access models in different ways. This can be a simple text file, an sql database or some xml documents. Because the generator language is Java, there are no restrictions beyond the restrictions of Java itself.
For the quickstart example, we've chosen a so-called here-document. With here-documents it is very easy to create model information from within comment blocks. The motivation is the same as with javadoc: everything is kept in the source. If you change the model, the code changes as well.
The model in src/Quickstart.java looks like this:

Writing a wurblet usually involves two steps:
- write code to parse the model
- write the generator


That's easliy explained:
- Line 1: this is a so-called directive. Directives are instructions to the wurbiler and are of the form @{....}@. This one tells the wurbiler that the wurblet extends AbstractAttributes.java.
- Line 2 and 6: changing the code level between wurblet code and generated output is achieved with square brackets. Wurblets always start at the output level, i.e. the generated code. Line 3 switches to wurblet level, i.e. the wurblet's execution level. Line 7 is on output level again and generates the code for the attribute declarations.
- Line 7: with round braces you can access values of the wurblet level. The value from the wurblet level will be inserted into the generated output stream.

The binding of a wurblet is called a wurblet anchor, which is defined as:
@wurblet <tag> <wurbletname> <arg1> <arg2> .... <argN>
where:
- tag: is a unique name (unique within the source)
- wurbletname: is the name of the wurblet
- arg1...: are the wurblet arguments
