|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| DefaultAntTaskFactory.java | 0% | 40% | 50% | 35.7% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* ========================================================================
|
|
| 3 |
*
|
|
| 4 |
* Copyright 2004 The Apache Software Foundation.
|
|
| 5 |
*
|
|
| 6 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
| 7 |
* you may not use this file except in compliance with the License.
|
|
| 8 |
* You may obtain a copy of the License at
|
|
| 9 |
*
|
|
| 10 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
| 11 |
*
|
|
| 12 |
* Unless required by applicable law or agreed to in writing, software
|
|
| 13 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
| 14 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
| 15 |
* See the License for the specific language governing permissions and
|
|
| 16 |
* limitations under the License.
|
|
| 17 |
*
|
|
| 18 |
* ========================================================================
|
|
| 19 |
*/
|
|
| 20 |
package org.apache.cactus.integration.ant.util;
|
|
| 21 |
|
|
| 22 |
import org.apache.tools.ant.Location;
|
|
| 23 |
import org.apache.tools.ant.Project;
|
|
| 24 |
import org.apache.tools.ant.Target;
|
|
| 25 |
import org.apache.tools.ant.Task;
|
|
| 26 |
|
|
| 27 |
/**
|
|
| 28 |
* Default {@link AntTaskFactory} for creating Ant tasks.
|
|
| 29 |
*
|
|
| 30 |
* @version $Id: DefaultAntTaskFactory.java 239003 2004-05-31 20:05:27Z vmassol $
|
|
| 31 |
*/
|
|
| 32 |
public class DefaultAntTaskFactory implements AntTaskFactory |
|
| 33 |
{
|
|
| 34 |
/**
|
|
| 35 |
* The current {@link Project} being executed.
|
|
| 36 |
*/
|
|
| 37 |
private Project currentProject;
|
|
| 38 |
|
|
| 39 |
/**
|
|
| 40 |
* The current Ant task being executed.
|
|
| 41 |
*/
|
|
| 42 |
private String currentTaskName;
|
|
| 43 |
|
|
| 44 |
/**
|
|
| 45 |
* The current {@link Location} of the Task being executed.
|
|
| 46 |
*/
|
|
| 47 |
private Location currentLocation;
|
|
| 48 |
|
|
| 49 |
/**
|
|
| 50 |
* The current {@link Target} being executed.
|
|
| 51 |
*/
|
|
| 52 |
private Target currentOwningTarget;
|
|
| 53 |
|
|
| 54 |
/**
|
|
| 55 |
* @param theProject the current project
|
|
| 56 |
* @param theCurrentTaskName the current Ant task name
|
|
| 57 |
* @param theCurrentLocation the current task location
|
|
| 58 |
* @param theCurrentTarget the current target being executed
|
|
| 59 |
*/
|
|
| 60 | 1 |
public DefaultAntTaskFactory(Project theProject,
|
| 61 |
String theCurrentTaskName, Location theCurrentLocation, |
|
| 62 |
Target theCurrentTarget) |
|
| 63 |
{
|
|
| 64 | 1 |
this.currentProject = theProject;
|
| 65 | 1 |
this.currentTaskName = theCurrentTaskName;
|
| 66 | 1 |
this.currentLocation = theCurrentLocation;
|
| 67 | 1 |
this.currentOwningTarget = theCurrentTarget;
|
| 68 |
} |
|
| 69 |
|
|
| 70 |
/**
|
|
| 71 |
* @see AntTaskFactory#createTask(String)
|
|
| 72 |
*/
|
|
| 73 | 0 |
public Task createTask(String theName)
|
| 74 |
{
|
|
| 75 | 0 |
Task retVal = this.currentProject.createTask(theName);
|
| 76 | 0 |
if (retVal != null) |
| 77 |
{
|
|
| 78 | 0 |
retVal.setTaskName(this.currentTaskName);
|
| 79 | 0 |
retVal.setLocation(this.currentLocation);
|
| 80 | 0 |
retVal.setOwningTarget(this.currentOwningTarget);
|
| 81 |
} |
|
| 82 | 0 |
return retVal;
|
| 83 |
} |
|
| 84 |
} |
|
| 85 |
|
|
||||||||||