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:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public final class JsWriter
extends java.io.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(java.io.Writer target)
           
 
Method Summary
 void beginComment()
           
 void beginCommentWriteSymbol(JooSymbol symbol)
           
 void beginString()
           
 void close()
           
 void endComment()
           
 void endString()
           
 boolean getEnableAssertions()
           
 java.lang.String getFunctionNameAsIde(net.jangaroo.jooc.FunctionExpr functionExpr)
           
 boolean getKeepLines()
           
 boolean getKeepSource()
           
 JoocOptions getOptions()
           
 java.lang.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(java.lang.String str, int off, int len)
           
 void writeArray(java.lang.Object[] items)
           
 void writeDate(java.util.Calendar value)
           
 void writeDate(java.util.Date value)
           
 void writeInt(int value)
           
protected  void writeLines(java.lang.String s)
           
protected  void writeLines(java.lang.String s, int off, int len)
           
 void writeObject(java.lang.Object o)
           
 void writeString(java.lang.String value)
           
 void writeSymbol(JooSymbol symbol)
           
 void writeSymbol(JooSymbol symbol, boolean withWhitespace)
           
 void writeSymbol(JooSymbol symbol, java.lang.String prefix, java.lang.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(java.lang.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(java.io.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 java.io.IOException
Throws:
java.io.IOException

writeString

public void writeString(java.lang.String value)
                 throws java.io.IOException
Throws:
java.io.IOException

writeDate

public void writeDate(java.util.Date value)
               throws java.io.IOException
Throws:
java.io.IOException

writeDate

public void writeDate(java.util.Calendar value)
               throws java.io.IOException
Throws:
java.io.IOException

writeObject

public void writeObject(java.lang.Object o)
                 throws java.io.IOException
Throws:
java.io.IOException

writeArray

public void writeArray(java.lang.Object[] items)
                throws java.io.IOException
Throws:
java.io.IOException

beginComment

public void beginComment()
                  throws java.io.IOException
Throws:
java.io.IOException

endComment

public void endComment()
                throws java.io.IOException
Throws:
java.io.IOException

beginCommentWriteSymbol

public void beginCommentWriteSymbol(JooSymbol symbol)
                             throws java.io.IOException
Throws:
java.io.IOException

beginString

public void beginString()
                 throws java.io.IOException
Throws:
java.io.IOException

endString

public void endString()
               throws java.io.IOException
Throws:
java.io.IOException

writeSymbolWhitespace

public void writeSymbolWhitespace(JooSymbol symbol)
                           throws java.io.IOException
Throws:
java.io.IOException

writeLines

protected void writeLines(java.lang.String s)
                   throws java.io.IOException
Throws:
java.io.IOException

writeLines

protected void writeLines(java.lang.String s,
                          int off,
                          int len)
                   throws java.io.IOException
Throws:
java.io.IOException

writeToken

public void writeToken(java.lang.String token)
                throws java.io.IOException
Throws:
java.io.IOException

writeSymbol

public void writeSymbol(JooSymbol symbol)
                 throws java.io.IOException
Throws:
java.io.IOException

writeSymbol

public void writeSymbol(JooSymbol symbol,
                        boolean withWhitespace)
                 throws java.io.IOException
Throws:
java.io.IOException

writeSymbol

public void writeSymbol(JooSymbol symbol,
                        java.lang.String prefix,
                        java.lang.String postfix)
                 throws java.io.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:
java.io.IOException - if an IO error occurs

writeSymbolToken

public void writeSymbolToken(JooSymbol symbol)
                      throws java.io.IOException
Throws:
java.io.IOException

write

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

write

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

write

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

getQualifiedNameAsIde

public java.lang.String getQualifiedNameAsIde(IdeDeclaration ideDeclaration)

getFunctionNameAsIde

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

close

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


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