org.apache.hivemind.service
Class BodyBuilder

java.lang.Object
  extended by org.apache.hivemind.service.BodyBuilder

public class BodyBuilder
extends java.lang.Object

Utility class for assembling the body used with Javassist as a method or catch block.

Author:
Howard Lewis Ship

Constructor Summary
BodyBuilder()
           
 
Method Summary
 void add(java.lang.String text)
          Adds text to the current line, without terminating the line.
 void add(java.lang.String pattern, java.lang.Object arg0)
          Convience for add(String, Object[])
 void add(java.lang.String pattern, java.lang.Object[] arguments)
          Adds text to the current line, without terminating the line.
 void add(java.lang.String pattern, java.lang.Object arg0, java.lang.Object arg1)
          Convience for add(String, Object[])
 void add(java.lang.String pattern, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)
          Convience for add(String, Object[])
 void addln(java.lang.String text)
          Adds the text to the current line, and terminates the line.
 void addln(java.lang.String pattern, java.lang.Object arg0)
          Convience for addln(String, Object[])
 void addln(java.lang.String pattern, java.lang.Object[] arguments)
          Adds text to the current line then terminates the line.
 void addln(java.lang.String pattern, java.lang.Object arg0, java.lang.Object arg1)
          Convience for addln(String, Object[]).
 void addln(java.lang.String pattern, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)
          Convience for addln(String, Object[]).
 void addQuoted(java.lang.String text)
          Adds the text to the current line, surrounded by double quotes.
 void begin()
          Begins a new block.
 void clear()
          Clears the builder, returning it to its initial, empty state.
 void end()
          Ends the current block.
 java.lang.String toString()
          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

BodyBuilder

public BodyBuilder()
Method Detail

clear

public void clear()
Clears the builder, returning it to its initial, empty state.


add

public void add(java.lang.String text)
Adds text to the current line, without terminating the line.


add

public void add(java.lang.String pattern,
                java.lang.Object[] arguments)
Adds text to the current line, without terminating the line.

Parameters:
pattern - a string pattern, used with MessageFormat.format(java.lang.String, java.lang.Object[])
arguments - arguments used witht the format string

add

public void add(java.lang.String pattern,
                java.lang.Object arg0)
Convience for add(String, Object[])


add

public void add(java.lang.String pattern,
                java.lang.Object arg0,
                java.lang.Object arg1)
Convience for add(String, Object[])


add

public void add(java.lang.String pattern,
                java.lang.Object arg0,
                java.lang.Object arg1,
                java.lang.Object arg2)
Convience for add(String, Object[])


addln

public void addln(java.lang.String pattern,
                  java.lang.Object[] arguments)
Adds text to the current line then terminates the line.

Parameters:
pattern - a string pattern, used with MessageFormat.format(java.lang.String, java.lang.Object[])
arguments - arguments used witht the format string

addln

public void addln(java.lang.String pattern,
                  java.lang.Object arg0)
Convience for addln(String, Object[])


addln

public void addln(java.lang.String pattern,
                  java.lang.Object arg0,
                  java.lang.Object arg1)
Convience for addln(String, Object[]).


addln

public void addln(java.lang.String pattern,
                  java.lang.Object arg0,
                  java.lang.Object arg1,
                  java.lang.Object arg2)
Convience for addln(String, Object[]).


addQuoted

public void addQuoted(java.lang.String text)
Adds the text to the current line, surrounded by double quotes. Does not escape quotes in the text.


addln

public void addln(java.lang.String text)
Adds the text to the current line, and terminates the line.


begin

public void begin()
Begins a new block. Emits a "{", properly indented, on a new line.


end

public void end()
Ends the current block. Emits a "}", propertly indented, on a new line.


toString

public java.lang.String toString()
Returns the current contents of the buffer.

Overrides:
toString in class java.lang.Object


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.