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 nullpublic void flushComments()
EmitContextflushComments in interface EmitContextEmitContext.comment(int, String)public void flushComments(int location)
EmitContextflushComments in interface EmitContextlocation - the character position (exclusive)EmitContext.comment(int, String)public void keyword(String keyword)
EmitContextkeyword in interface EmitContextkeyword - the keyword stringpublic void symbol(String symbol)
EmitContextsymbol in interface EmitContextsymbol - the symbol stringpublic void immediate(String immediate)
EmitContextimmediate in interface EmitContextimmediate - the stringpublic void operator(String symbol)
EmitContextoperator in interface EmitContextsymbol - the operator symbolpublic void separator(String symbol)
EmitContextseparator in interface EmitContextsymbol - the separator symbolpublic void padding()
EmitContextpadding in interface EmitContextpublic void blockPadding()
EmitContextblockPadding in interface EmitContextpublic void comment(int location,
String content)
EmitContextEmitContext.flushComments(int).comment in interface EmitContextlocation - the character position of the commentcontent - contents of the commentpublic void classBlock(EmitDirection direction)
EmitContextclassBlock in interface EmitContextdirection - indicates either begin or endpublic void arrayInitializerBlock(EmitDirection direction)
EmitContextarrayInitializerBlock in interface EmitContextdirection - indicates either begin or endpublic void statementBlock(EmitDirection direction)
EmitContextstatementBlock in interface EmitContextdirection - indicates either begin or endpublic void switchLabel(EmitDirection direction)
EmitContextswitch label block.switchLabel in interface EmitContextdirection - indicates either begin or endpublic void statement(EmitDirection direction)
EmitContextstatement in interface EmitContextdirection - indicates either begin or endpublic void declaration(EmitDirection direction)
EmitContextdeclaration in interface EmitContextdirection - indicates either begin or endpublic void docComment(EmitDirection direction)
EmitContextdocComment in interface EmitContextdirection - indicates either begin or endpublic void docBlock(EmitDirection direction)
EmitContextdocBlock in interface EmitContextdirection - indicates either begin or endpublic void docInlineBlock(EmitDirection direction)
EmitContextdocInlineBlock in interface EmitContextdirection - indicates either begin or endpublic void putBlockComment(List<String> contents)
EmitContextputBlockComment in interface EmitContextcontents - contents of the commentpublic void putLineComment(String content)
EmitContextputLineComment in interface EmitContextcontent - contents of the commentpublic void putInlineComment(String content)
EmitContextputInlineComment in interface EmitContextcontent - contents of the commentCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.