0
|
1 /*
|
|
2 * (c) Copyright IBM Corp 2001, 2005
|
|
3 */
|
|
4
|
|
5 package javax.wadls.extensions;
|
|
6
|
|
7 import org.w3c.dom.*;
|
|
8
|
|
9 import javax.wadls.*;
|
|
10 import javax.xml.namespace.*;
|
|
11
|
|
12 import edu.uga.cs.lsdis.meteors.wadls.*;
|
|
13 import edu.uga.cs.lsdis.meteors.wadls.util.xml.*;
|
|
14
|
|
15 /**
|
|
16 * This class is used to deserialize arbitrary elements into
|
|
17 * UnknownExtensibilityElement instances.
|
|
18 *
|
|
19 * @see UnknownExtensibilityElement
|
|
20 * @see UnknownExtensionSerializer
|
|
21 *
|
|
22 * @author Matthew J. Duftler (duftler@us.ibm.com)
|
|
23 */
|
|
24 public class UnknownExtensionDeserializer implements ExtensionDeserializer,
|
|
25 java.io.Serializable
|
|
26 {
|
|
27 public static final long serialVersionUID = 1;
|
|
28
|
|
29 public ExtensibilityElement unmarshall(Class parentType,
|
|
30 QName elementType,
|
|
31 Element el,
|
|
32 Application app,
|
|
33 ExtensionRegistry extReg)
|
|
34 throws WADLSException
|
|
35 {
|
|
36 System.out.println("%%%% Inside UnMarshall for Element:"+el.getNodeName());
|
|
37 UnknownExtensibilityElement unknownExt = new UnknownExtensibilityElement();
|
|
38 String requiredStr = DOMUtils.getAttributeNS(el,
|
|
39 Constants.NS_URI_WADL,
|
|
40 Constants.ATTR_REQUIRED);
|
|
41
|
|
42 System.out.println("%%%% Required Str:"+requiredStr);
|
|
43 System.out.println("%%%% Element Type To String:"+elementType.toString());
|
|
44 unknownExt.setElementType(elementType);
|
|
45
|
|
46 if (requiredStr != null)
|
|
47 {
|
|
48 unknownExt.setRequired(new Boolean(requiredStr));
|
|
49 }
|
|
50
|
|
51 unknownExt.setElement(el);
|
|
52
|
|
53 return unknownExt;
|
|
54 }
|
|
55 } |