View Javadoc
1   package nl.geozet.openls.databinding.openls;
2   
3   import nl.geozet.openls.databinding.common.XmlNamespaceConstants;
4   
5   public class Place {
6       /*
7        * http://schemas.opengis.net/ols/1.2.0/ADT.xsd
8        * 
9        * <element name="Place" type="xls:NamedPlaceType"> <annotation>
10       * <documentation>Place represents a hierarchical set of geographic
11       * regions/placenames: country subdivision, country secondary subdivision,
12       * municipality, and municipality subdivision.</documentation> </annotation>
13       * </element> <complexType name="NamedPlaceType"> <annotation>
14       * <documentation> The NamedPlaceType defines a named place within an
15       * AddressType. A named place has a classification (such as country, country
16       * subdivision, or municipality). </documentation> </annotation>
17       * <simpleContent> <extension base="string"> <attribute name="type"
18       * type="xls:NamedPlaceClassification" use="required"/> </extension>
19       * </simpleContent> </complexType>
20       */
21      private String type;
22      private String place;
23  
24      private boolean hasType;
25      private boolean hasPlace;
26  
27      public Place() {
28          this.hasType = false;
29          this.hasPlace = false;
30      }
31  
32      public void setType(String type) {
33          this.hasType = true;
34          this.type = type;
35      }
36  
37      public String getType() {
38          return type;
39      }
40  
41      public boolean hasType() {
42          return this.hasType;
43      }
44  
45      public void setPlace(String place) {
46          this.hasPlace = true;
47          this.place = place;
48      }
49  
50      public String getPlace() {
51          return place;
52      }
53  
54      public boolean hasPlace() {
55          return this.hasPlace;
56      }
57  
58      public String toXML() {
59          String xml = "<" + XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX
60                  + ":Place";
61          if (hasType())
62              xml += " type=\"" + getType() + "\"";
63          xml += ">";
64          if (hasPlace())
65              xml += getPlace();
66          xml += "</" + XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX + ":Place>";
67          return xml;
68      }
69  }