Browse Source

checkstyle: mostly javadoc

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277954 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
18ed2ffdff
5 changed files with 55 additions and 13 deletions
  1. +6
    -3
      src/main/org/apache/tools/ant/types/Permissions.java
  2. +2
    -3
      src/main/org/apache/tools/ant/types/RedirectorElement.java
  3. +12
    -2
      src/main/org/apache/tools/ant/types/Substitution.java
  4. +33
    -3
      src/main/org/apache/tools/ant/types/ZipFileSet.java
  5. +2
    -2
      src/main/org/apache/tools/ant/types/ZipScanner.java

+ 6
- 3
src/main/org/apache/tools/ant/types/Permissions.java View File

@@ -1,5 +1,5 @@
/*
* Copyright 2003-2004 The Apache Software Foundation
* Copyright 2003-2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -86,6 +86,7 @@ public class Permissions {
* subject to these Permissions. Note that setting the SecurityManager too early may
* prevent your part from starting, as for instance changing classloaders may be prohibited.
* The classloader for the new situation is supposed to be present.
* @throws BuildException on error
*/
public void setSecurityManager() throws BuildException {
origSm = System.getSecurityManager();
@@ -110,7 +111,8 @@ public class Permissions {
if (p.getClassName() == null) {
throw new BuildException("Granted permission " + p + " does not contain a class.");
} else {
java.security.Permission perm = new UnresolvedPermission(p.getClassName(), p.getName(), p.getActions(), null);
java.security.Permission perm =
new UnresolvedPermission(p.getClassName(), p.getName(), p.getActions(), null);
granted.add(perm);
}
}
@@ -153,7 +155,8 @@ public class Permissions {
private class MySM extends SecurityManager {

/**
* Exit is treated in a special way in order to be able to return the exit code towards tasks.
* Exit is treated in a special way in order to be able to return the exit code
* towards tasks.
* An ExitException is thrown instead of a simple SecurityException to indicate the exit
* code.
* Overridden from java.lang.SecurityManager


+ 2
- 3
src/main/org/apache/tools/ant/types/RedirectorElement.java View File

@@ -20,11 +20,8 @@ import java.io.File;
import java.util.Vector;
import java.util.ArrayList;

import org.apache.tools.ant.Task;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.taskdefs.Redirector;
import org.apache.tools.ant.types.DataType;

/**
* Element representation of a <CODE>Redirector</CODE>.
@@ -163,6 +160,8 @@ public class RedirectorElement extends DataType {
*
* <p>You must not set another attribute or nest elements inside
* this element if you make it a reference.</p>
* @param r the reference to use
* @throws BuildException on error
*/
public void setRefid(Reference r) throws BuildException {
if (usingInput


+ 12
- 2
src/main/org/apache/tools/ant/types/Substitution.java View File

@@ -1,5 +1,5 @@
/*
* Copyright 2001-2002,2004 The Apache Software Foundation
* Copyright 2001-2002,2004-2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,10 +38,15 @@ public class Substitution extends DataType {

private String expression;

/** Constructor for Substitution. */
public Substitution() {
this.expression = null;
}

/**
* Set the pattern string for this regular expression substitution.
* @param expression the regular expression to use
*/
public void setExpression(String expression) {
this.expression = expression;
}
@@ -49,6 +54,9 @@ public class Substitution extends DataType {
/***
* Gets the pattern string for this RegularExpression in the
* given project.
* @param p the project to look for the regular expression if this object is
* a reference
* @return the pattern string
*/
public String getExpression(Project p) {
if (isReference()) {
@@ -60,7 +68,9 @@ public class Substitution extends DataType {

/***
* Get the RegularExpression this reference refers to in
* the given project. Check for circular references too
* the given project. Check for circular references too.
* @param p the project to look for the regular expression reference
* @return the resolved reference
*/
public Substitution getRef(Project p) {
if (!isChecked()) {


+ 33
- 3
src/main/org/apache/tools/ant/types/ZipFileSet.java View File

@@ -1,5 +1,5 @@
/*
* Copyright 2001-2004 The Apache Software Foundation
* Copyright 2001-2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -62,14 +62,23 @@ public class ZipFileSet extends FileSet {
private boolean fileModeHasBeenSet = false;
private boolean dirModeHasBeenSet = false;

/** Constructor for ZipFileSet */
public ZipFileSet() {
super();
}

/**
* Constructor using a fileset arguement.
* @param fileset the fileset to use
*/
protected ZipFileSet(FileSet fileset) {
super(fileset);
}

/**
* Constructor using a zipfileset arguement.
* @param fileset the zipfileset to use
*/
protected ZipFileSet(ZipFileSet fileset) {
super(fileset);
srcFile = fileset.srcFile;
@@ -85,6 +94,8 @@ public class ZipFileSet extends FileSet {
/**
* Set the directory for the fileset. Prevents both "dir" and "src"
* from being specified.
* @param dir the directory for the fileset
* @throws BuildException on error
*/
public void setDir(File dir) throws BuildException {
if (isReference()) {
@@ -118,6 +129,8 @@ public class ZipFileSet extends FileSet {
* Get the zip file from which entries will be extracted.
* References are not followed, since it is not possible
* to have a reference to a ZipFileSet, only to a FileSet.
* @param p the project to use
* @return the source file
*/
public File getSrc(Project p) {
if (isReference()) {
@@ -141,6 +154,8 @@ public class ZipFileSet extends FileSet {

/**
* Return the prefix prepended to entries in the zip file.
* @param p the project to use
* @return the prefix
*/
public String getPrefix(Project p) {
if (isReference()) {
@@ -164,6 +179,8 @@ public class ZipFileSet extends FileSet {

/**
* Return the full pathname of the single entry in this fileset.
* @param p the project to use
* @return the full path
*/
public String getFullpath(Project p) {
if (isReference()) {
@@ -176,6 +193,8 @@ public class ZipFileSet extends FileSet {
* Return the DirectoryScanner associated with this FileSet.
* If the ZipFileSet defines a source Zip file, then a ZipScanner
* is returned instead.
* @param p the project to use
* @return a directory scanner
*/
public DirectoryScanner getDirectoryScanner(Project p) {
if (isReference()) {
@@ -197,7 +216,7 @@ public class ZipFileSet extends FileSet {
* A 3 digit octal string, specify the user, group and
* other modes in the standard Unix fashion;
* optional, default=0644
*
* @param octalString a <code>String</code> value
* @since Ant 1.5.2
*/
public void setFileMode(String octalString) {
@@ -207,6 +226,9 @@ public class ZipFileSet extends FileSet {
}

/**
* Get the mode of the zip fileset
* @param p the project to use
* @return the mode
* @since Ant 1.5.2
*/
public int getFileMode(Project p) {
@@ -218,7 +240,7 @@ public class ZipFileSet extends FileSet {

/**
* Whether the user has specified the mode explicitly.
*
* @return true if it has been set
* @since Ant 1.6
*/
public boolean hasFileModeBeenSet() {
@@ -232,6 +254,7 @@ public class ZipFileSet extends FileSet {
* A 3 digit octal string, specify the user, group and
* other modes in the standard Unix fashion;
* optional, default=0755
* @param octalString a <code>String</code> value
*
* @since Ant 1.5.2
*/
@@ -242,6 +265,9 @@ public class ZipFileSet extends FileSet {
}

/**
* Get the dir mode of the zip fileset
* @param p the project to use
* @return the mode
* @since Ant 1.5.2
*/
public int getDirMode(Project p) {
@@ -254,6 +280,7 @@ public class ZipFileSet extends FileSet {
/**
* Whether the user has specified the mode explicitly.
*
* @return true if it has been set
* @since Ant 1.6
*/
public boolean hasDirModeBeenSet() {
@@ -266,6 +293,8 @@ public class ZipFileSet extends FileSet {
/**
* A ZipFileset accepts another ZipFileSet or a FileSet as reference
* FileSets are often used by the war task for the lib attribute
* @param p the project to use
* @return the abstract fileset instance
*/
protected AbstractFileSet getRef(Project p) {
if (!isChecked()) {
@@ -293,6 +322,7 @@ public class ZipFileSet extends FileSet {
/**
* Return a ZipFileSet that has the same properties
* as this one.
* @return the cloned zipFileSet
* @since Ant 1.6
*/
public Object clone() {


+ 2
- 2
src/main/org/apache/tools/ant/types/ZipScanner.java View File

@@ -72,7 +72,7 @@ public class ZipScanner extends DirectoryScanner {

/**
* Sets encoding of file names.
*
* @param encoding the encoding format
* @since Ant 1.6
*/
public void setEncoding(String encoding) {
@@ -166,7 +166,7 @@ public class ZipScanner extends DirectoryScanner {

/**
* @param name path name of the file sought in the archive
*
* @return the resource
* @since Ant 1.5.2
*/
public Resource getResource(String name) {


Loading…
Cancel
Save