public class JSourceCode
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private short |
currentIndent
The current indent size
|
private short |
indentSize
The indent size
|
private java.util.List<JCodeStatement> |
source
A list of JCodeStatements
|
Constructor and Description |
---|
JSourceCode()
Creates an empty JSourceCode
|
JSourceCode(java.lang.String sourceCode)
Creates a JSourceCode and adds the given String
to it's contents
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String statement)
Adds the given statement to this JSourceCode.
|
void |
add(java.lang.String statement,
short indentSize)
Deprecated.
this method is not here any mode in castor codegen 1.3rc1
|
private void |
addCodeStatement(JCodeStatement jcs)
Adds the given JCodeStatement to this JSourceCode
|
void |
addIndented(java.lang.String statement)
Adds the given statement to this JSourceCode.
|
void |
append(java.lang.String segment)
Appends the given String to the last line in this
JSourceCode
|
void |
clear()
Clears all the code statements from this JSourceCode
|
void |
copyInto(JSourceCode jsc)
Copies the contents of this JSourceCode into the given JSourceCode
|
void |
indent()
Increases the current indent level by 1
|
boolean |
isEmpty()
Returns true if this JSourceCode is empty (ie.
|
void |
print(JSourceWriter jsw)
Prints this JSourceCode to the given JSourceWriter
|
java.lang.String |
toString()
Returns the String representation of this JSourceCode
|
void |
unindent()
Decreases the indent level by 1
|
private java.util.List<JCodeStatement> source
private short indentSize
private short currentIndent
public JSourceCode()
public JSourceCode(java.lang.String sourceCode)
sourceCode
- the source to addpublic void add(java.lang.String statement)
statement
- the statement to addpublic void add(java.lang.String statement, short indentSize)
statement
- the statement to addindentSize
- the indentSize is the size of the indentation to use
when printing this JSourceCodeprint(org.codehaus.modello.plugin.java.javasource.JSourceWriter)
public void addIndented(java.lang.String statement)
indent();
add(statement);
unindent();
statement
- the statement to addpublic void append(java.lang.String segment)
segment
- the String to appendpublic void clear()
public void copyInto(JSourceCode jsc)
jsc
- the JSourceCode to copy this JSourceCode intopublic void indent()
public boolean isEmpty()
public void print(JSourceWriter jsw)
jsw
- the JSourceWriter to print topublic void unindent()
public java.lang.String toString()
toString
in class java.lang.Object
private void addCodeStatement(JCodeStatement jcs)
jcs
- the JCodeStatement to add