Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enhydra.xml.xmlc.codegen
Class JavaCode  view JavaCode download JavaCode.java

java.lang.Object
  extended byorg.enhydra.xml.xmlc.codegen.JavaCode

public final class JavaCode
extends java.lang.Object

Class used to build the code body of a method.


Field Summary
private  StringIndentWriter fCode
          Accumulated code block.
private  StringIndentWriter fVars
          Optional variable definitions to insert at the beginning of the body.
private static int INIT_BUFFER_SIZE
          Initial size for StringBuffers.
 
Constructor Summary
JavaCode()
          Constructor.
 
Method Summary
 void add(java.lang.String code)
          Add of code to the current line
 void addln()
          Add an EOLN
 void addln(java.lang.String line)
          Add of a line of code.
 void addln(java.lang.String[] lines)
          Add multiple lines of code.
 void addVars(java.lang.String line)
          Add variables that will be inserted at the top of the code body.
 void addVars(java.lang.String[] lines)
          Add variables that will be inserted at the top of the code body.
 void enter()
          Increase indentation level.
 boolean isEmpty()
          Determine if there is any code in the block.
 void leave()
          Decrease indentation level.
 void print(IndentWriter out)
          Print Java code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INIT_BUFFER_SIZE

private static final int INIT_BUFFER_SIZE
Initial size for StringBuffers.

See Also:
Constant Field Values

fVars

private StringIndentWriter fVars
Optional variable definitions to insert at the beginning of the body.


fCode

private StringIndentWriter fCode
Accumulated code block.

Constructor Detail

JavaCode

public JavaCode()
Constructor.

Method Detail

enter

public final void enter()
Increase indentation level.


leave

public final void leave()
Decrease indentation level.


addln

public void addln()
Add an EOLN


add

public void add(java.lang.String code)
Add of code to the current line


addln

public void addln(java.lang.String line)
Add of a line of code.


addln

public void addln(java.lang.String[] lines)
Add multiple lines of code.


addVars

public void addVars(java.lang.String line)
Add variables that will be inserted at the top of the code body.


addVars

public void addVars(java.lang.String[] lines)
Add variables that will be inserted at the top of the code body.


isEmpty

public boolean isEmpty()
Determine if there is any code in the block.


print

public void print(IndentWriter out)
Print Java code.