com.sun.codemodel
Class ClassWriter

java.lang.Object
  extended by com.sun.codemodel.ClassWriter

public class ClassWriter
extends Object

Writes single classes to a specified Writer

See Also:
write(com.sun.codemodel.JDefinedClass), render(com.sun.codemodel.JDefinedClass)

Constructor Summary
ClassWriter(Writer writer)
           
 
Method Summary
 void close()
          Close the underlying writer
static String render(com.sun.codemodel.JDefinedClass type)
          Render the specified type as a string
 void write(com.sun.codemodel.JDefinedClass type)
          Write the specified type to the Writer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassWriter

public ClassWriter(Writer writer)
Parameters:
writer - the writer to write all types to
Method Detail

write

public void write(com.sun.codemodel.JDefinedClass type)
Write the specified type to the Writer

Parameters:
type - the type to write to the writer

close

public void close()
           throws IOException
Close the underlying writer

Throws:
IOException - if the writer throws an IOException while closing

render

public static String render(com.sun.codemodel.JDefinedClass type)
Render the specified type as a string

Parameters:
type - the type to render
Returns:
the compilation unit, as a string


Copyright © 2011. All Rights Reserved.