tw.net.ocs
Class OCSInterfaceFactory

java.lang.Object
  extended by tw.net.ocs.OCSInterfaceFactory

public class OCSInterfaceFactory
extends java.lang.Object

Generates code for interfaces derived from existing classes.
        

Author:
Tillmann Wegst

Method Summary
static void generateInterfaceForClass(java.lang.Class c)
           Generates the source code for a new interface which declares all the public methods of an existing class.
static void generateInterfaceForClass(java.lang.Class c, java.lang.String prefix, java.lang.String postfix, java.lang.String packag, java.lang.String directory)
           Generates the source code for a new interface which declares all the public methods of an existing class.
static void main(java.lang.String[] args)
           Generates the source code for a new interface which declares all the public methods of an existing class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

generateInterfaceForClass

public static void generateInterfaceForClass(java.lang.Class c,
                                             java.lang.String prefix,
                                             java.lang.String postfix,
                                             java.lang.String packag,
                                             java.lang.String directory)
Generates the source code for a new interface which declares
all the public methods of an existing class.

The name of the interface is derived from the qualified
name of the class, like this:
        the package directory names are capitalized,
        the dots are removed, and
        if nothing else is specified "IF" is appended to the name
Example:
If the class is "java.io.File" the generated interface
will be named "JavaIoFileIF".

Optionally a prefix and or a postfix can be specified for the name,
overriding the default "IF"-postfix.

Use parameter "package" to specify the package which
the interface should be placed in.

Use parameter "directory" to specify the directory relative to which
the package will be placed in your file system. If no directory is
specified, the current directory (".") is assumed.

Note that you can execute this function conveniently from
the command-line!
See main() or run "java tw.net.ocs.OCSInterfaceProxyFactory" for
usage information!
                

Parameters:
c - the class for which an interface shall be generated
prefix - prepend this to make the new interface's name
postfix - append this to make the new interface's name
packag - the package which the interface should be made a part of
directory - directory below which to place the package directories
See Also:
main(java.lang.String[])

generateInterfaceForClass

public static void generateInterfaceForClass(java.lang.Class c)
Generates the source code for a new interface which declares
all the public methods of an existing class.

The name of the interface is derived from the qualified
name of the class, like this:
        the package directory names are capitalized,
        the dots are removed, and
        "IF" is appended to the name
Example:
If the class is "java.io.File" the generated interface
will be named "JavaIoFileIF".

The interface is placed in the default package,
the source file is written to the current directory.

Note that you can execute this function conveniently from
the command-line!
See main() or run "java tw.net.ocs.OCSInterfaceProxyFactory" for
usage information!
                

Parameters:
c - the class for which an interface shall be generated
See Also:
generateInterfaceForClass(Class,java.lang.String,java.lang.String,java.lang.String,java.lang.String), main(java.lang.String[])

main

public static void main(java.lang.String[] args)
Generates the source code for a new interface which declares
all the public methods of an existing class.

The name of the interface is derived from the qualified
name of the class, like this:
        the package directory names are capitalized,
        the dots are removed, and
        if nothing else is specified "IF" is appended to the name.
If, e.g., the class is "java.io.File" the generated interface
will be named "JavaIoFileIF".

Optionally a prefix and or a postfix can be specified for the name,
overriding the default "IF"-postfix.

Use parameter "package" to specify the package which
the interface should be placed in.

Use parameter "directory" to specify the directory relative to which
the package will be placed in your file system. If no directory is
specified, the current directory is assumed.

Usage:
        java tw.net.ocs.OCSInterfaceProxyFactory -class {parameters...}

        -class      Qualified name of a class, e.g. java.io.File
        -prefix     Prepend this to the new interface's name
        -postfix    Append this to the new interface's name
        -package    Put the interface into this package
        -directory  Put the interface file (its package path, i.e.) here
                

See Also:
generateInterfaceForClass(java.lang.Class, java.lang.String, java.lang.String, java.lang.String, java.lang.String)


OCSelot @ www.ocselot.net www.ocselot.net