|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttw.net.ocs.OCSInterfaceFactory
public class OCSInterfaceFactory
Generates code for interfaces derived from existing classes.
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 |
---|
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!
c
- the class for which an interface shall be generatedprefix
- prepend this to make the new interface's namepostfix
- append this to make the new interface's namepackag
- the package which the interface should be made a part ofdirectory
- directory below which to place the package directoriesmain(java.lang.String[])
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!
c
- the class for which an interface shall be generatedgenerateInterfaceForClass(Class,java.lang.String,java.lang.String,java.lang.String,java.lang.String)
,
main(java.lang.String[])
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
generateInterfaceForClass(java.lang.Class, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |