1 23 24 31 32 package com.sun.enterprise.tools.common.dd; 33 34 import org.w3c.dom.*; 35 import org.netbeans.modules.schema2beans.*; 36 import java.beans.*; 37 import java.util.*; 38 39 41 public class Message extends org.netbeans.modules.schema2beans.BaseBean 42 { 43 44 static Vector comparators = new Vector(); 45 private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(5, 0, 0); 46 47 static public final String JAVA_METHOD = "JavaMethod"; static public final String OPERATION_NAME = "OperationName"; 50 public Message() { 51 this(Common.USE_DEFAULT_VALUES); 52 } 53 54 public Message(int options) 55 { 56 super(comparators, runtimeVersion); 57 initPropertyTables(2); 59 this.createProperty("java-method", JAVA_METHOD, Common.SEQUENCE_OR | 61 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 62 JavaMethod.class); 63 this.createProperty("operation-name", OPERATION_NAME, Common.SEQUENCE_OR | 65 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 66 String .class); 67 this.initialize(options); 68 } 69 70 void initialize(int options) { 72 73 } 74 75 public void setJavaMethod(JavaMethod value) { 77 this.setValue(JAVA_METHOD, value); 78 if (value != null) { 79 setOperationName(null); 81 } 82 } 83 84 public JavaMethod getJavaMethod() { 86 return (JavaMethod)this.getValue(JAVA_METHOD); 87 } 88 89 public void setOperationName(String value) { 91 this.setValue(OPERATION_NAME, value); 92 if (value != null) { 93 setJavaMethod(null); 95 } 96 } 97 98 public String getOperationName() { 100 return (String )this.getValue(OPERATION_NAME); 101 } 102 103 107 public JavaMethod newJavaMethod() { 108 return new JavaMethod(); 109 } 110 111 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 113 comparators.add(c); 114 } 115 116 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 118 comparators.remove(c); 119 } 120 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 121 } 122 123 public void dump(StringBuffer str, String indent){ 125 String s; 126 Object o; 127 org.netbeans.modules.schema2beans.BaseBean n; 128 str.append(indent); 129 str.append("JavaMethod"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getJavaMethod(); 131 if (n != null) 132 n.dump(str, indent + "\t"); else 134 str.append(indent+"\tnull"); this.dumpAttributes(JAVA_METHOD, 0, str, indent); 136 137 str.append(indent); 138 str.append("OperationName"); str.append(indent+"\t"); str.append("<"); o = this.getOperationName(); 142 str.append((o==null?"null":o.toString().trim())); str.append(">\n"); this.dumpAttributes(OPERATION_NAME, 0, str, indent); 145 146 } 147 public String dumpBeanNode(){ 148 StringBuffer str = new StringBuffer (); 149 str.append("Message\n"); this.dump(str, "\n "); return str.toString(); 152 }} 153 154 156 | Popular Tags |