com.darwinsys.util
Class MkAccessors

java.lang.Object
  extended bycom.darwinsys.util.MkAccessors

public class MkAccessors
extends java.lang.Object

MkAccessors is a utility to make a series of Java "accessors" (set/get methods a la JavaBeans pattern). You're probably better off using an IDE!

Primarily meant for command-line use, but can be used from within other tools (note that all methods are static). I use it (with a shell script mkAccessors, which is

java -classpath $HOME/classes/ext/com-darwinsys-all.jar \
        com.darwinsys.util.MkAccessors $* 
or something similar); in the vi or vim editors you just say
:r !mkAccessors firstName lastName address
to generate the setFirstName/getFirstName, etc. methods right in the Java source while you're editing. Your mileage may vary if you use a less-powerful editing tool.

Author:
Ian Darwin, http://www.darwinsys.com/

Method Summary
static void main(java.lang.String[] args)
          make an accessor for each field named in the command line
static void process(java.lang.String fld, java.io.PrintWriter out)
          Generate the set and get methods for field "fld"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(java.lang.String[] args)
make an accessor for each field named in the command line


process

public static void process(java.lang.String fld,
                           java.io.PrintWriter out)
Generate the set and get methods for field "fld"

Parameters:
fld - - the field name
out - - the PrintWriter to print to.


Copyright © 2000-2003 Ian F. Darwin. See license.html for usage license.