org.fuin.apps4swing
Class Apps4SwingUtils

java.lang.Object
  extended by org.fuin.apps4swing.Apps4SwingUtils

public final class Apps4SwingUtils
extends Object

Utility methods for the package.


Method Summary
static void addMethodCallLogStmt(org.fuin.srcgen4javassist.SgClassPool pool, List<String> lines, org.fuin.srcgen4javassist.SgMethod method)
          Add some log lines for a method call including method name and arguments (DEBUG) and argument values (TRACE).
static void addPrivateStaticLogger(org.fuin.srcgen4javassist.SgClassPool pool, org.fuin.srcgen4javassist.SgClass clasz)
          Adds a private static LOG variable to the class.
static void addVarTraceStmt(org.fuin.srcgen4javassist.SgClassPool pool, List<String> lines, String varName, org.fuin.srcgen4javassist.SgClass varType)
          Creates a trace line for a variable.
static org.fuin.srcgen4javassist.SgClass createCallableClass(org.fuin.srcgen4javassist.SgClassPool pool, org.fuin.srcgen4javassist.ByteCodeGenerator generator, org.fuin.srcgen4javassist.factory.VarListImplementationFactory varListFactory, org.fuin.srcgen4javassist.SgVariable var, Class<?> intf, org.fuin.srcgen4javassist.SgMethod method)
          Creates a class that implements Runnable that calls a given method.
static org.fuin.srcgen4javassist.SgClass createEDTGetterClass(org.fuin.srcgen4javassist.SgClassPool pool, org.fuin.srcgen4javassist.ByteCodeGenerator generator, org.fuin.srcgen4javassist.factory.VarListImplementationFactory varListFactory, org.fuin.srcgen4javassist.SgVariable var, org.fuin.srcgen4javassist.SgMethod method)
          Creates a class that implements EDTGetter that calls a given method.
static org.fuin.srcgen4javassist.SgClass createRunnableClass(org.fuin.srcgen4javassist.SgClassPool pool, org.fuin.srcgen4javassist.ByteCodeGenerator generator, org.fuin.srcgen4javassist.factory.VarListImplementationFactory varListFactory, org.fuin.srcgen4javassist.SgVariable var, org.fuin.srcgen4javassist.SgMethod method)
          Creates a class that implements Runnable that calls a given method.
static void writeToFile(File file, String text)
          Writes the given text to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addPrivateStaticLogger

public static void addPrivateStaticLogger(org.fuin.srcgen4javassist.SgClassPool pool,
                                          org.fuin.srcgen4javassist.SgClass clasz)
Adds a private static LOG variable to the class.

Parameters:
pool - Class pool.
clasz - Class to add a Logger to.

addVarTraceStmt

public static void addVarTraceStmt(org.fuin.srcgen4javassist.SgClassPool pool,
                                   List<String> lines,
                                   String varName,
                                   org.fuin.srcgen4javassist.SgClass varType)
Creates a trace line for a variable.

Parameters:
pool - Class pool.
lines - The statement is added to this collection.
varName - Name of the variable.
varType - Type of the variable.

addMethodCallLogStmt

public static void addMethodCallLogStmt(org.fuin.srcgen4javassist.SgClassPool pool,
                                        List<String> lines,
                                        org.fuin.srcgen4javassist.SgMethod method)
Add some log lines for a method call including method name and arguments (DEBUG) and argument values (TRACE).

Parameters:
pool - Class pool.
lines - The statement is added to this collection.
method - Method to create a call trace for.

createRunnableClass

public static org.fuin.srcgen4javassist.SgClass createRunnableClass(org.fuin.srcgen4javassist.SgClassPool pool,
                                                                    org.fuin.srcgen4javassist.ByteCodeGenerator generator,
                                                                    org.fuin.srcgen4javassist.factory.VarListImplementationFactory varListFactory,
                                                                    org.fuin.srcgen4javassist.SgVariable var,
                                                                    org.fuin.srcgen4javassist.SgMethod method)
Creates a class that implements Runnable that calls a given method. The implementation is created inside the same package as the class that owns the method that is called.

Parameters:
pool - Class pool.
generator - Byte code generator.
varListFactory - Helper factory.
var - Name and type of the variable.
method - Method to call on the variable in the run() body.
Returns:
Runnable implementation.

createCallableClass

public static org.fuin.srcgen4javassist.SgClass createCallableClass(org.fuin.srcgen4javassist.SgClassPool pool,
                                                                    org.fuin.srcgen4javassist.ByteCodeGenerator generator,
                                                                    org.fuin.srcgen4javassist.factory.VarListImplementationFactory varListFactory,
                                                                    org.fuin.srcgen4javassist.SgVariable var,
                                                                    Class<?> intf,
                                                                    org.fuin.srcgen4javassist.SgMethod method)
Creates a class that implements Runnable that calls a given method. The implementation is created inside the same package as the class that owns the method that is called.

Parameters:
pool - Class pool.
generator - Byte code generator.
varListFactory - Helper factory.
var - Name and type of the variable.
intf - Interface the created method belongs to.
method - Method to call on the variable in the run() body.
Returns:
Runnable implementation.

createEDTGetterClass

public static org.fuin.srcgen4javassist.SgClass createEDTGetterClass(org.fuin.srcgen4javassist.SgClassPool pool,
                                                                     org.fuin.srcgen4javassist.ByteCodeGenerator generator,
                                                                     org.fuin.srcgen4javassist.factory.VarListImplementationFactory varListFactory,
                                                                     org.fuin.srcgen4javassist.SgVariable var,
                                                                     org.fuin.srcgen4javassist.SgMethod method)
Creates a class that implements EDTGetter that calls a given method. The implementation is created inside the same package as the class that owns the method that is called.

Parameters:
pool - Class pool.
generator - Byte code generator.
varListFactory - Helper factory.
var - Name and type of the variable.
method - Method to call on the variable in the get() body.
Returns:
Runnable implementation.

writeToFile

public static void writeToFile(File file,
                               String text)
Writes the given text to a file. An existing file will be overwritten.

Parameters:
file - File to write to.
text - Text to save.


Copyright © 2011 Future Invent Informationsmanagement GmbH. All Rights Reserved.