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

de.micromata.opengis.kml.v_2_2_0.Update 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 jakarta.xml.bind.annotation.*;

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


/**
 * Update
 * 

* Specifies an addition, change, or deletion to KML data that has already been loaded * using the specified URL. The targetHref specifies the .kml or .kmz file whose * data (within Google Earth) is to be modified. Update is always contained in a * NetworkLinkControl. Furthermore, the file containing the NetworkLinkControl must * have been loaded by a NetworkLink. See the "Topics in KML" page on Updates for a * detailed example of how Update works. *

*

* With Update, you can specify any number of Change, Create, and Delete tags for * a .kml file or .kmz archive that has previously been loaded with a network link. * See Update. *

* * Syntax: *
<Update>
 *   <targetHref>...<targetHref>    <!-- URL -->
 *   <Change>...</Change>
 *   <Create>...</Create>
 *   <Delete>...</Delete>
 * </Update>
* * Contained By: * * * * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "UpdateType", propOrder = { "targetHref", "createOrDeleteOrChange", "updateExtension" }) @XmlRootElement(name = "Update", namespace = "http://www.opengis.net/kml/2.2") public class Update implements Cloneable { /** * targetHref (required) *

* A URL that specifies the .kml or .kmz file whose data (within Google Earth) is to * be modified by an Update element. This KML file must already have been loaded * via a NetworkLink. In that file, the element to be modified must already have * an explicit id attribute defined for it. *

*

* Specifies the texture file to be fetched by Google Earth. This reference can be * a relative reference to an image file within the .kmz archive, or it can be an absolute * reference to the file (for example, a URL). *

* * * */ @XmlElement(required = true) @XmlSchemaType(name = "anyURI") protected String targetHref; @XmlElements({ @XmlElement(name = "UpdateOpExtensionGroup"), @XmlElement(name = "Change", type = Change.class), @XmlElement(name = "Delete", type = Delete.class), @XmlElement(name = "Create", type = Create.class) }) protected List createOrDeleteOrChange; @XmlElement(name = "UpdateExtensionGroup") protected List updateExtension; /** * Value constructor with only mandatory fields * * @param createOrDeleteOrChange * required parameter * @param targetHref * required parameter */ public Update(final String targetHref, final List createOrDeleteOrChange) { super(); this.targetHref = targetHref; this.createOrDeleteOrChange = createOrDeleteOrChange; } /** * Default no-arg constructor is private. Use overloaded constructor instead! (Temporary solution, till a better and more suitable ObjectFactory is created.) * */ @Deprecated private Update() { super(); } /** * * * @return * possible object is * {@link String} * */ public String getTargetHref() { return targetHref; } /** * * * @param value * allowed object is * {@link String} * */ public void setTargetHref(String value) { this.targetHref = value; } /** * * */ public List getCreateOrDeleteOrChange() { if (createOrDeleteOrChange == null) { createOrDeleteOrChange = new ArrayList(); } return this.createOrDeleteOrChange; } /** * * */ public List getUpdateExtension() { if (updateExtension == null) { updateExtension = new ArrayList(); } return this.updateExtension; } @Override public int hashCode() { final int prime = 31; int result = 1; result = ((prime*result)+((targetHref == null)? 0 :targetHref.hashCode())); result = ((prime*result)+((createOrDeleteOrChange == null)? 0 :createOrDeleteOrChange.hashCode())); result = ((prime*result)+((updateExtension == null)? 0 :updateExtension.hashCode())); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if ((obj instanceof Update) == false) { return false; } Update other = ((Update) obj); if (targetHref == null) { if (other.targetHref!= null) { return false; } } else { if (targetHref.equals(other.targetHref) == false) { return false; } } if (createOrDeleteOrChange == null) { if (other.createOrDeleteOrChange!= null) { return false; } } else { if (createOrDeleteOrChange.equals(other.createOrDeleteOrChange) == false) { return false; } } if (updateExtension == null) { if (other.updateExtension!= null) { return false; } } else { if (updateExtension.equals(other.updateExtension) == false) { return false; } } return true; } /** * * * @param createOrDeleteOrChange * Objects of the following type are allowed in the list: {@link Object}{@link Change}{@link Delete}{@link Create} */ public void setCreateOrDeleteOrChange(final List createOrDeleteOrChange) { this.createOrDeleteOrChange = createOrDeleteOrChange; } /** * add a value to the createOrDeleteOrChange property collection * * @param createOrDeleteOrChange * Objects of the following type are allowed in the list: {@link Object}{@link Change}{@link Delete}{@link Create} * @return * true (as general contract of Collection.add). */ public Update addToCreateOrDeleteOrChange(final Object createOrDeleteOrChange) { this.getCreateOrDeleteOrChange().add(createOrDeleteOrChange); return this; } /** * * * @param updateExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setUpdateExtension(final List updateExtension) { this.updateExtension = updateExtension; } /** * add a value to the updateExtension property collection * * @param updateExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public Update addToUpdateExtension(final Object updateExtension) { this.getUpdateExtension().add(updateExtension); return this; } /** * fluent setter * * * @param updateExtension * required parameter */ public Update withUpdateExtension(final List updateExtension) { this.setUpdateExtension(updateExtension); return this; } @Override public Update clone() { Update copy; try { copy = ((Update) super.clone()); } catch (CloneNotSupportedException _x) { throw new InternalError((_x.toString())); } copy.createOrDeleteOrChange = new ArrayList((getCreateOrDeleteOrChange().size())); for (Object iter: createOrDeleteOrChange) { copy.createOrDeleteOrChange.add(iter); } copy.updateExtension = new ArrayList((getUpdateExtension().size())); for (Object iter: updateExtension) { copy.updateExtension.add(iter); } return copy; } }