Browse Source

javadoc

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277948 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
738fa82f09
4 changed files with 68 additions and 6 deletions
  1. +3
    -0
      src/main/org/apache/tools/ant/taskdefs/condition/IsSigned.java
  2. +21
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java
  3. +22
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
  4. +22
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/Test.java

+ 3
- 0
src/main/org/apache/tools/ant/taskdefs/condition/IsSigned.java View File

@@ -61,7 +61,10 @@ public class IsSigned extends DataType implements Condition {
* Returns <code>true</code> if the file exists and is signed with * Returns <code>true</code> if the file exists and is signed with
* the signature specified, or, if <code>name</code> wasn't * the signature specified, or, if <code>name</code> wasn't
* specified, if the file contains a signature. * specified, if the file contains a signature.
* @param zipFile the zipfile to check
* @param name the signature to check (may be killed)
* @return true if the file is signed. * @return true if the file is signed.
* @throws IOException on error
*/ */
public static boolean isSigned(File zipFile, String name) public static boolean isSigned(File zipFile, String name)
throws IOException { throws IOException {


+ 21
- 0
src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java View File

@@ -86,6 +86,7 @@ public class ANTLR extends Task {
/** Instance of a utility class to use for file operations. */ /** Instance of a utility class to use for file operations. */
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();


/** Constructor for ANTLR task. */
public ANTLR() { public ANTLR() {
commandline.setVm(JavaEnvUtils.getJreExecutable("java")); commandline.setVm(JavaEnvUtils.getJreExecutable("java"));
commandline.setClassname("antlr.Tool"); commandline.setClassname("antlr.Tool");
@@ -93,6 +94,7 @@ public class ANTLR extends Task {


/** /**
* The grammar file to process. * The grammar file to process.
* @param target the gramer file
*/ */
public void setTarget(File target) { public void setTarget(File target) {
log("Setting target to: " + target.toString(), Project.MSG_VERBOSE); log("Setting target to: " + target.toString(), Project.MSG_VERBOSE);
@@ -101,6 +103,7 @@ public class ANTLR extends Task {


/** /**
* The directory to write the generated files to. * The directory to write the generated files to.
* @param outputDirectory the output directory
*/ */
public void setOutputdirectory(File outputDirectory) { public void setOutputdirectory(File outputDirectory) {
log("Setting output directory to: " + outputDirectory.toString(), Project.MSG_VERBOSE); log("Setting output directory to: " + outputDirectory.toString(), Project.MSG_VERBOSE);
@@ -110,6 +113,7 @@ public class ANTLR extends Task {
/** /**
* Sets an optional super grammar file. * Sets an optional super grammar file.
* Use setGlib(File superGrammar) instead. * Use setGlib(File superGrammar) instead.
* @param superGrammar the super grammar filename
* @deprecated since ant 1.6 * @deprecated since ant 1.6
*/ */
public void setGlib(String superGrammar) { public void setGlib(String superGrammar) {
@@ -123,6 +127,7 @@ public class ANTLR extends Task {
} }
/** /**
* Sets an optional super grammar file * Sets an optional super grammar file
* @param superGrammar the super grammar file
* @since ant 1.6 * @since ant 1.6
*/ */
public void setGlib(File superGrammar) { public void setGlib(File superGrammar) {
@@ -130,6 +135,7 @@ public class ANTLR extends Task {
} }
/** /**
* Sets a flag to enable ParseView debugging * Sets a flag to enable ParseView debugging
* @param enable a <code>boolean</code> value
*/ */
public void setDebug(boolean enable) { public void setDebug(boolean enable) {
this.debug = enable; this.debug = enable;
@@ -137,6 +143,7 @@ public class ANTLR extends Task {


/** /**
* If true, emit html * If true, emit html
* @param enable a <code>boolean</code> value
*/ */
public void setHtml(boolean enable) { public void setHtml(boolean enable) {
html = enable; html = enable;
@@ -144,6 +151,7 @@ public class ANTLR extends Task {


/** /**
* Sets a flag to emit diagnostic text * Sets a flag to emit diagnostic text
* @param enable a <code>boolean</code> value
*/ */
public void setDiagnostic(boolean enable) { public void setDiagnostic(boolean enable) {
diagnostic = enable; diagnostic = enable;
@@ -151,6 +159,7 @@ public class ANTLR extends Task {


/** /**
* If true, enables all tracing. * If true, enables all tracing.
* @param enable a <code>boolean</code> value
*/ */
public void setTrace(boolean enable) { public void setTrace(boolean enable) {
trace = enable; trace = enable;
@@ -158,6 +167,7 @@ public class ANTLR extends Task {


/** /**
* If true, enables parser tracing. * If true, enables parser tracing.
* @param enable a <code>boolean</code> value
*/ */
public void setTraceParser(boolean enable) { public void setTraceParser(boolean enable) {
traceParser = enable; traceParser = enable;
@@ -165,6 +175,7 @@ public class ANTLR extends Task {


/** /**
* If true, enables lexer tracing. * If true, enables lexer tracing.
* @param enable a <code>boolean</code> value
*/ */
public void setTraceLexer(boolean enable) { public void setTraceLexer(boolean enable) {
traceLexer = enable; traceLexer = enable;
@@ -172,6 +183,7 @@ public class ANTLR extends Task {


/** /**
* Sets a flag to allow the user to enable tree walker tracing * Sets a flag to allow the user to enable tree walker tracing
* @param enable a <code>boolean</code> value
*/ */
public void setTraceTreeWalker(boolean enable) { public void setTraceTreeWalker(boolean enable) {
traceTreeWalker = enable; traceTreeWalker = enable;
@@ -183,6 +195,7 @@ public class ANTLR extends Task {
// I'm not removing this method to keep backward compatibility // I'm not removing this method to keep backward compatibility
/** /**
* @ant.attribute ignore="true" * @ant.attribute ignore="true"
* @param s a <code>boolean</code> value
*/ */
public void setFork(boolean s) { public void setFork(boolean s) {
//this.fork = s; //this.fork = s;
@@ -190,6 +203,7 @@ public class ANTLR extends Task {


/** /**
* The working directory of the process * The working directory of the process
* @param d the working directory
*/ */
public void setDir(File d) { public void setDir(File d) {
this.workingdir = d; this.workingdir = d;
@@ -198,6 +212,7 @@ public class ANTLR extends Task {
/** /**
* Adds a classpath to be set * Adds a classpath to be set
* because a directory might be given for Antlr debug. * because a directory might be given for Antlr debug.
* @return a path to be configured
*/ */
public Path createClasspath() { public Path createClasspath() {
return commandline.createClasspath(getProject()).createPath(); return commandline.createClasspath(getProject()).createPath();
@@ -216,6 +231,7 @@ public class ANTLR extends Task {
* Adds the jars or directories containing Antlr * Adds the jars or directories containing Antlr
* this should make the forked JVM work without having to * this should make the forked JVM work without having to
* specify it directly. * specify it directly.
* @throws BuildException on error
*/ */
public void init() throws BuildException { public void init() throws BuildException {
addClasspathEntry("/antlr/ANTLRGrammarParseBehavior.class"); addClasspathEntry("/antlr/ANTLRGrammarParseBehavior.class");
@@ -227,6 +243,7 @@ public class ANTLR extends Task {
* *
* <p>Doesn't work for archives in JDK 1.1 as the URL returned by * <p>Doesn't work for archives in JDK 1.1 as the URL returned by
* getResource doesn't contain the name of the archive.</p> * getResource doesn't contain the name of the archive.</p>
* @param resource the resource name to search for
*/ */
protected void addClasspathEntry(String resource) { protected void addClasspathEntry(String resource) {
/* /*
@@ -255,6 +272,10 @@ public class ANTLR extends Task {
} }
} }


/**
* Execute the task.
* @throws BuildException on error
*/
public void execute() throws BuildException { public void execute() throws BuildException {
validateAttributes(); validateAttributes();




+ 22
- 4
src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java View File

@@ -177,20 +177,31 @@ public class EchoProperties extends Task {


/** /**
* A set of properties to write. * A set of properties to write.
*
* @param ps the property set to write
* @since Ant 1.6 * @since Ant 1.6
*/ */
public void addPropertyset(PropertySet ps) { public void addPropertyset(PropertySet ps) {
propertySets.addElement(ps); propertySets.addElement(ps);
} }


/**
* Set the output format - xml or text.
* @param ea an enumerated <code>FormatAttribute</code> value
*/
public void setFormat(FormatAttribute ea) { public void setFormat(FormatAttribute ea) {
format = ea.getValue(); format = ea.getValue();
} }


/**
* A enumerated type for the format attribute.
* The values are "xml" and "text".
*/
public static class FormatAttribute extends EnumeratedAttribute { public static class FormatAttribute extends EnumeratedAttribute {
private String [] formats = new String[]{"xml", "text"}; private String [] formats = new String[]{"xml", "text"};


/**
* @see EnumeratedAttribute#getValues()
*/
public String[] getValues() { public String[] getValues() {
return formats; return formats;
} }
@@ -320,9 +331,10 @@ public class EchoProperties extends Task {
* sent to the output stream. * sent to the output stream.
* The output stream will be closed when this method returns. * The output stream will be closed when this method returns.
* *
*@param allProps propfile to save
*@param os output stream
*@exception IOException trouble
* @param allProps propfile to save
* @param os output stream
* @throws IOException on output errors
* @throws BuildException on other errors
*/ */
protected void saveProperties(Hashtable allProps, OutputStream os) protected void saveProperties(Hashtable allProps, OutputStream os)
throws IOException, BuildException { throws IOException, BuildException {
@@ -383,6 +395,12 @@ public class EchoProperties extends Task {
return sorted; return sorted;
} }


/**
* Output the properties as xml output.
* @param props the properties to save
* @param os the output stream to write to (Note this gets closed)
* @throws IOException on error in writing to the stream
*/
protected void xmlSaveProperties(Properties props, protected void xmlSaveProperties(Properties props,
OutputStream os) throws IOException { OutputStream os) throws IOException {
// create XML document // create XML document


+ 22
- 2
src/main/org/apache/tools/ant/taskdefs/optional/Test.java View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2000,2002-2004 The Apache Software Foundation
* Copyright 2000,2002-2005 The Apache Software Foundation
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -42,18 +42,26 @@ public class Test extends Java {
protected String m_testname = ""; protected String m_testname = "";




/** name of test. No property expansion takes place here */
/**
* name of test. No property expansion takes place here
* @param testname the test name
*/
public void addText(final String testname) { public void addText(final String testname) {
m_testname += testname; m_testname += testname;
} }




/**
* Get the test name
* @return the test name
*/
public String toString() { public String toString() {
return m_testname; return m_testname;
} }
} }




/** Constructor for the Test task. */
public Test() { public Test() {
setClassname("org.apache.testlet.engine.TextTestEngine"); setClassname("org.apache.testlet.engine.TextTestEngine");
} }
@@ -61,6 +69,7 @@ public class Test extends Java {


/** /**
* add a declaration of a testlet to run * add a declaration of a testlet to run
* @return a <code>TestletEntry</code> to configure
*/ */
public TestletEntry createTestlet() { public TestletEntry createTestlet() {
final TestletEntry entry = new TestletEntry(); final TestletEntry entry = new TestletEntry();
@@ -73,6 +82,7 @@ public class Test extends Java {
/** /**
* a boolean value indicating whether tests should display a * a boolean value indicating whether tests should display a
* message on success; optional * message on success; optional
* @param showSuccess a <code>boolean</code> value
*/ */


public void setShowSuccess(final boolean showSuccess) { public void setShowSuccess(final boolean showSuccess) {
@@ -83,6 +93,7 @@ public class Test extends Java {
/** /**
* a boolean value indicating whether a banner should be displayed * a boolean value indicating whether a banner should be displayed
* when starting testlet engine; optional. * when starting testlet engine; optional.
* @param showBanner a <code>String</code> value
*/ */
public void setShowBanner(final String showBanner) { public void setShowBanner(final String showBanner) {
createArg().setValue("-b=" + showBanner); createArg().setValue("-b=" + showBanner);
@@ -92,17 +103,26 @@ public class Test extends Java {
/** /**
* a boolean indicating that a stack trace is displayed on * a boolean indicating that a stack trace is displayed on
* error (but not normal failure); optional. * error (but not normal failure); optional.
* @param showTrace a <code>boolean</code> value
*/ */
public void setShowTrace(final boolean showTrace) { public void setShowTrace(final boolean showTrace) {
createArg().setValue("-t=" + showTrace); createArg().setValue("-t=" + showTrace);
} }




/**
* a boolean indicating that a stack trace is to be displayed always.
* @param forceShowTrace a <code>boolean</code> value
*/
public void setForceShowTrace(final boolean forceShowTrace) { public void setForceShowTrace(final boolean forceShowTrace) {
createArg().setValue("-f=" + forceShowTrace); createArg().setValue("-f=" + forceShowTrace);
} }




/**
* Execute the task.
* @throws BuildException on error
*/
public void execute() public void execute()
throws BuildException { throws BuildException {




Loading…
Cancel
Save