|
Lombok.ast - v0.2.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 SourceFormatternode - 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 SourceFormatternode - 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 SourceFormatterfail - 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 SourceFormatterpublic void operator(String text)
operator in interface SourceFormatterpublic void verticalSpace()
SourceFormatterverticalSpace will be called.
verticalSpace in interface SourceFormatterpublic void space()
SourceFormatter
space in interface SourceFormatterpublic void append(String text)
SourceFormatter
append in interface SourceFormattertext - The raw text to print. If your output format requires it, it is the implementor's responsibility to escape this text.public void startSuppressBlock()
SourceFormatterbuildBlock(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 SourceFormatterpublic void endSuppressBlock()
SourceFormatterSourceFormatter.startSuppressBlock() call.
endSuppressBlock in interface SourceFormatterpublic void startSuppressIndent()
SourceFormatterbuildBlock(Node) call should NOT indent.
Example: The case or default statement inside a switch block.
startSuppressIndent in interface SourceFormatterpublic void endSuppressIndent()
SourceFormatterSourceFormatter.startSuppressIndent() call.
endSuppressIndent in interface SourceFormatterpublic void closeInline()
SourceFormatterSourceFormatter.buildInline(Node) call.
closeInline in interface SourceFormatterpublic void closeBlock()
SourceFormatterSourceFormatter.buildBlock(Node) call.
closeBlock in interface SourceFormatter
public void addError(int errorStart,
int errorEnd,
String errorMessage)
SourceFormatter
addError in interface SourceFormatterpublic String finish()
SourceFormatter
finish in interface SourceFormatterpublic void setTimeTaken(long taken)
SourceFormatter
setTimeTaken in interface SourceFormatterpublic void nameNextElement(String name)
SourceFormatterSourceFormatter.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.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||