| 1 28 29 package com.idaremedia.antx.go; 30 31 import java.util.Iterator ; 32 import java.util.List ; 33 34 import org.apache.tools.ant.Project; 35 36 import com.idaremedia.antx.helpers.Tk; 37 38 53 54 public final class IffAll 55 { 56 64 public static boolean pass(String list, Project P, boolean onlyIfTrue) 65 { 66 if (Tk.isWhitespace(list)) { 67 return false; 68 } 69 list = Tk.resolveString(P,list); 70 List l= Tk.splitList(list); 71 Iterator itr= l.iterator(); 72 while (itr.hasNext()) { 73 if (!Iff.allowed(itr.next().toString(),P,onlyIfTrue)) { 74 return false; 75 } 76 } 77 return true; 78 } 79 80 81 90 public static final class Exists extends Go.TestSkeleton { 91 public Exists() { 92 } 93 public Exists(String list) { 94 super(list); 95 } 96 public boolean pass(Project P) { 97 verifyInited(); 98 return IffAll.pass(getParameter(),P,false); 99 } 100 public String getParameterName() { 101 return "ifAll"; 102 } 103 } 104 105 106 116 public static final class NotExists extends Go.TestSkeleton { 117 public NotExists() { 118 } 119 public NotExists(String list) { 120 super(list); 121 } 122 public boolean pass(Project P) { 123 verifyInited(); 124 return UnlessAll.pass(getParameter(),P,false); 125 } 126 public String getParameterName() { 127 return "unlessAll"; 128 } 129 } 130 131 132 141 public static final class IsTrue extends Go.TestSkeleton { 142 public IsTrue() { 143 } 144 public IsTrue(String list) { 145 super(list); 146 } 147 public boolean pass(Project P) { 148 verifyInited(); 149 return IffAll.pass(getParameter(),P,true); 150 } 151 public String getParameterName() { 152 return "ifAllTrue"; 153 } 154 } 155 156 157 166 public static final class IsNotTrue extends Go.TestSkeleton { 167 public IsNotTrue() { 168 } 169 public IsNotTrue(String list) { 170 super(list); 171 } 172 public boolean pass(Project P) { 173 verifyInited(); 174 return UnlessAll.pass(getParameter(),P,true); 175 } 176 public String getParameterName() { 177 return "unlessAllTrue"; 178 } 179 } 180 181 182 185 private IffAll() { 186 } 187 } 188 189 190 | Popular Tags |