peterreilly 2004/12/03 06:16:39 Modified: src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH Rmic.java Log: sync Revision Changes Path No revision No revision 1.51.2.5 +90 -29 ant/src/main/org/apache/tools/ant/taskdefs/Rmic.java Index: Rmic.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Rmic.java,v retrieving revision 1.51.2.4 retrieving revision 1.51.2.5 diff -u -r1.51.2.4 -r1.51.2.5 --- Rmic.java 9 Mar 2004 17:01:34 -0000 1.51.2.4 +++ Rmic.java 3 Dec 2004 14:16:39 -0000 1.51.2.5 @@ -72,7 +72,6 @@ * project contains a compiler implementation for this task as well, * please consult miniRMI's documentation to learn how to use it.</p> * - * * @since Ant 1.1 * * @ant.task category="java" @@ -88,14 +87,14 @@ private File sourceBase; private String stubVersion; private Path compileClasspath; - private Path extdirs; + private Path extDirs; private boolean verify = false; private boolean filtering = false; private boolean iiop = false; - private String iiopopts; + private String iiopOpts; private boolean idl = false; - private String idlopts; + private String idlOpts; private boolean debug = false; private boolean includeAntRuntime = true; private boolean includeJavaRuntime = false; @@ -108,6 +107,9 @@ private FacadeTaskHelper facade; + /** + * Constructor for Rmic. + */ public Rmic() { try { Class.forName("kaffe.rmi.rmic.RMIC"); @@ -119,6 +121,7 @@ /** * Sets the location to store the compiled files; required + * @param base the location to store the compiled files */ public void setBase(File base) { this.baseDir = base; @@ -126,6 +129,7 @@ /** * Gets the base directory to output generated class. + * @return the location of the compiled files */ public File getBase() { @@ -135,6 +139,7 @@ /** * Sets the class to run <code>rmic</code> against; * optional + * @param classname the name of the class for rmic to create code for */ public void setClassname(String classname) { this.classname = classname; @@ -142,6 +147,7 @@ /** * Gets the class name to compile. + * @return the name of the class to compile */ public String getClassname() { return classname; @@ -149,6 +155,7 @@ /** * optional directory to save generated source files to. + * @param sourceBase the directory to save source files to. */ public void setSourceBase(File sourceBase) { this.sourceBase = sourceBase; @@ -156,6 +163,7 @@ /** * Gets the source dirs to find the source java files. + * @return sourceBase the directory containing the source files. */ public File getSourceBase() { return sourceBase; @@ -164,30 +172,40 @@ /** * Specify the JDK version for the generated stub code. * Specify "1.1" to pass the "-v1.1" option to rmic.</td> + * @param stubVersion the JDK version */ public void setStubVersion(String stubVersion) { this.stubVersion = stubVersion; } + /** + * Gets the JDK version for the generated stub code. + * @return stubVersion + */ public String getStubVersion() { return stubVersion; } /** - * indicates whether token filtering should take place; - * optional, default=false + * Sets token filtering [optional], default=false + * @param filter turn on token filtering */ public void setFiltering(boolean filter) { - filtering = filter; + this.filtering = filter; } + /** + * Gets whether token filtering is set + * @return filtering + */ public boolean getFiltering() { return filtering; } /** - * generate debug info (passes -g to rmic); + * Generate debug info (passes -g to rmic); * optional, defaults to false + * @param debug turn on debug info */ public void setDebug(boolean debug) { this.debug = debug; @@ -195,6 +213,7 @@ /** * Gets the debug flag. + * @return debug */ public boolean getDebug() { return debug; @@ -202,6 +221,7 @@ /** * Set the classpath to be used for this compilation. + * @param classpath the classpath used for this compilation */ public void setClasspath(Path classpath) { if (compileClasspath == null) { @@ -213,6 +233,7 @@ /** * Creates a nested classpath element. + * @return classpath */ public Path createClasspath() { if (compileClasspath == null) { @@ -224,13 +245,15 @@ /** * Adds to the classpath a reference to * a <path> defined elsewhere. + * @param pathRef the reference to add to the classpath */ - public void setClasspathRef(Reference r) { - createClasspath().setRefid(r); + public void setClasspathRef(Reference pathRef) { + createClasspath().setRefid(pathRef); } /** * Gets the classpath. + * @return the classpath */ public Path getClasspath() { return compileClasspath; @@ -240,14 +263,18 @@ * Flag to enable verification so that the classes * found by the directory match are * checked to see if they implement java.rmi.Remote. - * Optional; his defaults to false if not set. + * optional; This defaults to false if not set. + * @param verify turn on verification for classes */ public void setVerify(boolean verify) { this.verify = verify; } - /** Get verify flag. */ + /** + * Get verify flag. + * @return verify + */ public boolean getVerify() { return verify; } @@ -256,6 +283,7 @@ * Indicates that IIOP compatible stubs should * be generated; optional, defaults to false * if not set. + * @param iiop generate IIOP compatible stubs */ public void setIiop(boolean iiop) { this.iiop = iiop; @@ -263,6 +291,7 @@ /** * Gets iiop flags. + * @return iiop */ public boolean getIiop() { return iiop; @@ -270,22 +299,25 @@ /** * Set additional arguments for iiop + * @param iiopOpts additional arguments for iiop */ - public void setIiopopts(String iiopopts) { - this.iiopopts = iiopopts; + public void setIiopopts(String iiopOpts) { + this.iiopOpts = iiopOpts; } /** * Gets additional arguments for iiop. + * @return iiopOpts */ public String getIiopopts() { - return iiopopts; + return iiopOpts; } /** * Indicates that IDL output should be * generated. This defaults to false * if not set. + * @param idl generate IDL output */ public void setIdl(boolean idl) { this.idl = idl; @@ -293,27 +325,31 @@ /** * Gets IDL flags. + * @return the idl flag */ public boolean getIdl() { return idl; } /** - * pass additional arguments for idl compile + * pass additional arguments for IDL compile + * @param idlOpts additional IDL arguments */ - public void setIdlopts(String idlopts) { - this.idlopts = idlopts; + public void setIdlopts(String idlOpts) { + this.idlOpts = idlOpts; } /** * Gets additional arguments for idl compile. + * @return the idl options */ public String getIdlopts() { - return idlopts; + return idlOpts; } /** * Gets file list to compile. + * @return the list of files to compile. */ public Vector getFileList() { return compileList; @@ -323,6 +359,7 @@ * Sets whether or not to include ant's own classpath in this task's * classpath. * Optional; default is <code>true</code>. + * @param include if true include ant's classpath */ public void setIncludeantruntime(boolean include) { includeAntRuntime = include; @@ -331,6 +368,7 @@ /** * Gets whether or not the ant classpath is to be included in the * task's classpath. + * @return true if ant's classpath is to be included */ public boolean getIncludeantruntime() { return includeAntRuntime; @@ -341,6 +379,7 @@ * Enables or disables including the default run-time * libraries from the executing VM; optional, * defaults to false + * @param include if true include default run-time libraries */ public void setIncludejavaruntime(boolean include) { includeJavaRuntime = include; @@ -349,6 +388,7 @@ /** * Gets whether or not the java runtime should be included in this * task's classpath. + * @return true if default run-time libraries are included */ public boolean getIncludejavaruntime() { return includeJavaRuntime; @@ -357,33 +397,39 @@ /** * Sets the extension directories that will be used during the * compilation; optional. + * @param extDirs the extension directories to be used */ - public void setExtdirs(Path extdirs) { - if (this.extdirs == null) { - this.extdirs = extdirs; + public void setExtdirs(Path extDirs) { + if (this.extDirs == null) { + this.extDirs = extDirs; } else { - this.extdirs.append(extdirs); + this.extDirs.append(extDirs); } } /** * Maybe creates a nested extdirs element. + * @return path object to be configured with the extension directories */ public Path createExtdirs() { - if (extdirs == null) { - extdirs = new Path(getProject()); + if (extDirs == null) { + extDirs = new Path(getProject()); } - return extdirs.createPath(); + return extDirs.createPath(); } /** * Gets the extension directories that will be used during the * compilation. + * @return the extension directories to be used */ public Path getExtdirs() { - return extdirs; + return extDirs; } + /** + * @return the compile list. + */ public Vector getCompileList() { return compileList; } @@ -392,14 +438,18 @@ * Sets the compiler implementation to use; optional, * defaults to the value of the <code>build.rmic</code> property, * or failing that, default compiler for the current VM + * @param compiler the compiler implemention to use * @since Ant 1.5 */ public void setCompiler(String compiler) { - facade.setImplementation(compiler); + if (compiler.length() > 0) { + facade.setImplementation(compiler); + } } /** * get the name of the current compiler + * @return the name of the compiler * @since Ant 1.5 */ public String getCompiler() { @@ -409,6 +459,7 @@ /** * Adds an implementation specific command line argument. + * @return an object to be configured with a command line argument * @since Ant 1.5 */ public ImplementationSpecificArgument createCompilerArg() { @@ -560,6 +611,9 @@ /** * Scans the directory looking for class files to be compiled. * The result is returned in the class variable compileList. + * @param baseDir the base direction + * @param files the list of files to scan + * @param mapper the mapper of files to target files */ protected void scanDir(File baseDir, String[] files, FileNameMapper mapper) { @@ -569,7 +623,7 @@ log("will leave uptodate test to rmic implementation in idl mode.", Project.MSG_VERBOSE); } else if (iiop - && iiopopts != null && iiopopts.indexOf("-always") > -1) { + && iiopOpts != null && iiopOpts.indexOf("-always") > -1) { log("no uptodate test as -always option has been specified", Project.MSG_VERBOSE); } else { @@ -586,6 +640,8 @@ /** * Load named class and test whether it can be rmic'ed + * @param classname the name of the class to be tested + * @return true if the class can be rmic'ed */ public boolean isValidRmiRemote(String classname) { try { @@ -613,6 +669,9 @@ /** * Returns the topmost interface that extends Remote for a given * class - if one exists. + * @param testClass the class to be tested + * @return the topmost interface that extends Remote, or null if there + * is none. */ public Class getRemoteInterface(Class testClass) { if (Remote.class.isAssignableFrom(testClass)) { @@ -638,6 +697,7 @@ /** * Classloader for the user-specified classpath. + * @return the classloader */ public ClassLoader getLoader() { return loader; @@ -657,6 +717,7 @@ * value of this attribute. Legal values are * the same as those in the above list of * valid compilers.) + * @param impl the compiler to be used. */ public void setCompiler(String impl) { super.setImplementation(impl);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]