All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.micromata.opengis.kml.v_2_2_0.Placemark Maven / Gradle / Ivy

Go to download

This is JavaAPIforKMml, Micromata's library for use with applications that want to parse, generate and operate on KML. It is an implementation of the OGC KML 2.2 standard. It is written entirely in Java and makes heavy use of JAXB.

There is a newer version: 3.0.4
Show newest version

package de.micromata.opengis.kml.v_2_2_0;

import de.micromata.opengis.kml.v_2_2_0.annotations.Obvious;
import de.micromata.opengis.kml.v_2_2_0.atom.Author;
import de.micromata.opengis.kml.v_2_2_0.atom.Link;
import de.micromata.opengis.kml.v_2_2_0.gx.MultiTrack;
import de.micromata.opengis.kml.v_2_2_0.gx.Track;
import de.micromata.opengis.kml.v_2_2_0.xal.AddressDetails;
import jakarta.xml.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;


/**
 * {@code }
 * 

* A Placemark is a Feature with associated Geometry. In Google Earth, a Placemark * appears as a list item in the Places panel. A Placemark with a Point has an icon * associated with it that marks a point on the Earth in the 3D viewer. (In the Google * Earth 3D viewer, a Point Placemark is the only object you can click or roll over. * Other Geometry objects do not have an icon in the 3D viewer. To give the user something * to click in the 3D viewer, you would need to create a MultiGeometry object that * contains both a Point and the other Geometry object.) *

* * Syntax: *
<Placemark id="ID">
 *   <!-- inherited from Feature element -->
 *   <name>...</name>                      <!-- string -->
 *   <visibility>1</visibility>            <!-- boolean -->
 *   <open>0</open>                        <!-- boolean -->
 *   <atom:author>...<atom:author>         <!-- xmlns:atom -->
 *   <atom:link>...</atom:link>            <!-- xmlns:atom -->
 *   <address>...</address>                <!-- string -->
 *   <xal:AddressDetails>...</xal:AddressDetails>  <!-- xmlns:xal -->
<phoneNumber>...</phoneNumber> <!-- string -->
<Snippet maxLines="2">...</Snippet> <!-- string --> * <description>...</description> <!-- string --> * <AbstractView>...</AbstractView> <!-- Camera or LookAt --> * <TimePrimitive>...</TimePrimitive> * <styleUrl>...</styleUrl> <!-- anyURI --> * <StyleSelector>...</StyleSelector> * <Region>...</Region> * <Metadata>...</Metadata> <!-- deprecated in KML 2.2 --> * <ExtendedData>...</ExtendedData> <!-- new in KML 2.2 -->
* <!-- specific to Placemark element --> * <Geometry>...</Geometry> * </Placemark>
* * Extends: * * * Contained By: * * * * See Also: * {@code } * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PlacemarkType", propOrder = { "geometry", "placemarkSimpleExtension", "placemarkObjectExtension" }) @XmlRootElement(name = "Placemark", namespace = "http://www.opengis.net/kml/2.2") public class Placemark extends Feature implements Cloneable { /** * {@code } *

* This is an abstract element and cannot be used directly in a KML file. It provides * a placeholder object for all derived Geometry objects. *

* * Syntax: *
<!-- abstract element; do not create -->
     * <!-- Geometry id="ID" -->                 <!-- Point,LineString,LinearRing,
     *                                                Polygon,MultiGeometry,Model -->
     * <!-- /Geometry -->
* * Extends: * * * Extended By: * * * * * * * * * */ @XmlElementRef(name = "AbstractGeometryGroup", namespace = "http://www.opengis.net/kml/2.2", required = false) protected Geometry geometry; @XmlElement(name = "PlacemarkSimpleExtensionGroup") @XmlSchemaType(name = "anySimpleType") protected List placemarkSimpleExtension; /** * {@code } *

* This is an abstract base class and cannot be used directly in a KML file. It provides * the id attribute, which allows unique identification of a KML element, and the targetId * attribute, which is used to reference objects that have already been loaded into * Google Earth. The id attribute must be assigned if the Update mechanism is to * be used. *

* * Syntax: *
<!-- abstract element; do not create -->
     * <!-- Object id="ID" targetId="NCName" -->
     * <!-- /Object> -->
* * * */ @XmlElement(name = "PlacemarkObjectExtensionGroup") protected List placemarkObjectExtension; public Placemark() { super(); } /** * * * @return * possible object is * {@code <}{@link Geometry}{@code >} * {@code <}{@link Point}{@code >} * {@code <}{@link LinearRing}{@code >} * {@code <}{@link Polygon}{@code >} * {@code <}{@link Track}{@code >} * {@code <}{@link MultiTrack}{@code >} * {@code <}{@link Model}{@code >} * {@code <}{@link LineString}{@code >} * {@code <}{@link MultiGeometry}{@code >} * */ public Geometry getGeometry() { return geometry; } /** * * * @param value * allowed object is * {@code <}{@link Geometry}{@code >} * {@code <}{@link Point}{@code >} * {@code <}{@link LinearRing}{@code >} * {@code <}{@link Polygon}{@code >} * {@code <}{@link Track}{@code >} * {@code <}{@link MultiTrack}{@code >} * {@code <}{@link Model}{@code >} * {@code <}{@link LineString}{@code >} * {@code <}{@link MultiGeometry}{@code >} * */ public void setGeometry(Geometry value) { this.geometry = ((Geometry ) value); } /** * * */ public List getPlacemarkSimpleExtension() { if (placemarkSimpleExtension == null) { placemarkSimpleExtension = new ArrayList(); } return this.placemarkSimpleExtension; } /** * * */ public List getPlacemarkObjectExtension() { if (placemarkObjectExtension == null) { placemarkObjectExtension = new ArrayList(); } return this.placemarkObjectExtension; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = ((prime*result)+((geometry == null)? 0 :geometry.hashCode())); result = ((prime*result)+((placemarkSimpleExtension == null)? 0 :placemarkSimpleExtension.hashCode())); result = ((prime*result)+((placemarkObjectExtension == null)? 0 :placemarkObjectExtension.hashCode())); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (super.equals(obj) == false) { return false; } if ((obj instanceof Placemark) == false) { return false; } Placemark other = ((Placemark) obj); if (geometry == null) { if (other.geometry!= null) { return false; } } else { if (geometry.equals(other.geometry) == false) { return false; } } if (placemarkSimpleExtension == null) { if (other.placemarkSimpleExtension!= null) { return false; } } else { if (placemarkSimpleExtension.equals(other.placemarkSimpleExtension) == false) { return false; } } if (placemarkObjectExtension == null) { if (other.placemarkObjectExtension!= null) { return false; } } else { if (placemarkObjectExtension.equals(other.placemarkObjectExtension) == false) { return false; } } return true; } /** * Creates a new instance of {@link MultiTrack} and set it to geometry. * * This method is a short version for: * {@code * MultiTrack multiTrack = new MultiTrack(); * this.setGeometry(multiTrack); } * * */ public MultiTrack createAndSetMultiTrack() { MultiTrack newValue = new MultiTrack(); this.setGeometry(newValue); return newValue; } /** * Creates a new instance of {@link Track} and set it to geometry. * * This method is a short version for: * {@code * Track track = new Track(); * this.setGeometry(track); } * * */ public Track createAndSetTrack() { Track newValue = new Track(); this.setGeometry(newValue); return newValue; } /** * Creates a new instance of {@link LinearRing} and set it to geometry. * * This method is a short version for: * {@code * LinearRing linearRing = new LinearRing(); * this.setGeometry(linearRing); } * * */ public LinearRing createAndSetLinearRing() { LinearRing newValue = new LinearRing(); this.setGeometry(newValue); return newValue; } /** * Creates a new instance of {@link Point} and set it to geometry. * * This method is a short version for: * {@code * Point point = new Point(); * this.setGeometry(point); } * * */ public Point createAndSetPoint() { Point newValue = new Point(); this.setGeometry(newValue); return newValue; } /** * Creates a new instance of {@link Model} and set it to geometry. * * This method is a short version for: * {@code * Model model = new Model(); * this.setGeometry(model); } * * */ public Model createAndSetModel() { Model newValue = new Model(); this.setGeometry(newValue); return newValue; } /** * Creates a new instance of {@link MultiGeometry} and set it to geometry. * * This method is a short version for: * {@code * MultiGeometry multiGeometry = new MultiGeometry(); * this.setGeometry(multiGeometry); } * * */ public MultiGeometry createAndSetMultiGeometry() { MultiGeometry newValue = new MultiGeometry(); this.setGeometry(newValue); return newValue; } /** * Creates a new instance of {@link LineString} and set it to geometry. * * This method is a short version for: * {@code * LineString lineString = new LineString(); * this.setGeometry(lineString); } * * */ public LineString createAndSetLineString() { LineString newValue = new LineString(); this.setGeometry(newValue); return newValue; } /** * Creates a new instance of {@link Polygon} and set it to geometry. * * This method is a short version for: * {@code * Polygon polygon = new Polygon(); * this.setGeometry(polygon); } * * */ public Polygon createAndSetPolygon() { Polygon newValue = new Polygon(); this.setGeometry(newValue); return newValue; } /** * * * @param placemarkSimpleExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setPlacemarkSimpleExtension(final List placemarkSimpleExtension) { this.placemarkSimpleExtension = placemarkSimpleExtension; } /** * add a value to the placemarkSimpleExtension property collection * * @param placemarkSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public Placemark addToPlacemarkSimpleExtension(final Object placemarkSimpleExtension) { this.getPlacemarkSimpleExtension().add(placemarkSimpleExtension); return this; } /** * * * @param placemarkObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} */ public void setPlacemarkObjectExtension(final List placemarkObjectExtension) { this.placemarkObjectExtension = placemarkObjectExtension; } /** * add a value to the placemarkObjectExtension property collection * * @param placemarkObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * true (as general contract of Collection.add). */ public Placemark addToPlacemarkObjectExtension(final AbstractObject placemarkObjectExtension) { this.getPlacemarkObjectExtension().add(placemarkObjectExtension); return this; } /** * * */ @Obvious @Override public void setObjectSimpleExtension(final List objectSimpleExtension) { super.setObjectSimpleExtension(objectSimpleExtension); } @Obvious @Override public Placemark addToObjectSimpleExtension(final Object objectSimpleExtension) { super.getObjectSimpleExtension().add(objectSimpleExtension); return this; } /** * * */ @Obvious @Override public void setStyleSelector(final List styleSelector) { super.setStyleSelector(styleSelector); } @Obvious @Override public Placemark addToStyleSelector(final StyleSelector styleSelector) { super.getStyleSelector().add(styleSelector); return this; } /** * * */ @Obvious @Override public void setFeatureSimpleExtension(final List featureSimpleExtension) { super.setFeatureSimpleExtension(featureSimpleExtension); } @Obvious @Override public Placemark addToFeatureSimpleExtension(final Object featureSimpleExtension) { super.getFeatureSimpleExtension().add(featureSimpleExtension); return this; } /** * * */ @Obvious @Override public void setFeatureObjectExtension(final List featureObjectExtension) { super.setFeatureObjectExtension(featureObjectExtension); } @Obvious @Override public Placemark addToFeatureObjectExtension(final AbstractObject featureObjectExtension) { super.getFeatureObjectExtension().add(featureObjectExtension); return this; } /** * fluent setter * * * @param geometry * required parameter */ public Placemark withGeometry(final Geometry geometry) { this.setGeometry(geometry); return this; } /** * fluent setter * * * @param placemarkSimpleExtension * required parameter */ public Placemark withPlacemarkSimpleExtension(final List placemarkSimpleExtension) { this.setPlacemarkSimpleExtension(placemarkSimpleExtension); return this; } /** * fluent setter * * * @param placemarkObjectExtension * required parameter */ public Placemark withPlacemarkObjectExtension(final List placemarkObjectExtension) { this.setPlacemarkObjectExtension(placemarkObjectExtension); return this; } @Obvious @Override public Placemark withObjectSimpleExtension(final List objectSimpleExtension) { super.withObjectSimpleExtension(objectSimpleExtension); return this; } @Obvious @Override public Placemark withId(final String id) { super.withId(id); return this; } @Obvious @Override public Placemark withTargetId(final String targetId) { super.withTargetId(targetId); return this; } @Obvious @Override public Placemark withName(final String name) { super.withName(name); return this; } @Obvious @Override public Placemark withVisibility(final Boolean visibility) { super.withVisibility(visibility); return this; } @Obvious @Override public Placemark withOpen(final Boolean open) { super.withOpen(open); return this; } @Obvious @Override public Placemark withAtomAuthor(final Author atomAuthor) { super.withAtomAuthor(atomAuthor); return this; } @Obvious @Override public Placemark withAtomLink(final Link atomLink) { super.withAtomLink(atomLink); return this; } @Obvious @Override public Placemark withAddress(final String address) { super.withAddress(address); return this; } @Obvious @Override public Placemark withXalAddressDetails(final AddressDetails xalAddressDetails) { super.withXalAddressDetails(xalAddressDetails); return this; } @Obvious @Override public Placemark withPhoneNumber(final String phoneNumber) { super.withPhoneNumber(phoneNumber); return this; } @Obvious @Override public Placemark withSnippet(final Snippet snippet) { super.withSnippet(snippet); return this; } @Obvious @Override public Placemark withSnippetd(final String snippetd) { super.withSnippetd(snippetd); return this; } @Obvious @Override public Placemark withDescription(final String description) { super.withDescription(description); return this; } @Obvious @Override public Placemark withAbstractView(final AbstractView abstractView) { super.withAbstractView(abstractView); return this; } @Obvious @Override public Placemark withTimePrimitive(final TimePrimitive timePrimitive) { super.withTimePrimitive(timePrimitive); return this; } @Obvious @Override public Placemark withStyleUrl(final String styleUrl) { super.withStyleUrl(styleUrl); return this; } @Obvious @Override public Placemark withStyleSelector(final List styleSelector) { super.withStyleSelector(styleSelector); return this; } @Obvious @Override public Placemark withRegion(final Region region) { super.withRegion(region); return this; } @Obvious @Override public Placemark withMetadata(final Metadata metadata) { super.withMetadata(metadata); return this; } @Obvious @Override public Placemark withExtendedData(final ExtendedData extendedData) { super.withExtendedData(extendedData); return this; } @Obvious @Override public Placemark withFeatureSimpleExtension(final List featureSimpleExtension) { super.withFeatureSimpleExtension(featureSimpleExtension); return this; } @Obvious @Override public Placemark withFeatureObjectExtension(final List featureObjectExtension) { super.withFeatureObjectExtension(featureObjectExtension); return this; } @Override public Placemark clone() { Placemark copy; copy = ((Placemark) super.clone()); copy.geometry = ((geometry == null)?null:((Geometry ) geometry.clone())); copy.placemarkSimpleExtension = new ArrayList((getPlacemarkSimpleExtension().size())); for (Object iter: placemarkSimpleExtension) { copy.placemarkSimpleExtension.add(iter); } copy.placemarkObjectExtension = new ArrayList((getPlacemarkObjectExtension().size())); for (AbstractObject iter: placemarkObjectExtension) { copy.placemarkObjectExtension.add(iter.clone()); } return copy; } }