View Javadoc
1   /*
2    * Copyright (c) 2013-2014, Dienst Landelijk Gebied - Ministerie van Economische Zaken
3    * 
4    * Gepubliceerd onder de BSD 2-clause licentie, 
5    * zie https://github.com/MinELenI/CBSviewer/blob/master/LICENSE.md voor de volledige licentie.
6    */
7   package nl.mineleni.openls.databinding.openls;
8   
9   import nl.mineleni.openls.XmlNamespaceConstants;
10  
11  /**
12   * OLS ReverseGeocodeRequest.
13   * http://schemas.opengis.net/ols/1.2.0/LocationUtilityService.xsd
14   * 
15   * <pre>
16   * &lt;element name="ReverseGeocodeRequest" type="xls:ReverseGeocodeRequestType" substitutionGroup="xls:_RequestParameters"&gt;
17   * 	&lt;annotation&gt;
18   * 		&lt;documentation&gt;Reverse Geocode Service Request&lt;/documentation&gt;
19   * 	&lt;/annotation&gt;
20   * &lt;/element&gt;
21   * 
22   * &lt;complexType name="ReverseGeocodeRequestType"&gt;
23   * 	&lt;annotation&gt;
24   * 		&lt;documentation&gt;Reverse Geocode Request.&lt;/documentation&gt;
25   * 	&lt;/annotation&gt;
26   * 	&lt;complexContent&gt;
27   * 	&lt;extension base="xls:AbstractRequestParametersType"&gt;
28   * 	&lt;sequence&gt;
29   * 		&lt;element ref="xls:Position"/&gt;
30   * 		&lt;element ref="xls:ReverseGeocodePreference" minOccurs="0" maxOccurs="unbounded"/&gt;
31   * 	&lt;/sequence&gt;
32   * 	&lt;/extension&gt;
33   * 	&lt;/complexContent&gt;
34   * &lt;/complexType&gt;
35   * 
36   * </pre>
37   * 
38   * @author prinsmc
39   * @since 1.7
40   */
41  public class ReverseGeocodeRequest implements XmlNamespaceConstants {
42  
43  	/**
44  	 * serialization id.
45  	 */
46  	private static final long serialVersionUID = 9041529530016571218L;
47  
48  	/**
49  	 * reverse geocoding voorkeur.
50  	 */
51  	private ReverseGeocodePreference reverseGeocodePreference;
52  
53  	/**
54  	 * reverse geocoding positie.
55  	 */
56  	private Position position;
57  
58  	/**
59  	 * Gets the reverse geocoding voorkeur.
60  	 *
61  	 * @return the reverseGeocodePreference
62  	 */
63  	public ReverseGeocodePreference getReverseGeocodePreference() {
64  		return reverseGeocodePreference;
65  	}
66  
67  	/**
68  	 * Sets the reverse geocoding voorkeur.
69  	 *
70  	 * @param reverseGeocodePreference
71  	 *            the reverseGeocodePreference to set
72  	 */
73  	public void setReverseGeocodePreference(
74  			final ReverseGeocodePreference reverseGeocodePreference) {
75  		this.reverseGeocodePreference = reverseGeocodePreference;
76  	}
77  
78  	/**
79  	 * Gets the reverse geocoding positie.
80  	 *
81  	 * @return the position
82  	 */
83  	public Position getPosition() {
84  		return position;
85  	}
86  
87  	/**
88  	 * set de positie voor dit verzoek.
89  	 * 
90  	 * @param position
91  	 *            positie
92  	 */
93  	public void setPosition(final Position position) {
94  		this.position = position;
95  	}
96  
97  	/*
98  	 * (non-Javadoc)
99  	 * 
100 	 * @see nl.mineleni.openls.XmlNamespaceConstants#toXML()
101 	 */
102 	@Override
103 	public String toXML() {
104 		final StringBuilder sb = new StringBuilder("<"
105 				+ XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX
106 				+ ":ReverseGeocodeRequest " + "xmlns:"
107 				+ XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX + "=\""
108 				+ XmlNamespaceConstants.OPENLS_NAMESPACE_URI + "\" " + "xmlns:"
109 				+ XmlNamespaceConstants.OGC_GML_NAMESPACE_PREFIX + "=\""
110 				+ XmlNamespaceConstants.OGC_GML_NAMESPACE_URI + "\" "
111 				+ XmlNamespaceConstants.OPENLS_NAMESPACE_SCHEMALOCATION + ">");
112 
113 		sb.append(position.toXML());
114 		if (null != reverseGeocodePreference) {
115 			sb.append(reverseGeocodePreference.toXML());
116 		}
117 
118 		sb.append("</" + XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX
119 				+ ":ReverseGeocodeRequest>");
120 		return sb.toString();
121 	}
122 
123 }