Package net.jangaroo.jooc
Class JsWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- net.jangaroo.jooc.JsWriter
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public final class JsWriter extends FilterWriter
- Author:
- Andreas Gawecki
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJsWriter.SymbolToOutputFilePosition
-
Field Summary
-
Fields inherited from class java.io.FilterWriter
out
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginComment()voidbeginCommentWriteSymbol(JooSymbol symbol)voidbeginString()voidclose()voidclose(String suffix)voidendComment()voidendString()booleangetKeepLines()booleangetKeepSource()net.jangaroo.jooc.config.JoocOptionsgetOptions()StringgetQualifiedNameAsIde(IdeDeclaration ideDeclaration)List<JsWriter.SymbolToOutputFilePosition>getSourceMappings()booleanisWritingComment()voidsetOptions(net.jangaroo.jooc.config.JoocOptions options)voidsetSuppressWhitespace(boolean suppressWhitespace)voidsuppressWhitespace(JooSymbol symbol)voidwrite(char[] cbuf, int off, int len)voidwrite(int c)voidwrite(String str, int off, int len)voidwriteArray(Object[] items)voidwriteDate(Calendar value)voidwriteDate(Date value)voidwriteInt(int value)protected voidwriteLines(String s)protected voidwriteLines(String s, int off, int len)voidwriteNonTrivialWhitespace(List<JooSymbol> symbols)voidwriteObject(Object o)voidwriteString(String value)voidwriteSymbol(JooSymbol symbol)voidwriteSymbol(JooSymbol symbol, boolean withWhitespace)voidwriteSymbolToken(JooSymbol symbol)voidwriteSymbolWhitespace(JooSymbol symbol)FilePositionwriteToken(String token)voidwriteTokenForSymbol(String token, JooSymbol symbol)-
Methods inherited from class java.io.FilterWriter
flush
-
-
-
-
Constructor Detail
-
JsWriter
public JsWriter(Writer target)
-
-
Method Detail
-
setOptions
public void setOptions(net.jangaroo.jooc.config.JoocOptions options)
-
getOptions
public net.jangaroo.jooc.config.JoocOptions getOptions()
-
getKeepSource
public boolean getKeepSource()
-
getKeepLines
public boolean getKeepLines()
-
writeInt
public void writeInt(int value) throws IOException- Throws:
IOException
-
writeString
public void writeString(String value) throws IOException
- Throws:
IOException
-
writeDate
public void writeDate(Date value) throws IOException
- Throws:
IOException
-
writeDate
public void writeDate(Calendar value) throws IOException
- Throws:
IOException
-
writeObject
public void writeObject(Object o) throws IOException
- Throws:
IOException
-
writeArray
public void writeArray(Object[] items) throws IOException
- Throws:
IOException
-
beginComment
public void beginComment() throws IOException- Throws:
IOException
-
endComment
public void endComment() throws IOException- Throws:
IOException
-
beginCommentWriteSymbol
public void beginCommentWriteSymbol(JooSymbol symbol) throws IOException
- Throws:
IOException
-
beginString
public void beginString() throws IOException- Throws:
IOException
-
endString
public void endString() throws IOException- Throws:
IOException
-
setSuppressWhitespace
public void setSuppressWhitespace(boolean suppressWhitespace)
-
suppressWhitespace
public void suppressWhitespace(JooSymbol symbol)
-
writeNonTrivialWhitespace
public void writeNonTrivialWhitespace(List<JooSymbol> symbols) throws IOException
- Throws:
IOException
-
writeSymbolWhitespace
public void writeSymbolWhitespace(JooSymbol symbol) throws IOException
- Throws:
IOException
-
writeLines
protected void writeLines(String s) throws IOException
- Throws:
IOException
-
writeLines
protected void writeLines(String s, int off, int len) throws IOException
- Throws:
IOException
-
writeToken
public FilePosition writeToken(String token) throws IOException
- Throws:
IOException
-
writeSymbol
public void writeSymbol(JooSymbol symbol) throws IOException
- Throws:
IOException
-
writeSymbol
public void writeSymbol(JooSymbol symbol, boolean withWhitespace) throws IOException
- Throws:
IOException
-
writeSymbolToken
public void writeSymbolToken(JooSymbol symbol) throws IOException
- Throws:
IOException
-
writeTokenForSymbol
public void writeTokenForSymbol(String token, JooSymbol symbol) throws IOException
- Throws:
IOException
-
write
public void write(int c) throws IOException- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
public void write(char[] cbuf, int off, int len) throws IOException- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
public void write(String str, int off, int len) throws IOException
- Overrides:
writein classFilterWriter- Throws:
IOException
-
getQualifiedNameAsIde
public String getQualifiedNameAsIde(IdeDeclaration ideDeclaration)
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterWriter- Throws:
IOException
-
close
public void close(String suffix) throws IOException
- Throws:
IOException
-
getSourceMappings
public List<JsWriter.SymbolToOutputFilePosition> getSourceMappings()
-
isWritingComment
public boolean isWritingComment()
-
-