1 28 29 package com.idaremedia.antx.condition; 30 31 import org.apache.tools.ant.Project; 32 33 import com.idaremedia.antx.FlexString; 34 import com.idaremedia.antx.helpers.NameValuePair; 35 import com.idaremedia.antx.ownhelpers.PropertyExaminer; 36 import com.idaremedia.antx.ownhelpers.UnresolvedProperty; 37 38 47 48 final class LocalPropertyExaminer 49 { 50 53 private static final PropertyExaminer EXAMINER 54 = new PropertyExaminer(); 55 static { 56 EXAMINER.setCheckBrokenSubstitution(); 57 } 58 59 60 63 static boolean verifyProperty(Project P, FlexString propertydef) { 64 String name = propertydef.sourceString(P); 65 String value = propertydef.targetString(P,name); 66 boolean ok = value!=null && value!=UnresolvedProperty.VALUE; 67 if (ok) { 68 NameValuePair nvp= new NameValuePair(); 69 nvp.setName(name); 70 nvp.setValue(value); 71 ok = EXAMINER.verifiedPropertyValue(nvp,P)!=null; 72 } 73 return ok; 74 } 75 76 77 80 static boolean verifyProperty(Project P, String property) { 81 String value = P.getProperty(property); 82 boolean ok = value!=null; 83 if (ok) { 84 NameValuePair nvp= new NameValuePair(); 85 nvp.setName(property); 86 nvp.setValue(value); 87 ok = EXAMINER.verifiedPropertyValue(nvp,P)!=null; 88 } 89 return ok; 90 } 91 92 93 96 static boolean verifyLiteral(Project P, String literal) { 97 return EXAMINER.verifiedLiteral(literal,P); 98 } 99 100 101 104 static boolean verifyLiteral(Project P, FlexString literaldef) { 105 return EXAMINER.verifiedLiteral(literaldef.sourceString(P),P); 106 } 107 108 109 112 private LocalPropertyExaminer() 113 { 114 } 115 } 116 117 118 | Popular Tags |