JML

org.jmlspecs.ant.tasks
Class AbstractFileSetTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.jmlspecs.ant.tasks.AbstractFileSetTask
Direct Known Subclasses:
CommonOptionsTask

public class AbstractFileSetTask
extends org.apache.tools.ant.Task

An abstract class for creating Tasks that work with Ant filesets. It provides an inner class FileSetVisitor to conveniently apply a certain action on all the files in all the FileSets of an AbstractFileSetTask.

The FileSetVisitor is typically used as follows in a subclass


 new FileSetVisitor() {
   public void visit(File file) {
     //action code
   }
 }.visit();
 

This task works with Ant filesets in order to keep things simple!

Version:
$Revision: 1.3 $
Author:
Marko van Dooren

Class Specifications
private invariant !this._filesets.contains(null);
private invariant ( \forall java.lang.Object o; this._filesets.contains(o); o instanceof org.apache.tools.ant.types.FileSet);

Specifications inherited from class Object
represents objectState <- org.jmlspecs.lang.JMLDataGroup.IT;
public represents _getClass <- \typeof(this);

Nested Class Summary
 class AbstractFileSetTask.FileSetVisitor
           
 
Model Field Summary
 
Model fields inherited from class java.lang.Object
_getClass, objectState, theString
 
Ghost Field Summary
 
Ghost fields inherited from class java.lang.Object
objectTimesFinalized, owner
 
Field Summary
private  HashSet _filesets
           
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
AbstractFileSetTask()
           
 
Model Method Summary
 
Model methods inherited from class java.lang.Object
hashValue
 
Method Summary
 void addFileset(org.apache.tools.ant.types.FileSet fileset)
          Adds a set of files (nested fileset attribute).
 Set getFileSets()
          Return the filesets of the AbstractFileSetTask
 
Methods inherited from class org.apache.tools.ant.Task
execute, getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_filesets

private HashSet _filesets
Constructor Detail

AbstractFileSetTask

public AbstractFileSetTask()
Method Detail

addFileset

public void addFileset(org.apache.tools.ant.types.FileSet fileset)
Adds a set of files (nested fileset attribute).

Parameters:
fileset - The fileset to be added.
Specifications:
requires fileset != null;
ensures this.getFileSets().contains(fileset);

getFileSets

public Set getFileSets()
Return the filesets of the AbstractFileSetTask

Specifications: pure
public normal_behavior
ensures !\result .contains(null);
ensures ( \forall java.lang.Object o; \result .contains(o); o instanceof org.apache.tools.ant.types.FileSet);

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.