|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry5.ioc.util.BodyBuilder
public final class BodyBuilder
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. Most of the methods return the BodyBuilder, to form a fluent interface.
Constructor Summary | |
---|---|
BodyBuilder()
Deprecated. |
Method Summary | |
---|---|
BodyBuilder |
add(String format,
Object... args)
Deprecated. Adds text to the current line, without ending the line. |
BodyBuilder |
addln(String format,
Object... args)
Deprecated. Adds text to the current line and ends the line. |
BodyBuilder |
begin()
Deprecated. Begins a new block. |
BodyBuilder |
clear()
Deprecated. Clears the builder, returning it to its initial, empty state. |
BodyBuilder |
end()
Deprecated. Ends the current block. |
String |
toString()
Deprecated. Returns the current contents of the buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BodyBuilder()
Method Detail |
---|
public BodyBuilder clear()
public BodyBuilder add(String format, Object... args)
format
- string format, as per Formatter
args
- arguments referenced by format specifierspublic BodyBuilder addln(String format, Object... args)
format
- string format, as per Formatter
args
- arguments referenced by format specifierspublic BodyBuilder begin()
public BodyBuilder end()
public String toString()
ClassFab.addConstructor(Class[], Class[], String)
or
ClassFab.addMethod(int, MethodSignature, String)
.
A BodyBuilder can be used again after invoking toString(), typically by invoking clear()
.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |