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 ReverseGeocodePreference. 13 * http://schemas.opengis.net/ols/1.2.0/LocationUtilityService.xsd 14 * 15 * <pre> 16 * <simpleType name="ReverseGeocodePreferenceType"> 17 * <annotation> 18 * <documentation>Defines a Preference for Reverse Geocode response.</documentation> 19 * </annotation> 20 * <restriction base="string"> 21 * <enumeration value="StreetAddress"/> 22 * <enumeration value="IntersectionAddress"/> 23 * </restriction> 24 * </simpleType> 25 * <element name="ReverseGeocodePreference" type="xls:ReverseGeocodePreferenceType"> 26 * <annotation> 27 * <documentation>Describes the preference for what the Reverse Geocoder service should return: 28 * StreetAddress, IntersectionAddress, or PositionOfInterest (Place and/or PostalCode). 29 * If not specified, then the service will return the nearest StreetAddress. . 30 * </documentation> 31 * </annotation> 32 * </element> 33 * </pre> 34 * 35 * @author prinsmc 36 * 37 */ 38 public class ReverseGeocodePreference implements XmlNamespaceConstants { 39 40 /** 41 * serialization id. 42 */ 43 private static final long serialVersionUID = -7570918027344077813L; 44 /** geocodeer voorkeur. */ 45 private String preference; 46 47 /** 48 * The Enum PREFERENCE. 49 */ 50 public enum PREFERENCE { 51 52 /** The Street address. */ 53 StreetAddress("StreetAddress"), 54 /** The Intersection address. */ 55 IntersectionAddress("IntersectionAddress"), 56 /** The Position of interest. */ 57 PositionOfInterest("PositionOfInterest"); 58 59 /** The preference. */ 60 public final String preference; 61 62 /** 63 * Instantiates a new preference. 64 * 65 * @param preference 66 * the preference 67 */ 68 PREFERENCE(final String preference) { 69 this.preference = preference; 70 } 71 72 /* 73 * (non-Javadoc) 74 * 75 * @see java.lang.Enum#toString() 76 */ 77 @Override 78 public String toString() { 79 return this.preference; 80 } 81 } 82 83 /** 84 * Gets the geocodeer voorkeur. 85 * 86 * @return the preference 87 */ 88 public String getPreference() { 89 return preference; 90 } 91 92 /** 93 * set gewenste preference. 94 * 95 * @param preference 96 * de preference 97 */ 98 public void setPreference(final String preference) { 99 this.preference = preference; 100 } 101 102 /* 103 * (non-Javadoc) 104 * 105 * @see nl.mineleni.openls.XmlNamespaceConstants#toXML() 106 */ 107 @Override 108 public String toXML() { 109 if (this.preference != null) { 110 final StringBuilder sb = new StringBuilder("<" 111 + XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX 112 + ":ReverseGeocodePreference>"); 113 sb.append(this.preference); 114 sb.append("</" + XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX 115 + ":ReverseGeocodePreference>"); 116 return sb.toString(); 117 } 118 return ""; 119 } 120 121 }