|
Lombok.ast - v0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlombok.ast.printer.StructureFormatter
public class StructureFormatter
Field Summary |
---|
Fields inherited from interface lombok.ast.printer.SourceFormatter |
---|
FAIL |
Method Summary | |
---|---|
void |
addError(int errorStart,
int errorEnd,
String errorMessage)
Registers a parse error with the formatter. |
void |
append(String text)
Add raw text to the output stream. |
void |
buildBlock(Node node)
Opens a new AST level which is normally rendered as a block (example: statements, methods, type bodies). |
void |
buildInline(Node node)
Opens a new AST level which is normally rendered inline (example: expressions, literals, modifiers, identifiers, etc). |
void |
closeBlock()
Closes the previous SourceFormatter.buildBlock(Node) call. |
void |
closeInline()
Closes the previous SourceFormatter.buildInline(Node) call. |
void |
endSuppressBlock()
Closes the previous SourceFormatter.startSuppressBlock() call. |
void |
endSuppressIndent()
Closes the previous SourceFormatter.startSuppressIndent() call. |
void |
fail(String fail)
The AST is not valid; it applies to the current level. |
String |
finish()
Generate the source representation and return it as a string. |
static StructureFormatter |
formatterWithEverything(Source source)
|
static StructureFormatter |
formatterWithoutPositions()
|
static StructureFormatter |
formatterWithPositions()
|
void |
keyword(String text)
|
void |
nameNextElement(String name)
The next SourceFormatter.buildInline(Node) or SourceFormatter.buildBlock(Node) 's relation to the current block is named by this call. |
void |
operator(String text)
|
void |
property(String name,
Object value)
|
void |
setTimeTaken(long taken)
Reports the total time taken in milliseconds by the parser. |
StructureFormatter |
skipProperty(Class<? extends Node> type,
String propertyName)
|
void |
space()
Generate horizontal space. |
void |
startSuppressBlock()
The next buildBlock(Node) call should NOT be rendered in its own vertical area, but should instead be treated as an inline element. |
void |
startSuppressIndent()
The next buildBlock(Node) call should NOT indent. |
void |
verticalSpace()
Generate an extra vertical spacer if the output format allows for it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static StructureFormatter formatterWithoutPositions()
public static StructureFormatter formatterWithPositions()
public static StructureFormatter formatterWithEverything(Source source)
public void buildInline(Node node)
SourceFormatter
buildInline
in interface SourceFormatter
node
- The AST node that this level represents. Can be null
which signals that the current node has an inline substructure.public void buildBlock(Node node)
SourceFormatter
buildBlock
in interface SourceFormatter
node
- The AST node that this level represents. Can be null
which signals that the current node has a block substructure.public void fail(String fail)
SourceFormatter
fail
in interface SourceFormatter
fail
- Human readable explanation of what's wrong with the AST at this level.public void property(String name, Object value)
property
in interface SourceFormatter
public StructureFormatter skipProperty(Class<? extends Node> type, String propertyName)
public void keyword(String text)
keyword
in interface SourceFormatter
public void operator(String text)
operator
in interface SourceFormatter
public void verticalSpace()
SourceFormatter
verticalSpace
will be called.
verticalSpace
in interface SourceFormatter
public void space()
SourceFormatter
space
in interface SourceFormatter
public void append(String text)
SourceFormatter
append
in interface SourceFormatter
text
- The raw text to print. If your output format requires it, it is the implementor's responsibility to escape this text.public void startSuppressBlock()
SourceFormatter
buildBlock(Node)
call should NOT be rendered in its own vertical area, but should instead be treated as an inline
element.
Example: The execution statement is part of an if statement but has to be a statement, which is normally a block element. This call is generated before
the execution statement so that the execution statement is printed inline with the if statement.
startSuppressBlock
in interface SourceFormatter
public void endSuppressBlock()
SourceFormatter
SourceFormatter.startSuppressBlock()
call.
endSuppressBlock
in interface SourceFormatter
public void startSuppressIndent()
SourceFormatter
buildBlock(Node)
call should NOT indent.
Example: The case
or default
statement inside a switch
block.
startSuppressIndent
in interface SourceFormatter
public void endSuppressIndent()
SourceFormatter
SourceFormatter.startSuppressIndent()
call.
endSuppressIndent
in interface SourceFormatter
public void closeInline()
SourceFormatter
SourceFormatter.buildInline(Node)
call.
closeInline
in interface SourceFormatter
public void closeBlock()
SourceFormatter
SourceFormatter.buildBlock(Node)
call.
closeBlock
in interface SourceFormatter
public void addError(int errorStart, int errorEnd, String errorMessage)
SourceFormatter
addError
in interface SourceFormatter
public String finish()
SourceFormatter
finish
in interface SourceFormatter
public void setTimeTaken(long taken)
SourceFormatter
setTimeTaken
in interface SourceFormatter
public void nameNextElement(String name)
SourceFormatter
SourceFormatter.buildInline(Node)
or SourceFormatter.buildBlock(Node)
's relation to the current block is named by this call.
Not all elements will get a name, and the name only applies to the next buildBlock/Inline
call, not to any further calls.
nameNextElement
in interface SourceFormatter
|
Lombok.ast - v0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |