1 16 17 package org.apache.commons.launcher.types; 18 19 import java.io.File ; 20 21 import org.apache.tools.ant.ProjectHelper; 22 import org.apache.tools.ant.types.DataType; 23 import org.apache.tools.ant.types.Path; 24 25 33 public class ConditionalVariable extends DataType { 34 35 37 40 private String ifCondition = null; 41 42 45 private String key = null; 46 47 50 private String unlessCondition = null; 51 52 55 private String value = null; 56 57 59 64 public String getIf() { 65 66 return ProjectHelper.replaceProperties(project, ifCondition, project.getProperties()); 67 68 } 69 70 75 public String getKey() { 76 77 return ProjectHelper.replaceProperties(project, key, project.getProperties()); 78 79 } 80 81 86 public String getUnless() { 87 88 return ProjectHelper.replaceProperties(project, unlessCondition, project.getProperties()); 89 90 } 91 92 97 public String getValue() { 98 99 return ProjectHelper.replaceProperties(project, value, project.getProperties()); 100 101 } 102 103 108 public void setFile(File file) { 109 110 this.value = file.getAbsolutePath(); 111 112 } 113 114 119 public void setPath(Path path) { 120 121 this.value = path.toString(); 122 123 } 124 125 137 public void setIf(String property) { 138 139 this.ifCondition = property; 140 141 } 142 143 148 public void setKey(String key) { 149 150 this.key = key; 151 152 } 153 154 159 public void setFile(Path path) { 160 161 this.value = path.toString(); 162 163 } 164 165 177 public void setUnless(String property) { 178 179 this.unlessCondition = property; 180 181 } 182 183 188 public void setValue(String value) { 189 190 this.value = value; 191 192 } 193 194 } 195 | Popular Tags |