uic.output
Class JavaFileWriter

java.lang.Object
  extended byuic.output.JavaFileWriter
All Implemented Interfaces:
OutputterInterface

public class JavaFileWriter
extends Object
implements OutputterInterface

Take a Builder that has a build-structure in it and generate a java file.


Field Summary
protected  Collection blackList
           
protected  TreeSet done
           
 
Constructor Summary
JavaFileWriter()
           
JavaFileWriter(UICBuilder builder)
           
 
Method Summary
protected  String build(Representer representer, boolean isRootNode)
           
protected  String build(Representer representer, boolean isRootNode, boolean rootWidget)
           
protected  String buildAdds(ContainerRepresenter container)
           
protected static String chompClassname(String in)
           
protected static Collection fillBlackList(UICBuilder builder)
           
protected static String getDeclarations(List widgets)
           
protected  String getImport(Representer rep)
           
protected  String getImports(List widgets)
           
protected  void getImports(Vector done, HashMap packages, Representer rep)
           
protected static String getPackageName(String fullClassName)
           
protected static String indent(String in, int amount)
           
 Object run(String workingDir, UIC.BuildSettings buildSettings)
          Run the outputter.
 void setBuilder(UICBuilder builder)
          The UICBuilder contains the structure and info like the classname needed when 'outputting'.
 void write(Writer writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

done

protected TreeSet done

blackList

protected Collection blackList
Constructor Detail

JavaFileWriter

public JavaFileWriter()

JavaFileWriter

public JavaFileWriter(UICBuilder builder)
Method Detail

setBuilder

public void setBuilder(UICBuilder builder)
Description copied from interface: OutputterInterface
The UICBuilder contains the structure and info like the classname needed when 'outputting'.

Specified by:
setBuilder in interface OutputterInterface

run

public Object run(String workingDir,
                  UIC.BuildSettings buildSettings)
           throws CompilerException
Description copied from interface: OutputterInterface
Run the outputter.

Specified by:
run in interface OutputterInterface
Parameters:
workingDir - is the (relative) path to the directory where the input file lives.
buildSettings - variables used to create the build.
Throws:
CompilerException - when something fails.

write

public void write(Writer writer)
           throws IOException
Throws:
IOException

build

protected String build(Representer representer,
                       boolean isRootNode)

build

protected String build(Representer representer,
                       boolean isRootNode,
                       boolean rootWidget)
Parameters:
representer - the representer that should be build
isRootNode - when true this representer is on a new line and needs to be assigned to a name.
rootWidget - determines wheather the representer should be instanciated or not. The main class (where the guiInit is a method of) does not have a '= new' part, so then this is true

buildAdds

protected String buildAdds(ContainerRepresenter container)

getImports

protected String getImports(List widgets)

getImports

protected void getImports(Vector done,
                          HashMap packages,
                          Representer rep)

getImport

protected String getImport(Representer rep)

getPackageName

protected static String getPackageName(String fullClassName)

getDeclarations

protected static String getDeclarations(List widgets)

indent

protected static String indent(String in,
                               int amount)

chompClassname

protected static String chompClassname(String in)

fillBlackList

protected static Collection fillBlackList(UICBuilder builder)


Copyright © 2002,2003 Thomas Zander Available under the Free Apache licence