1 28 29 package com.idaremedia.antx.condition; 30 31 import com.idaremedia.antx.FlexString; 32 import com.idaremedia.antx.helpers.Tk; 33 import com.idaremedia.antx.parameters.Handling; 34 import com.idaremedia.antx.parameters.MalformedCheckEnabled; 35 36 50 51 public class IsNotWhitespace extends SimpleFlexCondition 52 implements MalformedCheckEnabled 53 { 54 57 public IsNotWhitespace() 58 { 59 } 60 61 62 66 public IsNotWhitespace(String value) 67 { 68 setValue(value); 69 } 70 71 72 73 77 public void setValue(String value) 78 { 79 require_(value!=null,"setValu- nonzro"); 80 setLiteral(value); 81 } 82 83 84 85 94 public void setMalformed(Handling response) 95 { 96 m_testFailedSubst = !Handling.isYes(response,Handling.REJECT); 97 } 98 99 100 105 public Handling getMalformedHandling() 106 { 107 return m_testFailedSubst ? Handling.REJECT : Handling.ACCEPT; 108 } 109 110 111 115 public boolean eval() 116 { 117 verifyCanEvaluate_("eval"); 118 119 FlexString xv = getValueHelper(); 120 String value = xv.getValue(); 121 boolean notWS = !Tk.isWhitespace(value); 122 123 if (notWS && m_testFailedSubst) { 124 if (xv.isProperty()) { 125 if (!LocalPropertyExaminer.verifyProperty 126 (getProject(), xv)) { 127 notWS=false; 128 } 129 } else { 130 if (!LocalPropertyExaminer.verifyLiteral 131 (getProject(), xv)) { 132 notWS=false; 133 } 134 } 135 } 136 return notWS; 137 } 138 139 140 private boolean m_testFailedSubst= true;} 142 143 144 | Popular Tags |