KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > uddi4j > util > UploadRegister


1 /*
2  * The source code contained herein is licensed under the IBM Public License
3  * Version 1.0, which has been approved by the Open Source Initiative.
4  * Copyright (C) 2001, International Business Machines Corporation
5  * All Rights Reserved.
6  *
7  */

8
9 package org.uddi4j.util;
10 import org.uddi4j.UDDIElement;
11 import org.uddi4j.UDDIException;
12 import org.w3c.dom.Element JavaDoc;
13
14 /**
15  * Represents the uploadRegister element within the UDDI version 2.0 schema.
16  * This class contains the following types of methods:
17  *
18  * <ul>
19  * <li>A constructor that passes the required fields.
20  * <li>A Constructor that will instantiate the object from an appropriate XML
21  * DOM element.
22  * <li>Get/set methods for each attribute that this element can contain.
23  * <li>A get/setVector method is provided for sets of attributes.
24  * <li>A SaveToXML method that serializes this class within a passed in
25  * element.
26  * </ul>
27  *
28  * Typically, this class is used to construct parameters for, or interpret
29  * responses from, methods in the UDDIProxy class.
30  *
31  * <p><b>Element description:</b>
32  * <p>This class is deprecated in Version 2. It is still present in
33  * this package because this tag is still found in the XML Schema of Version 2 API.
34  *
35  * @author David Melgar (dmelgar@us.ibm.com)
36  */

37 public class UploadRegister extends UDDIElement {
38    public static final String JavaDoc UDDI_TAG = "uploadRegister";
39
40    protected Element base = null;
41
42    String JavaDoc text = null;
43
44    /**
45     * Default constructor.
46     * Avoid using the default constructor for validation. It does not validate
47     * required fields. Instead, use the required fields constructor to perform
48     * validation.
49     */

50    public UploadRegister() {
51    }
52
53    /**
54     * Construct the object with required fields.
55     *
56     * @param value String value
57     */

58    public UploadRegister(String JavaDoc value) {
59       setText(value);
60    }
61
62    /**
63     * Construct the object from a DOM tree. Used by
64     * UDDIProxy to construct an object from a received UDDI
65     * message.
66     *
67     * @param base Element with the name appropriate for this class.
68     *
69     * @exception UDDIException Thrown if DOM tree contains a SOAP fault
70     * or a disposition report indicating a UDDI error.
71     */

72    public UploadRegister(Element base) throws UDDIException {
73       // Check if it is a fault. Throws an exception if it is.
74
super(base);
75       text = getText(base);
76    }
77
78    public void setText(String JavaDoc s) {
79       text = s;
80    }
81
82    public String JavaDoc getText() {
83       return text;
84    }
85
86    /**
87     * Save an object to the DOM tree. Used to serialize an object
88     * to a DOM tree, usually to send a UDDI message.
89     *
90     * <BR>Used by UDDIProxy.
91     *
92     * @param parent Object will serialize as a child element under the
93     * passed in parent element.
94     */

95    public void saveToXML(Element parent) {
96       base = parent.getOwnerDocument().createElement(UDDI_TAG);
97       // Save attributes.
98
if (text!=null) {
99          base.appendChild(parent.getOwnerDocument().createTextNode(text));
100       }
101       parent.appendChild(base);
102    }
103 }
104
Popular Tags