0
|
1 /*
|
|
2 * (c) Copyright IBM Corp 2001, 2005
|
|
3 */
|
|
4
|
|
5 package javax.wadls.extensions;
|
|
6
|
|
7 import org.w3c.dom.*;
|
|
8 import javax.xml.namespace.*;
|
|
9
|
|
10 /**
|
|
11 * This class is used to wrap arbitrary elements.
|
|
12 *
|
|
13 * @see UnknownExtensionSerializer
|
|
14 * @see UnknownExtensionDeserializer
|
|
15 *
|
|
16 * @author Matthew J. Duftler (duftler@us.ibm.com)
|
|
17 */
|
|
18 public class UnknownExtensibilityElement implements ExtensibilityElement,
|
|
19 java.io.Serializable
|
|
20 {
|
|
21 protected QName elementType = null;
|
|
22 // Uses the wrapper type so we can tell if it was set or not.
|
|
23 protected Boolean required = null;
|
|
24 protected Element element = null;
|
|
25
|
|
26 public static final long serialVersionUID = 1;
|
|
27
|
|
28 /**
|
|
29 * Set the type of this extensibility element.
|
|
30 *
|
|
31 * @param elementType the type
|
|
32 */
|
|
33 public void setElementType(QName elementType)
|
|
34 {
|
|
35 this.elementType = elementType;
|
|
36 }
|
|
37
|
|
38 /**
|
|
39 * Get the type of this extensibility element.
|
|
40 *
|
|
41 * @return the extensibility element's type
|
|
42 */
|
|
43 public QName getElementType()
|
|
44 {
|
|
45 return elementType;
|
|
46 }
|
|
47
|
|
48 /**
|
|
49 * Set whether or not the semantics of this extension
|
|
50 * are required. Relates to the wsdl:required attribute.
|
|
51 */
|
|
52 public void setRequired(Boolean required)
|
|
53 {
|
|
54 this.required = required;
|
|
55 }
|
|
56
|
|
57 /**
|
|
58 * Get whether or not the semantics of this extension
|
|
59 * are required. Relates to the wsdl:required attribute.
|
|
60 */
|
|
61 public Boolean getRequired()
|
|
62 {
|
|
63 return required;
|
|
64 }
|
|
65
|
|
66 /**
|
|
67 * Set the Element for this extensibility element.
|
|
68 *
|
|
69 * @param element the unknown element that was encountered
|
|
70 */
|
|
71 public void setElement(Element element)
|
|
72 {
|
|
73 this.element = element;
|
|
74 }
|
|
75
|
|
76 /**
|
|
77 * Get the Element for this extensibility element.
|
|
78 *
|
|
79 * @return the unknown element that was encountered
|
|
80 */
|
|
81 public Element getElement()
|
|
82 {
|
|
83 return element;
|
|
84 }
|
|
85
|
|
86 public String toString()
|
|
87 {
|
|
88 StringBuffer strBuf = new StringBuffer();
|
|
89
|
|
90 strBuf.append("UnknownExtensibilityElement (" + elementType + "):");
|
|
91 strBuf.append("\nrequired=" + required);
|
|
92
|
|
93 if (element != null)
|
|
94 {
|
|
95 strBuf.append("\nelement=" + element);
|
|
96 }
|
|
97
|
|
98 return strBuf.toString();
|
|
99 }
|
|
100 } |