1 23 24 29 30 package com.sun.enterprise.tools.common.dd.ejb; 31 32 import org.w3c.dom.*; 33 import org.netbeans.modules.schema2beans.*; 34 import java.beans.*; 35 import java.util.*; 36 37 39 public class AsContext extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String AUTH_METHOD = "AuthMethod"; static public final String REALM = "Realm"; static public final String REQUIRED = "Required"; 48 public AsContext() { 49 this(Common.USE_DEFAULT_VALUES); 50 } 51 52 public AsContext(int options) 53 { 54 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 55 this.createProperty("auth-method", AUTH_METHOD, 58 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 59 String .class); 60 this.createProperty("realm", REALM, 62 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 63 String .class); 64 this.createProperty("required", REQUIRED, 66 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 67 String .class); 68 this.initialize(options); 69 } 70 71 void initialize(int options) 73 { 74 75 } 76 77 public void setAuthMethod(String value) { 79 this.setValue(AUTH_METHOD, value); 80 } 81 82 public String getAuthMethod() { 84 return (String )this.getValue(AUTH_METHOD); 85 } 86 87 public void setRealm(String value) { 89 this.setValue(REALM, value); 90 } 91 92 public String getRealm() { 94 return (String )this.getValue(REALM); 95 } 96 97 public void setRequired(String value) { 99 this.setValue(REQUIRED, value); 100 } 101 102 public String getRequired() { 104 return (String )this.getValue(REQUIRED); 105 } 106 107 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 109 comparators.add(c); 110 } 111 112 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 114 comparators.remove(c); 115 } 116 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 117 boolean restrictionFailure = false; 118 if (getAuthMethod() == null) { 120 throw new org.netbeans.modules.schema2beans.ValidateException("getAuthMethod() == null", "authMethod", this); } 122 if (getRealm() == null) { 124 throw new org.netbeans.modules.schema2beans.ValidateException("getRealm() == null", "realm", this); } 126 if (getRequired() == null) { 128 throw new org.netbeans.modules.schema2beans.ValidateException("getRequired() == null", "required", this); } 130 } 131 132 public void dump(StringBuffer str, String indent){ 134 String s; 135 Object o; 136 org.netbeans.modules.schema2beans.BaseBean n; 137 str.append(indent); 138 str.append("AuthMethod"); str.append(indent+"\t"); str.append("<"); s = this.getAuthMethod(); 142 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(AUTH_METHOD, 0, str, indent); 145 146 str.append(indent); 147 str.append("Realm"); str.append(indent+"\t"); str.append("<"); s = this.getRealm(); 151 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(REALM, 0, str, indent); 154 155 str.append(indent); 156 str.append("Required"); str.append(indent+"\t"); str.append("<"); s = this.getRequired(); 160 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(REQUIRED, 0, str, indent); 163 164 } 165 public String dumpBeanNode(){ 166 StringBuffer str = new StringBuffer (); 167 str.append("AsContext\n"); this.dump(str, "\n "); return str.toString(); 170 }} 171 172 174 175 1019 | Popular Tags |