1 package nl.mineleni.openls.databinding.openls; 2 3 import nl.mineleni.openls.XmlNamespaceConstants; 4 5 /** 6 * OLS Street. http://schemas.opengis.net/ols/1.2.0/ADT.xsd 7 * 8 * <pre> 9 * 10 * <complexType name="StreetNameType"> 11 * <annotation> 12 * <documentation>The data elements that make up the name of a 13 * street. There are two valid methods for encoding this 14 * information: 1). Use the structured elements and attributes. 15 * 2). The element value may contain a simplified string (e.g. 16 * West 83rd. Street). An example: 17 * <Street directionalPrefix="W" officialName="83RD" typeSuffix="ST" /> 18 * </documentation> 19 * </annotation> 20 * <simpleContent> 21 * <extension base="string"> 22 * <attribute name="directionalPrefix" type="string" use="optional"> 23 * <annotation> 24 * <documentation>The direction for a street (e.g., North), 25 * placed before the official name.</documentation> 26 * </annotation> 27 * </attribute> 28 * <attribute name="typePrefix" type="string" use="optional"> 29 * <annotation> 30 * <documentation>The street type (e.g., Rd or Ave) 31 * specified before the official name</documentation> 32 * </annotation> 33 * </attribute> 34 * <attribute name="officialName" type="string" use="optional"> 35 * <annotation> 36 * <documentation>The name for a street (e.g., Main).</documentation> 37 * </annotation> 38 * </attribute> 39 * <attribute name="typeSuffix" type="string" use="optional"> 40 * <annotation> 41 * <documentation>The street type (e.g., Rd or Ave) 42 * specified after the official name</documentation> 43 * </annotation> 44 * </attribute> 45 * <attribute name="directionalSuffix" type="string" use="optional"> 46 * <annotation> 47 * <documentation>The direction for a street (e.g., North), 48 * placed after the official name.</documentation> 49 * </annotation> 50 * </attribute> 51 * <attribute name="muniOctant" type="gml:CompassPointEnumeration" use="optional" /> 52 * </extension> 53 * </simpleContent> 54 * </complexType> 55 * <element name="Street" type="xls:StreetNameType"> 56 * <annotation> 57 * <documentation>Structured Street Name.</documentation> 58 * </annotation> 59 * </element> 60 * 61 * </pre> 62 * 63 * @author mprins 64 */ 65 public class Street implements XmlNamespaceConstants { 66 /** 67 * serialization id. 68 */ 69 private static final long serialVersionUID = -7318834532989520351L; 70 /** The name for a street (e.g., Main). */ 71 private String street; 72 73 /** The has street. */ 74 private boolean hasStreet; 75 76 /** 77 * Instantiates a new street. 78 */ 79 public Street() { 80 this.hasStreet = false; 81 } 82 83 /** 84 * Sets the street. 85 * 86 * @param street 87 * the new street 88 */ 89 public void setStreet(final String street) { 90 this.hasStreet = true; 91 this.street = street; 92 } 93 94 /** 95 * Gets the street. 96 * 97 * @return the street 98 */ 99 public String getStreet() { 100 return this.street; 101 } 102 103 /** 104 * Checks for street. 105 * 106 * @return true, if successful 107 */ 108 public boolean hasStreet() { 109 return this.hasStreet; 110 } 111 112 /* 113 * (non-Javadoc) 114 * 115 * @see nl.mineleni.openls.XmlNamespaceConstants#toXML() 116 */ 117 @Override 118 public String toXML() { 119 String xml = "<" + XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX 120 + ":Street>"; 121 if (this.hasStreet()) { 122 xml += this.getStreet(); 123 } 124 xml += "</" + XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX 125 + ":Street>"; 126 return xml; 127 } 128 }