KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Copyright (C) 2001, Hewlett-Packard Company
6  * All Rights Reserved.
7  *
8  */

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

40 public class FindQualifier extends UDDIElement {
41    public static final String JavaDoc UDDI_TAG = "findQualifier";
42
43    /**
44     * Valid values for a find qualifier
45     */

46    public static final String JavaDoc exactNameMatch = "exactNameMatch";
47    public static final String JavaDoc caseSensitiveMatch = "caseSensitiveMatch";
48    public static final String JavaDoc sortByNameAsc = "sortByNameAsc";
49    public static final String JavaDoc sortByNameDesc = "sortByNameDesc";
50    public static final String JavaDoc sortByDateAsc = "sortByDateAsc";
51    public static final String JavaDoc sortByDateDesc = "sortByDateDesc";
52    //V2 qualifiers
53
public static final String JavaDoc orLikeKeys = "orLikeKeys";
54    public static final String JavaDoc orAllKeys = "orAllKeys";
55    public static final String JavaDoc combineCategoryBags = "combineCategoryBags";
56    public static final String JavaDoc serviceSubset = "serviceSubset";
57    public static final String JavaDoc andAllKeys = "andAllKeys";
58
59    // Removed in v2 errata 3
60
// public static final String soundex = "soundex";
61

62
63    protected Element base = null;
64
65    String JavaDoc text = null;
66
67    /**
68     * Default constructor.
69     * Avoid using the default constructor for validation. It does not validate
70     * required fields. Instead, use the required fields constructor to perform
71     * validation.
72     */

73    public FindQualifier() {
74    }
75
76    /**
77     * Construct the object with required fields.
78     *
79     * @param value String value
80     */

81    public FindQualifier(String JavaDoc value) {
82       setText(value);
83    }
84
85    /**
86     * Construct the object from a DOM tree. Used by
87     * UDDIProxy to construct an object from a received UDDI
88     * message.
89     *
90     * @param base Element with the name appropriate for this class.
91     *
92     * @exception UDDIException Thrown if DOM tree contains a SOAP fault
93     * or a disposition report indicating a UDDI error.
94     */

95    public FindQualifier(Element base) throws UDDIException {
96       // Check if it is a fault. Throws an exception if it is.
97
super(base);
98       text = getText(base);
99    }
100
101    public void setText(String JavaDoc s) {
102       text = s;
103    }
104
105    public String JavaDoc getText() {
106       return text;
107    }
108
109    /**
110     * Save an object to the DOM tree. Used to serialize an object
111     * to a DOM tree, usually to send a UDDI message.
112     *
113     * <BR>Used by UDDIProxy.
114     *
115     * @param parent Object will serialize as a child element under the
116     * passed in parent element.
117     */

118    public void saveToXML(Element parent) {
119       base = parent.getOwnerDocument().createElement(UDDI_TAG);
120       // Save attributes
121
if (text!=null) {
122          base.appendChild(parent.getOwnerDocument().createTextNode(text));
123       }
124       parent.appendChild(base);
125    }
126 }
127
Popular Tags