KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > build > ant > ConditionTask


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM - Initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.build.ant;
12
13 /**
14  * Represents an Ant condition.
15  */

16 public class ConditionTask implements ITask {
17
18     protected String JavaDoc property;
19     protected String JavaDoc value;
20     protected Condition condition;
21
22     /**
23      * Constructor for the condition.
24      *
25      * @param property
26      * @param value
27      * @param condition
28      */

29     public ConditionTask(String JavaDoc property, String JavaDoc value, Condition condition) {
30         this.property = property;
31         this.value = value;
32         this.condition = condition;
33     }
34
35     /**
36      * @see ITask#print(AntScript)
37      */

38     public void print(AntScript script) {
39         script.printTab();
40         script.print("<condition"); //$NON-NLS-1$
41
script.printAttribute("property", property, true); //$NON-NLS-1$
42
script.printAttribute("value", value, false); //$NON-NLS-1$
43
script.println(">"); //$NON-NLS-1$
44
condition.print(script);
45         script.println("</condition>"); //$NON-NLS-1$
46
}
47 }
48
Popular Tags