net.spy.util
Class SPGen

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.util.SPGen

public class SPGen
extends SpyObject

Generator for .spt->.java.


Constructor Summary
SPGen(java.lang.String cn, java.io.BufferedReader i, java.io.PrintWriter o)
          Get a new SPGen from the given BufferedReader.
 
Method Summary
 void addInterface(java.lang.String intf)
          Add an interface to the implements line.
 void addInterfaces(java.util.Collection<java.lang.String> set)
          Add a collection of interfaces.
 void generate()
          Perform the actual generation.
static boolean isValidJDBCType(java.lang.String name)
          Return true if this is a valid JDBC type.
static void main(java.lang.String[] argv)
          Usage: SPGen filename
 void setDbcpSuperclass(java.lang.String sc)
          Set the DBCP superclass of the generated java class.
 void setDbspSuperclass(java.lang.String sc)
          Set the DBSP superclass of the generated java class.
 void setSuperclass(java.lang.String sc)
          Set the superclass of the generated java class.
 void setVerbose(boolean to)
          Set the verbosity flag.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPGen

public SPGen(java.lang.String cn,
             java.io.BufferedReader i,
             java.io.PrintWriter o)
Get a new SPGen from the given BufferedReader.

Parameters:
cn - the name of the class to generate
i - the stream containing the spt source
o - the stream to which the java code will be written
Method Detail

setVerbose

public void setVerbose(boolean to)
Set the verbosity flag.


setSuperclass

public void setSuperclass(java.lang.String sc)
Set the superclass of the generated java class.


addInterface

public void addInterface(java.lang.String intf)
Add an interface to the implements line.

Parameters:
intf - the fully qualified name of the interface to implement

addInterfaces

public void addInterfaces(java.util.Collection<java.lang.String> set)
Add a collection of interfaces.

Parameters:
set - the set of interfaces

setDbcpSuperclass

public void setDbcpSuperclass(java.lang.String sc)
Set the DBCP superclass of the generated java class.


setDbspSuperclass

public void setDbspSuperclass(java.lang.String sc)
Set the DBSP superclass of the generated java class.


isValidJDBCType

public static boolean isValidJDBCType(java.lang.String name)
Return true if this is a valid JDBC type.

Parameters:
name - the name of the field to test
Returns:
true if the field is valid

generate

public void generate()
              throws java.lang.Exception
Perform the actual generation.

Throws:
java.lang.Exception - if there's a problem parsing or writing

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Usage: SPGen filename

Throws:
java.lang.Exception


Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.