net.jangaroo.jooc
Class JsWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.FilterWriter
          extended by net.jangaroo.jooc.JsWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public final class JsWriter
extends FilterWriter

Author:
Andreas Gawecki

Field Summary
 
Fields inherited from class java.io.FilterWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
JsWriter(Writer target)
           
 
Method Summary
 void beginComment()
           
 void beginCommentWriteSymbol(JooSymbol symbol)
           
 void beginString()
           
 void close()
           
 void endComment()
           
 void endString()
           
 boolean getEnableAssertions()
           
 String getFunctionNameAsIde(net.jangaroo.jooc.FunctionExpr functionExpr)
           
 boolean getKeepLines()
           
 boolean getKeepSource()
           
 JoocOptions getOptions()
           
 String getQualifiedNameAsIde(IdeDeclaration ideDeclaration)
           
 boolean isWriteActionScriptApi()
           
 void setOptions(JoocOptions options)
           
 void setWriteActionScriptApi(boolean writeActionScriptApi)
           
 void write(char[] cbuf, int off, int len)
           
 void write(int c)
           
 void write(String str, int off, int len)
           
 void writeArray(Object[] items)
           
 void writeDate(Calendar value)
           
 void writeDate(Date value)
           
 void writeInt(int value)
           
protected  void writeLines(String s)
           
protected  void writeLines(String s, int off, int len)
           
 void writeObject(Object o)
           
 void writeString(String value)
           
 void writeSymbol(JooSymbol symbol)
           
 void writeSymbol(JooSymbol symbol, boolean withWhitespace)
           
 void writeSymbol(JooSymbol symbol, String prefix, String postfix)
          Variant of writeSymbol() to use if you want to transform the symbol text with a prefix and/or postfix string
 void writeSymbolToken(JooSymbol symbol)
           
 void writeSymbolWhitespace(JooSymbol symbol)
           
 void writeToken(String token)
           
 
Methods inherited from class java.io.FilterWriter
flush
 
Methods inherited from class java.io.Writer
append, append, append, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsWriter

public JsWriter(Writer target)
Method Detail

setOptions

public void setOptions(JoocOptions options)

setWriteActionScriptApi

public void setWriteActionScriptApi(boolean writeActionScriptApi)

getOptions

public JoocOptions getOptions()

isWriteActionScriptApi

public boolean isWriteActionScriptApi()

getKeepSource

public boolean getKeepSource()

getKeepLines

public boolean getKeepLines()

getEnableAssertions

public boolean getEnableAssertions()

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

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 void 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

writeSymbol

public void writeSymbol(JooSymbol symbol,
                        String prefix,
                        String postfix)
                 throws IOException
Variant of writeSymbol() to use if you want to transform the symbol text with a prefix and/or postfix string

Parameters:
symbol - the symbol to write
prefix - a (possibly empty) string to write before the symbol token string
postfix - a (possibly empty) string to write after the symbol token string
Throws:
IOException - if an IO error occurs

writeSymbolToken

public void writeSymbolToken(JooSymbol symbol)
                      throws IOException
Throws:
IOException

write

public void write(int c)
           throws IOException
Overrides:
write in class FilterWriter
Throws:
IOException

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class FilterWriter
Throws:
IOException

write

public void write(String str,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class FilterWriter
Throws:
IOException

getQualifiedNameAsIde

public String getQualifiedNameAsIde(IdeDeclaration ideDeclaration)

getFunctionNameAsIde

public String getFunctionNameAsIde(net.jangaroo.jooc.FunctionExpr functionExpr)

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class FilterWriter
Throws:
IOException


Copyright © 2002-2011 CoreMedia AG. All Rights Reserved.