View Javadoc
1   package nl.mineleni.openls.databinding.openls;
2   
3   import java.util.Vector;
4   
5   import nl.mineleni.openls.XmlNamespaceConstants;
6   
7   /**
8    * OLS GeocodeResponse.
9    * http://schemas.opengis.net/ols/1.2.0/LocationUtilityService.xsd
10   * 
11   * <pre>
12   * 
13   *  &lt;complexType name="GeocodeResponseType"&gt;
14   *   &lt;annotation&gt;
15   *     &lt;documentation&gt;GeocodeResponse. The addresses returned will be normalized 
16   *     Address ADTs as a result of any parsing by the geocoder, etc.&lt;/documentation&gt;
17   *   &lt;/annotation&gt;
18   *   &lt;complexContent&gt;
19   *     &lt;extension base="xls:AbstractResponseParametersType"&gt;
20   *       &lt;sequence&gt;
21   *         &lt;element ref="xls:GeocodeResponseList" maxOccurs="unbounded" /&gt;
22   *       &lt;/sequence&gt;
23   *     &lt;/extension&gt;
24   *   &lt;/complexContent&gt;
25   * &lt;/complexType&gt;
26   * 
27   * </pre>
28   * 
29   * @author Mark
30   * @since 1.7
31   */
32  public class GeocodeResponse implements XmlNamespaceConstants {
33  	/**
34  	 * serialization id.
35  	 */
36  	private static final long serialVersionUID = -8343502033013447204L;
37  
38  	/** The geocode response list. */
39  	private final Vector<GeocodeResponseList> geocodeResponseList = new Vector<>();
40  
41  	/**
42  	 * Adds the geocode response list.
43  	 * 
44  	 * @param val
45  	 *            the val
46  	 */
47  	public void addGeocodeResponseList(final GeocodeResponseList val) {
48  		this.geocodeResponseList.add(val);
49  	}
50  
51  	/**
52  	 * Gets the geocode response list at.
53  	 * 
54  	 * @param i
55  	 *            the i
56  	 * @return the geocode response list at
57  	 */
58  	public GeocodeResponseList getGeocodeResponseListAt(final int i) {
59  		return this.geocodeResponseList.get(i);
60  	}
61  
62  	/**
63  	 * Gets the geocode response list size.
64  	 * 
65  	 * @return the geocode response list size
66  	 */
67  	public int getGeocodeResponseListSize() {
68  		return this.geocodeResponseList.size();
69  	}
70  
71  	/*
72  	 * (non-Javadoc)
73  	 * 
74  	 * @see nl.mineleni.openls.XmlNamespaceConstants#toXML()
75  	 */
76  	@Override
77  	public String toXML() {
78  		final StringBuilder sb = new StringBuilder("<"
79  				+ XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX
80  				+ ":GeocodeResponse " + "xmlns:"
81  				+ XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX + "=\""
82  				+ XmlNamespaceConstants.OPENLS_NAMESPACE_URI + "\" " + "xmlns:"
83  				+ XmlNamespaceConstants.OGC_GML_NAMESPACE_PREFIX + "=\""
84  				+ XmlNamespaceConstants.OGC_GML_NAMESPACE_URI + "\">");
85  		for (final GeocodeResponseList gcrl : this.geocodeResponseList) {
86  			sb.append(gcrl.toXML());
87  		}
88  		sb.append("</" + XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX
89  				+ ":GeocodeResponse>");
90  		return sb.toString();
91  	}
92  }