1 23 24 28 29 package com.sun.enterprise.config.serverbeans; 30 31 import org.w3c.dom.*; 32 import org.netbeans.modules.schema2beans.*; 33 import java.beans.*; 34 import java.util.*; 35 import java.io.Serializable ; 36 import com.sun.enterprise.config.ConfigBean; 37 import com.sun.enterprise.config.ConfigException; 38 import com.sun.enterprise.config.StaleWriteConfigException; 39 import com.sun.enterprise.util.i18n.StringManager; 40 41 43 public class ElementProperty extends ConfigBean implements Serializable 44 { 45 46 static Vector comparators = new Vector(); 47 private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0); 48 49 static public final String DESCRIPTION = "Description"; 50 51 public ElementProperty() { 52 this(Common.USE_DEFAULT_VALUES); 53 } 54 55 public ElementProperty(int options) 56 { 57 super(comparators, runtimeVersion); 58 initPropertyTables(1); 60 this.createProperty("description", DESCRIPTION, 61 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 62 String .class); 63 this.initialize(options); 64 } 65 66 void initialize(int options) { 68 69 } 70 71 74 public String getDescription() { 75 return (String ) getValue(ServerTags.DESCRIPTION); 76 } 77 81 public void setDescription(String v){ 82 setValue(ServerTags.DESCRIPTION, (null != v ? v.trim() : null)); 83 } 84 88 public String getName() { 89 return getAttributeValue(ServerTags.NAME); 90 } 91 96 public void setName(String v, boolean overwrite) throws StaleWriteConfigException { 97 setAttributeValue(ServerTags.NAME, v, overwrite); 98 } 99 103 public void setName(String v) { 104 setAttributeValue(ServerTags.NAME, v); 105 } 106 110 public String getValue() { 111 return getAttributeValue(ServerTags.VALUE); 112 } 113 118 public void setValue(String v, boolean overwrite) throws StaleWriteConfigException { 119 setAttributeValue(ServerTags.VALUE, v, overwrite); 120 } 121 125 public void setValue(String v) { 126 setAttributeValue(ServerTags.VALUE, v); 127 } 128 133 protected String getRelativeXPath() { 134 String ret = null; 135 ret = "element-property" + (canHaveSiblings() ? "[@name='" + getAttributeValue("name") +"']" : "") ; 136 return (null != ret ? ret.trim() : null); 137 } 138 139 142 public static String getDefaultAttributeValue(String attr) { 143 if(attr == null) return null; 144 attr = attr.trim(); 145 return null; 146 } 147 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 149 comparators.add(c); 150 } 151 152 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 154 comparators.remove(c); 155 } 156 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 157 } 158 159 public void dump(StringBuffer str, String indent){ 161 String s; 162 Object o; 163 org.netbeans.modules.schema2beans.BaseBean n; 164 str.append(indent); 165 str.append("Description"); str.append(indent+"\t"); str.append("<"); o = this.getDescription(); 169 str.append((o==null?"null":o.toString().trim())); str.append(">\n"); this.dumpAttributes(DESCRIPTION, 0, str, indent); 172 173 } 174 public String dumpBeanNode(){ 175 StringBuffer str = new StringBuffer (); 176 str.append("ElementProperty\n"); this.dump(str, "\n "); return str.toString(); 179 }} 180 181 183 | Popular Tags |