public class PrintEmitContext extends Object implements EmitContext
EmitContext
for writing into PrintWriter
.Constructor and Description |
---|
PrintEmitContext(PrintWriter writer)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
arrayInitializerBlock(EmitDirection direction)
Emits a begin or end of an array initializer block.
|
void |
blockPadding()
Emits a block padding.
|
void |
classBlock(EmitDirection direction)
Emits a begin or end of a class block.
|
void |
comment(int location,
String content)
Registers a comment.
|
void |
declaration(EmitDirection direction)
Emits a begin or end of a type or member declaration.
|
void |
docBlock(EmitDirection direction)
Emits a begin or end of a block in documentation comments.
|
void |
docComment(EmitDirection direction)
Emits a begin or end of a documentation comment.
|
void |
docInlineBlock(EmitDirection direction)
Emits a begin or end of an inline block in documentation comments.
|
void |
flushComments()
Flushes the previously registered comments.
|
void |
flushComments(int location)
Flushes the previously registered comments before the specified character position.
|
void |
immediate(String immediate)
Emits a normal text.
|
void |
keyword(String keyword)
Emits a keyword.
|
void |
operator(String symbol)
Emits an operator symbol.
|
void |
padding()
Emits a padding.
|
void |
putBlockComment(List<String> contents)
Adds a block comment.
|
void |
putInlineComment(String content)
Puts an inline comment.
|
void |
putLineComment(String content)
Puts a line comment.
|
void |
separator(String symbol)
Emits a separator symbol.
|
void |
statement(EmitDirection direction)
Emits a begin or end of a statement.
|
void |
statementBlock(EmitDirection direction)
Emits a begin or end of a statement block.
|
void |
switchLabel(EmitDirection direction)
Emits a begin or end of a
switch label block. |
void |
symbol(String symbol)
Emits a symbol.
|
public PrintEmitContext(PrintWriter writer)
writer
- the target writerIllegalArgumentException
- if the parameter is null
public void flushComments()
EmitContext
flushComments
in interface EmitContext
EmitContext.comment(int, String)
public void flushComments(int location)
EmitContext
flushComments
in interface EmitContext
location
- the character position (exclusive)EmitContext.comment(int, String)
public void keyword(String keyword)
EmitContext
keyword
in interface EmitContext
keyword
- the keyword stringpublic void symbol(String symbol)
EmitContext
symbol
in interface EmitContext
symbol
- the symbol stringpublic void immediate(String immediate)
EmitContext
immediate
in interface EmitContext
immediate
- the stringpublic void operator(String symbol)
EmitContext
operator
in interface EmitContext
symbol
- the operator symbolpublic void separator(String symbol)
EmitContext
separator
in interface EmitContext
symbol
- the separator symbolpublic void padding()
EmitContext
padding
in interface EmitContext
public void blockPadding()
EmitContext
blockPadding
in interface EmitContext
public void comment(int location, String content)
EmitContext
EmitContext.flushComments(int)
.comment
in interface EmitContext
location
- the character position of the commentcontent
- contents of the commentpublic void classBlock(EmitDirection direction)
EmitContext
classBlock
in interface EmitContext
direction
- indicates either begin or endpublic void arrayInitializerBlock(EmitDirection direction)
EmitContext
arrayInitializerBlock
in interface EmitContext
direction
- indicates either begin or endpublic void statementBlock(EmitDirection direction)
EmitContext
statementBlock
in interface EmitContext
direction
- indicates either begin or endpublic void switchLabel(EmitDirection direction)
EmitContext
switch
label block.switchLabel
in interface EmitContext
direction
- indicates either begin or endpublic void statement(EmitDirection direction)
EmitContext
statement
in interface EmitContext
direction
- indicates either begin or endpublic void declaration(EmitDirection direction)
EmitContext
declaration
in interface EmitContext
direction
- indicates either begin or endpublic void docComment(EmitDirection direction)
EmitContext
docComment
in interface EmitContext
direction
- indicates either begin or endpublic void docBlock(EmitDirection direction)
EmitContext
docBlock
in interface EmitContext
direction
- indicates either begin or endpublic void docInlineBlock(EmitDirection direction)
EmitContext
docInlineBlock
in interface EmitContext
direction
- indicates either begin or endpublic void putBlockComment(List<String> contents)
EmitContext
putBlockComment
in interface EmitContext
contents
- contents of the commentpublic void putLineComment(String content)
EmitContext
putLineComment
in interface EmitContext
content
- contents of the commentpublic void putInlineComment(String content)
EmitContext
putInlineComment
in interface EmitContext
content
- contents of the commentCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.