1 18 package org.apache.tools.ant.taskdefs.optional.extension; 19 20 import org.apache.tools.ant.BuildException; 21 22 28 public class ExtraAttribute { 29 private String name; 30 private String value; 31 32 37 public void setName(final String name) { 38 this.name = name; 39 } 40 41 46 public void setValue(final String value) { 47 this.value = value; 48 } 49 50 55 String getName() { 56 return name; 57 } 58 59 64 String getValue() { 65 return value; 66 } 67 68 74 public void validate() throws BuildException { 75 if (null == name) { 76 final String message = "Missing name from parameter."; 77 throw new BuildException(message); 78 } else if (null == value) { 79 final String message = "Missing value from parameter " + name + "."; 80 throw new BuildException(message); 81 } 82 } 83 } 84 | Popular Tags |