View Javadoc
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   * &lt;complexType name="StreetNameType"&gt;
11   *   &lt;annotation&gt;
12   *     &lt;documentation&gt;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   *     &lt;Street directionalPrefix="W" officialName="83RD" typeSuffix="ST" /&gt;
18   *     &lt;/documentation&gt;
19   *   &lt;/annotation&gt;
20   *   &lt;simpleContent&gt;
21   *     &lt;extension base="string"&gt;
22   *       &lt;attribute name="directionalPrefix" type="string" use="optional"&gt;
23   *         &lt;annotation&gt;
24   *           &lt;documentation&gt;The direction for a street (e.g., North),
25   *           placed before the official name.&lt;/documentation&gt;
26   *         &lt;/annotation&gt;
27   *       &lt;/attribute&gt;
28   *       &lt;attribute name="typePrefix" type="string" use="optional"&gt;
29   *         &lt;annotation&gt;
30   *           &lt;documentation&gt;The street type (e.g., Rd or Ave)
31   *           specified before the official name&lt;/documentation&gt;
32   *         &lt;/annotation&gt;
33   *       &lt;/attribute&gt;
34   *       &lt;attribute name="officialName" type="string" use="optional"&gt;
35   *         &lt;annotation&gt;
36   *           &lt;documentation&gt;The name for a street (e.g., Main).&lt;/documentation&gt;
37   *         &lt;/annotation&gt;
38   *       &lt;/attribute&gt;
39   *       &lt;attribute name="typeSuffix" type="string" use="optional"&gt;
40   *         &lt;annotation&gt;
41   *           &lt;documentation&gt;The street type (e.g., Rd or Ave)
42   *           specified after the official name&lt;/documentation&gt;
43   *         &lt;/annotation&gt;
44   *       &lt;/attribute&gt;
45   *       &lt;attribute name="directionalSuffix" type="string" use="optional"&gt;
46   *         &lt;annotation&gt;
47   *           &lt;documentation&gt;The direction for a street (e.g., North),
48   *           placed after the official name.&lt;/documentation&gt;
49   *         &lt;/annotation&gt;
50   *       &lt;/attribute&gt;
51   *       &lt;attribute name="muniOctant" type="gml:CompassPointEnumeration" use="optional" /&gt;
52   *     &lt;/extension&gt;
53   *   &lt;/simpleContent&gt;
54   * &lt;/complexType&gt;
55   * &lt;element name="Street" type="xls:StreetNameType"&gt;
56   *   &lt;annotation&gt;
57   *     &lt;documentation&gt;Structured Street Name.&lt;/documentation&gt;
58   *   &lt;/annotation&gt;
59   * &lt;/element&gt;
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 }