org.greenstone.gs3client.data
Class QueryFormData

java.lang.Object
  extended by org.greenstone.gs3client.data.QueryFormData
Direct Known Subclasses:
QueryFormData.QueryFormParam

public class QueryFormData
extends java.lang.Object

Class QueryFormData represents the <param> and <option> elements that can appear in a <paramList> tag in the xml response returned by a describe request sent to *Query* Service (e.g. FieldQuery, TextQuery).Its subclass QueryFormParam more fully represents the <param> elements, but this class covers the data shared by <param> and <option> elements.

Author:
ak19

Nested Class Summary
static class QueryFormData.QueryFormParam
          Static inner class QueryFormParam is a subclass of QueryFormData and uniquely represents the data that can be contained in any <param> tag of the xml response that's returned when a describe request is sent to a Query Service.
 
Field Summary
 java.lang.String displayItem
          DisplayItem text content of the parameter or option this QueryFormData represents
 java.lang.String name
          Name of the parameter or option this QueryFormData represents
static java.lang.String OCCURS_ATT
          Constant for the "occurs" attribute name
 
Constructor Summary
QueryFormData(org.w3c.dom.Element param)
          Contructor to create a QueryFormData object from <param> or <option> elements of a Query response XML message.
 
Method Summary
protected  java.lang.String extractDisplayItem(org.w3c.dom.Element param)
          Given an element, extracts the text value from the first direct child element that is a <displayItem> element and returns this.
 java.lang.String show()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OCCURS_ATT

public static final java.lang.String OCCURS_ATT
Constant for the "occurs" attribute name

See Also:
Constant Field Values

name

public final java.lang.String name
Name of the parameter or option this QueryFormData represents


displayItem

public final java.lang.String displayItem
DisplayItem text content of the parameter or option this QueryFormData represents

Constructor Detail

QueryFormData

public QueryFormData(org.w3c.dom.Element param)
Contructor to create a QueryFormData object from <param> or <option> elements of a Query response XML message.

Parameters:
param - the <param> or <option> tag for which a QueryFormData object is constructed, from the data the element contains.
Method Detail

extractDisplayItem

protected java.lang.String extractDisplayItem(org.w3c.dom.Element param)
Given an element, extracts the text value from the first direct child element that is a <displayItem> element and returns this.

Parameters:
param - the <param> or <option> tag from which the data is extracted.
Returns:
the text content of the displayItem in the <param> tag

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
this object's displayItem string. This is also what is displayed when this object is added as a list items into a JComboBoxes or JList.

show

public java.lang.String show()
Returns:
a display String of the member values of this QueryFormData object for debugging purposes