public class JSDocEmitter extends Object implements IDocEmitter, IEmitter
| Constructor and Description |
|---|
JSDocEmitter(IJSEmitter emitter) |
| Modifier and Type | Method and Description |
|---|---|
void |
begin() |
void |
end() |
String |
flushBuffer() |
protected StringBuilder |
getBuilder() |
void |
indentPop()
Pops an indent from the emitter so after newlines are emitted, the output
is correctly formatted.
|
void |
indentPush()
Pushes an indent into the emitter so after newlines are emitted, the
output is correctly formatted.
|
boolean |
isBufferWrite() |
void |
setBufferWrite(boolean value) |
String |
stringifyNode(IASNode node)
Takes the node argument and created a String representation if it using
the buffer temporarily.
|
void |
write(IEmitterTokens value)
Writes a string to the writer.
|
void |
write(String value) |
void |
writeBlockClose() |
void |
writeBlockOpen() |
void |
writeNewline()
Writes newline character(s)
|
void |
writeNewline(IEmitterTokens value)
Writes the
value and then a newline which will automatically
have the indent applied after the \n character. |
void |
writeNewline(IEmitterTokens value,
boolean pushIndent)
Writes the
value after a push or pop of the indent. |
void |
writeNewline(String value) |
void |
writeNewline(String value,
boolean pushIndent) |
void |
writeToken(IEmitterTokens value)
Writes a
ASEmitterTokens character to the buffer and appends a
space after automatically. |
void |
writeToken(String value) |
protected IEmitter emitter
public JSDocEmitter(IJSEmitter emitter)
protected StringBuilder getBuilder()
public boolean isBufferWrite()
public void setBufferWrite(boolean value)
setBufferWrite in interface IDocEmitterpublic String flushBuffer()
flushBuffer in interface IDocEmitterpublic void indentPush()
IEmitterindentPush in interface IEmitterpublic void indentPop()
IEmitterpublic void write(IEmitterTokens value)
IEmitterpublic void writeNewline()
IEmitterwriteNewline in interface IEmitterpublic void writeNewline(String value)
writeNewline in interface IEmitterpublic void writeNewline(IEmitterTokens value)
IEmittervalue and then a newline which will automatically
have the indent applied after the \n character.writeNewline in interface IEmittervalue - The String value to write before the \n is appended.public void writeNewline(String value, boolean pushIndent)
writeNewline in interface IEmitterpublic void writeNewline(IEmitterTokens value, boolean pushIndent)
IEmittervalue after a push or pop of the indent.
This method effectively lets you write a value and then indent our
outdent. The method can be useful in the following where your cursor
writer is at [0], you write
writeNewline("if (foo) {", true); and the cursor after the
call will end up at [1].
[0]if (foo) {
[1]this.something;
}
writeNewline in interface IEmittervalue - The String value to write before the \n is appended.pushIndent - Whether to push indent true or pop indent
false.public void writeToken(IEmitterTokens value)
IEmitterASEmitterTokens character to the buffer and appends a
space after automatically.writeToken in interface IEmittervalue - The ASEmitterTokens value.public void writeToken(String value)
writeToken in interface IEmitterpublic void writeBlockClose()
public void writeBlockOpen()
public void begin()
begin in interface IDocEmitterpublic void end()
end in interface IDocEmitterpublic String stringifyNode(IASNode node)
IEmitterNote; This method is still beta, it need more logic if an emitter is actually using the buffer!
stringifyNode in interface IEmitternode - The node walk and create a String for.Copyright © 2016 The Apache Software Foundation. All rights reserved.