de.micromata.opengis.kml.v_2_2_0
Class Kml

java.lang.Object
  extended by de.micromata.opengis.kml.v_2_2_0.Kml
All Implemented Interfaces:
java.lang.Cloneable

public class Kml
extends java.lang.Object
implements java.lang.Cloneable

...

A basic element contains 0 or 1 Feature and 0 or 1 NetworkLinkControl:

The element may also include the namespace for any external XML schemas that are referenced within the file.

The root element of a KML file. This element is required. It follows the xml declaration at the beginning of the file. The hint attribute is used as a signal to Google Earth to display the file as celestial data.

Syntax:
<kml xmlns="http://www.opengis.net/kml/2.2" hint="target=sky"> ... </kml>


Field Summary
protected  Feature feature
          
protected  java.lang.String hint
           
protected  java.util.List<AbstractObject> kmlObjectExtension
          
protected  java.util.List<java.lang.Object> kmlSimpleExtension
           
protected  NetworkLinkControl networkLinkControl
          
 
Constructor Summary
Kml()
           
 
Method Summary
 Kml addToKmlObjectExtension(AbstractObject kmlObjectExtension)
          add a value to the kmlObjectExtension property collection
 Kml addToKmlSimpleExtension(java.lang.Object kmlSimpleExtension)
          add a value to the kmlSimpleExtension property collection
 Kml clone()
           
 Document createAndSetDocument()
          Creates a new instance of Document and set it to feature.
 Folder createAndSetFolder()
          Creates a new instance of Folder and set it to feature.
 GroundOverlay createAndSetGroundOverlay()
          Creates a new instance of GroundOverlay and set it to feature.
 NetworkLink createAndSetNetworkLink()
          Creates a new instance of NetworkLink and set it to feature.
 NetworkLinkControl createAndSetNetworkLinkControl()
          Creates a new instance of NetworkLinkControl and set it to networkLinkControl.
 PhotoOverlay createAndSetPhotoOverlay()
          Creates a new instance of PhotoOverlay and set it to feature.
 Placemark createAndSetPlacemark()
          Creates a new instance of Placemark and set it to feature.
 ScreenOverlay createAndSetScreenOverlay()
          Creates a new instance of ScreenOverlay and set it to feature.
 Tour createAndSetTour()
          Creates a new instance of Tour and set it to feature.
 boolean equals(java.lang.Object obj)
           
 Feature getFeature()
           
 java.lang.String getHint()
           
 java.util.List<AbstractObject> getKmlObjectExtension()
           
 java.util.List<java.lang.Object> getKmlSimpleExtension()
           
 NetworkLinkControl getNetworkLinkControl()
           
 int hashCode()
           
 boolean marshal()
          Java to KML The object graph is printed to the console.
 boolean marshal(org.xml.sax.ContentHandler contenthandler)
          Java to KML The object graph is marshalled to a Contenthandler object.
 boolean marshal(java.io.File filename)
          Java to KML The object graph is marshalled to a File object.
 boolean marshal(java.io.OutputStream outputstream)
          Java to KML The object graph is marshalled to an OutputStream object.
 boolean marshal(java.io.Writer writer)
          Java to KML The object graph is marshalled to a Writer object.
 boolean marshalAsKmz(java.lang.String name, Kml... additionalFiles)
           
 void setFeature(Feature value)
           
 void setHint(java.lang.String value)
           
 void setKmlObjectExtension(java.util.List<AbstractObject> kmlObjectExtension)
           
 void setKmlSimpleExtension(java.util.List<java.lang.Object> kmlSimpleExtension)
           
 void setNetworkLinkControl(NetworkLinkControl value)
           
static Kml unmarshal(java.io.File file)
          KML to Java KML given as a file object is transformed into a graph of Java objects.
static Kml unmarshal(java.io.File file, boolean validate)
          KML to Java KML given as a file object is transformed into a graph of Java objects.
static Kml unmarshal(java.io.InputStream content)
          KML to Java Similar to the other unmarshal methods with the exception that it transforms a InputStream into a graph of Java objects.
static Kml unmarshal(java.lang.String content)
          KML to Java Similar to the other unmarshal methods with the exception that it transforms a String into a graph of Java objects.
static Kml[] unmarshalFromKmz(java.io.File file)
          KMZ to Java Similar to the other unmarshal methods with the exception that it transforms a KMZ-file into a graph of Java objects.
 Kml withFeature(Feature feature)
          fluent setter
 Kml withHint(java.lang.String hint)
          fluent setter
 Kml withKmlObjectExtension(java.util.List<AbstractObject> kmlObjectExtension)
          fluent setter
 Kml withKmlSimpleExtension(java.util.List<java.lang.Object> kmlSimpleExtension)
          fluent setter
 Kml withNetworkLinkControl(NetworkLinkControl networkLinkControl)
          fluent setter
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

networkLinkControl

protected NetworkLinkControl networkLinkControl

Controls the behavior of files fetched by a .

Syntax:
<NetworkLinkControl>
   <minRefreshPeriod>0</minRefreshPeriod>           <!-- float -->
   <maxSessionLength>-1</maxSessionLength>          <!-- float --> 
   <cookie>...</cookie>                             <!-- string -->                             
   <message>...</message>                           <!-- string -->
   <linkName>...</linkName>                         <!-- string -->                          
   <linkDescription>...</linkDescription>           <!-- string -->              
   <linkSnippet maxLines="2">...</linkSnippet>      <!-- string -->                      
   <expires>...</expires>                           <!-- kml:dateTime -->
   <Update>...</Update>                             <!-- Change,Create,Delete -->
   <AbstractView>...</AbstractView>                 <!-- LookAt or Camera -->
 </NetworkLinkControl>
See Also:


feature

protected Feature feature

This is an abstract element and cannot be used directly in a KML file. The following diagram shows how some of a Feature's elements appear in Google Earth.

Syntax:
<!-- abstract element; do not create -->
 <!-- Feature id="ID" -->                <!-- Document,Folder,
                                              NetworkLink,Placemark,
                                              GroundOverlay,PhotoOverlay,ScreenOverlay -->
   <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> <!-- TimeStamp or TimeSpan --> <styleUrl>...</styleUrl> <!-- anyURI --> <StyleSelector>...</StyleSelector> <Region>...</Region> <Metadata>...</Metadata> <!-- deprecated in KML 2.2 --> <ExtendedData>...</ExtendedData> <!-- new in KML 2.2 -->
<-- /Feature -->
Extends:


kmlSimpleExtension

protected java.util.List<java.lang.Object> kmlSimpleExtension

kmlObjectExtension

protected java.util.List<AbstractObject> kmlObjectExtension

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 mechanism is to be used.

Syntax:
<!-- abstract element; do not create -->
 <!-- Object id="ID" targetId="NCName" -->
 <!-- /Object> -->


hint

protected java.lang.String hint
Constructor Detail

Kml

public Kml()
Method Detail

getNetworkLinkControl

public NetworkLinkControl getNetworkLinkControl()
Returns:
possible object is NetworkLinkControl
See Also:
networkLinkControl

setNetworkLinkControl

public void setNetworkLinkControl(NetworkLinkControl value)
Parameters:
value - allowed object is NetworkLinkControl
See Also:
networkLinkControl

getFeature

public Feature getFeature()
Returns:
possible object is <Tour <Container <Document <NetworkLink <GroundOverlay <Folder <PhotoOverlay <Feature <Placemark <Overlay <ScreenOverlay
See Also:
feature

setFeature

public void setFeature(Feature value)
Parameters:
value - allowed object is <Tour <Container <Document <NetworkLink <GroundOverlay <Folder <PhotoOverlay <Feature <Placemark <Overlay <ScreenOverlay
See Also:
feature

getKmlSimpleExtension

public java.util.List<java.lang.Object> getKmlSimpleExtension()
See Also:
kmlSimpleExtension

getKmlObjectExtension

public java.util.List<AbstractObject> getKmlObjectExtension()
See Also:
kmlObjectExtension

getHint

public java.lang.String getHint()
Returns:
possible object is String
See Also:
hint

setHint

public void setHint(java.lang.String value)
Parameters:
value - allowed object is String
See Also:
hint

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

createAndSetNetworkLinkControl

public NetworkLinkControl createAndSetNetworkLinkControl()
Creates a new instance of NetworkLinkControl and set it to networkLinkControl. This method is a short version for: NetworkLinkControl networkLinkControl = new NetworkLinkControl(); this.setNetworkLinkControl(networkLinkControl);


createAndSetTour

public Tour createAndSetTour()
Creates a new instance of Tour and set it to feature. This method is a short version for: Tour tour = new Tour(); this.setFeature(tour);


createAndSetNetworkLink

public NetworkLink createAndSetNetworkLink()
Creates a new instance of NetworkLink and set it to feature. This method is a short version for: NetworkLink networkLink = new NetworkLink(); this.setFeature(networkLink);


createAndSetPhotoOverlay

public PhotoOverlay createAndSetPhotoOverlay()
Creates a new instance of PhotoOverlay and set it to feature. This method is a short version for: PhotoOverlay photoOverlay = new PhotoOverlay(); this.setFeature(photoOverlay);


createAndSetScreenOverlay

public ScreenOverlay createAndSetScreenOverlay()
Creates a new instance of ScreenOverlay and set it to feature. This method is a short version for: ScreenOverlay screenOverlay = new ScreenOverlay(); this.setFeature(screenOverlay);


createAndSetGroundOverlay

public GroundOverlay createAndSetGroundOverlay()
Creates a new instance of GroundOverlay and set it to feature. This method is a short version for: GroundOverlay groundOverlay = new GroundOverlay(); this.setFeature(groundOverlay);


createAndSetDocument

public Document createAndSetDocument()
Creates a new instance of Document and set it to feature. This method is a short version for: Document document = new Document(); this.setFeature(document);


createAndSetFolder

public Folder createAndSetFolder()
Creates a new instance of Folder and set it to feature. This method is a short version for: Folder folder = new Folder(); this.setFeature(folder);


createAndSetPlacemark

public Placemark createAndSetPlacemark()
Creates a new instance of Placemark and set it to feature. This method is a short version for: Placemark placemark = new Placemark(); this.setFeature(placemark);


setKmlSimpleExtension

public void setKmlSimpleExtension(java.util.List<java.lang.Object> kmlSimpleExtension)
Parameters:
kmlSimpleExtension -
See Also:
kmlSimpleExtension

addToKmlSimpleExtension

public Kml addToKmlSimpleExtension(java.lang.Object kmlSimpleExtension)
add a value to the kmlSimpleExtension property collection

Parameters:
kmlSimpleExtension - Objects of the following type are allowed in the list: Object
Returns:
true (as general contract of Collection.add).

setKmlObjectExtension

public void setKmlObjectExtension(java.util.List<AbstractObject> kmlObjectExtension)
Parameters:
kmlObjectExtension -
See Also:
kmlObjectExtension

addToKmlObjectExtension

public Kml addToKmlObjectExtension(AbstractObject kmlObjectExtension)
add a value to the kmlObjectExtension property collection

Parameters:
kmlObjectExtension - Objects of the following type are allowed in the list: AbstractObject
Returns:
true (as general contract of Collection.add).

withNetworkLinkControl

public Kml withNetworkLinkControl(NetworkLinkControl networkLinkControl)
fluent setter

Parameters:
networkLinkControl - required parameter
See Also:
setNetworkLinkControl(NetworkLinkControl)

withFeature

public Kml withFeature(Feature feature)
fluent setter

Parameters:
feature - required parameter
See Also:
setFeature(Feature)

withKmlSimpleExtension

public Kml withKmlSimpleExtension(java.util.List<java.lang.Object> kmlSimpleExtension)
fluent setter

Parameters:
kmlSimpleExtension - required parameter
See Also:
#setKmlSimpleExtension(List)

withKmlObjectExtension

public Kml withKmlObjectExtension(java.util.List<AbstractObject> kmlObjectExtension)
fluent setter

Parameters:
kmlObjectExtension - required parameter
See Also:
#setKmlObjectExtension(List)

withHint

public Kml withHint(java.lang.String hint)
fluent setter

Parameters:
hint - required parameter
See Also:
setHint(String)

marshal

public boolean marshal(java.io.OutputStream outputstream)
                throws java.io.FileNotFoundException
Java to KML The object graph is marshalled to an OutputStream object. The object is not saved as a zipped .kmz file.

Throws:
java.io.FileNotFoundException
See Also:
marshalKmz(String, Kml...)

marshal

public boolean marshal(java.io.Writer writer)
Java to KML The object graph is marshalled to a Writer object. The object is not saved as a zipped .kmz file.

See Also:
marshalKmz(String, Kml...)

marshal

public boolean marshal(org.xml.sax.ContentHandler contenthandler)
Java to KML The object graph is marshalled to a Contenthandler object. Useful if marshaller cis needed to generate CDATA blocks. https://jaxb.dev.java.net/faq/ http://code.google.com/p/javaapiforkml/issues/detail?id=7 The object is not saved as a zipped .kmz file.

See Also:
marshalKmz(String, Kml...)

marshal

public boolean marshal()
Java to KML The object graph is printed to the console. (Nothing is saved, nor saved. Just printed.)


marshal

public boolean marshal(java.io.File filename)
                throws java.io.FileNotFoundException
Java to KML The object graph is marshalled to a File object. The object is not saved as a zipped .kmz file.

Throws:
java.io.FileNotFoundException
See Also:
marshalKmz(String, Kml...)

marshalAsKmz

public boolean marshalAsKmz(
Throws:
java.io.IOException

unmarshal

public static Kml unmarshal(java.io.File file,
                            boolean validate)
KML to Java KML given as a file object is transformed into a graph of Java objects. The boolean value indicates, whether the File object should be validated automatically during unmarshalling and be checked if the object graph meets all constraints defined in OGC's KML schema specification.


unmarshal

public static Kml unmarshal(java.io.File file)
KML to Java KML given as a file object is transformed into a graph of Java objects. Similar to the method: unmarshal(final File, final boolean) with the exception that the File object is not validated (boolean is false).


unmarshal

public static Kml unmarshal(java.lang.String content)
KML to Java Similar to the other unmarshal methods with the exception that it transforms a String into a graph of Java objects.


unmarshal

public static Kml unmarshal(java.io.InputStream content)
KML to Java Similar to the other unmarshal methods with the exception that it transforms a InputStream into a graph of Java objects.


unmarshalFromKmz

public static Kml[] unmarshalFromKmz(
KMZ to Java Similar to the other unmarshal methods with the exception that it transforms a KMZ-file into a graph of Java objects.

Throws:
java.io.IOException

clone

public Kml clone()
Overrides:
clone in class java.lang.Object