01: /*******************************************************************************
02: * Copyright (c) 2000, 2004 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM - Initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.build.ant;
11:
12: /**
13: * Represents an Ant condition.
14: */
15: public class ConditionTask implements ITask {
16:
17: protected String property;
18: protected String value;
19: protected Condition condition;
20:
21: /**
22: * Constructor for the condition.
23: *
24: * @param property
25: * @param value
26: * @param condition
27: */
28: public ConditionTask(String property, String value,
29: 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: }
|