| java.lang.Object org.apache.tapestry.ioc.util.BodyBuilder
BodyBuilder | final public class BodyBuilder (Code) | | Utility class for assembling the body used with Javassist when defining a method or
constructor. Basically, assists with formatting and with indentation. This makes the code that
assembles a method body much simpler ... and it makes the result neater, which will be easier to
debug (debugging dynamically generated code is hard enough that it should be easy to read the
input code before worrying about why it doesn't compile or execute properly).
This class is not threadsafe.
|
Method Summary | |
public void | add(String format, Object... args) Adds text to the current line, without ending the line. | public void | addln(String format, Object... args) Adds text to the current line and ends the line. | public void | begin() Begins a new block. | public void | clear() Clears the builder, returning it to its initial, empty state. | public void | end() Ends the current block. | public String | toString() Returns the current contents of the buffer. |
add | public void add(String format, Object... args)(Code) | | Adds text to the current line, without ending the line.
Parameters: a - string format, as per java.util.Formatter Parameters: args - arguments referenced by format specifiers |
addln | public void addln(String format, Object... args)(Code) | | Adds text to the current line and ends the line.
Parameters: a - string format, as per java.util.Formatter Parameters: args - arguments referenced by format specifiers |
begin | public void begin()(Code) | | Begins a new block. Emits a "{", properly indented, on a new line.
|
clear | public void clear()(Code) | | Clears the builder, returning it to its initial, empty state.
|
end | public void end()(Code) | | Ends the current block. Emits a "}", propertly indented, on a new line.
|
|
|