| |
|
| java.lang.Object de.gulden.util.javasource.SourceObject de.gulden.util.javasource.Implementation de.gulden.util.javasource.Code
Code | public class Code extends Implementation (Code) | | Represents code in a method/constructor body, and in a static class initializer.
author: Jens Gulden version: 1.1 |
Field Summary | |
protected String | raw The raw code string. |
Constructor Summary | |
public | Code() Creates a new instance of Code. |
Code | public Code()(Code) | | Creates a new instance of Code.
|
getRaw | public String getRaw()(Code) | | Returns the raw code string.
|
initFromAST | void initFromAST(Node rootnode)(Code) | | Initialize this object from parsed Java code.
Parameters: rootnode - The corresponding node in the abstract syntax tree (AST). |
initFromXML | public void initFromXML(Element element) throws IOException(Code) | | Initialize this object from XML.
Parameters: element - The XML tag. throws: IOException - if an i/o error occurs |
setRaw | public void setRaw(String s)(Code) | | Sets the raw code string.
|
unindent | static String unindent(String code)(Code) | | Creates an unindented representation of a code block by shifting all lines to the left so that
the first line will start at column 0. All other lines are shifted relative to the shift of the first line.
The specified code block is expected to be passed without enclosing braces.
unindented code |
|
|
|