1 22 package org.jboss.metadata; 23 24 import org.jboss.deployment.DeploymentException; 25 import org.jboss.util.Strings; 26 import org.w3c.dom.Element ; 27 28 35 public class ActivationConfigPropertyMetaData extends MetaData 36 { 37 39 41 42 private String name; 43 44 45 private String value; 46 47 49 51 54 public ActivationConfigPropertyMetaData() 55 { 56 } 57 58 64 public ActivationConfigPropertyMetaData(String name, String value) 65 { 66 this.name = name; 67 this.value = value; 68 } 69 70 72 75 public String getName() 76 { 77 return name; 78 } 79 80 public void setName(String name) 81 { 82 this.name = name; 83 } 84 85 88 public String getValue() 89 { 90 return value; 91 } 92 93 public void setValue(String value) 94 { 95 if (Strings.isValidJavaIdentifier(name) == false) 96 { 97 throw new IllegalStateException ("activation-config-property '" + name + "' is not a valid java identifier"); 98 } 99 this.value = value; 100 } 101 102 public void importXml(Element element) throws DeploymentException 103 { 104 name = getElementContent(getUniqueChild(element, "activation-config-property-name")); 105 value = getElementContent(getUniqueChild(element, "activation-config-property-value")); 106 if (name == null || name.trim().length() == 0) 107 throw new DeploymentException("activation-config-property doesn't have a name"); 108 if (Strings.isValidJavaIdentifier(name) == false) 109 throw new DeploymentException("activation-config-property '" + name + "' is not a valid java identifier"); 110 } 111 112 114 public String toString() 115 { 116 return "ActivationConfigProperty(" + name + "=" + value + ")"; 117 } 118 119 121 123 125 } 127 | Popular Tags |