de.micromata.opengis.kml.v_2_2_0
Class ExtendedData

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

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

Adding untyped data/value pairs using the element (basic) Declaring new typed fields using the element and then instancing them using the element (advanced) Referring to XML elements defined in other namespaces by referencing the external namespace within the KML file (basic)

Allows you to add custom data to a KML file. This data can be (1) data that references an external XML schema, (2) untyped data/value pairs, or (3) typed data. A given KML Feature can contain a combination of these types of custom data.

For more information, see Adding Custom Data in "Topics in KML."

The ExtendedData element offers three techniques for adding custom data to a KML Feature (NetworkLink, Placemark, GroundOverlay, PhotoOverlay, ScreenOverlay, Document, Folder). These techniques are

These techniques can be combined within a single KML file or Feature for different pieces of data.

Syntax:
<ExtendedData>                       
<Data name="string">
  <displayName>...</displayName>    <!-- string -->
   <value>...</value>                <!-- string -->
</Data> <SchemaData schemaUrl="anyURI">
<SimpleData name=""> ... </SimpleData>   <!-- string -->
</SchemaData> <namespace_prefix:other>...</namespace_prefix:other> </ExtendedData>
Contained By:


Field Summary
protected  java.util.List<java.lang.Object> any
           
protected  java.util.List<Data> data
          
protected  java.util.List<SchemaData> schemaData
          
 
Constructor Summary
ExtendedData()
           
 
Method Summary
 ExtendedData addToAny(java.lang.Object any)
          add a value to the any property collection
 ExtendedData addToData(Data data)
          add a value to the data property collection
 ExtendedData addToSchemaData(SchemaData schemaData)
          add a value to the schemaData property collection
 ExtendedData clone()
           
 Data createAndAddData(java.lang.String value)
          Creates a new instance of Data and adds it to data.
 SchemaData createAndAddSchemaData()
          Creates a new instance of SchemaData and adds it to schemaData.
 boolean equals(java.lang.Object obj)
           
 java.util.List<java.lang.Object> getAny()
           
 java.util.List<Data> getData()
           
 java.util.List<SchemaData> getSchemaData()
           
 int hashCode()
           
 void setAny(java.util.List<java.lang.Object> any)
           
 void setData(java.util.List<Data> data)
           
 void setSchemaData(java.util.List<SchemaData> schemaData)
           
 ExtendedData withAny(java.util.List<java.lang.Object> any)
          fluent setter
 ExtendedData withData(java.util.List<Data> data)
          fluent setter
 ExtendedData withSchemaData(java.util.List<SchemaData> schemaData)
          fluent setter
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected java.util.List<Data> data

Creates an untyped name/value pair. The name can have two versions: name and displayName. The name attribute is used to identify the data pair within the KML file. The displayName element is used when a properly formatted name, with spaces and HTML formatting, is displayed in Google Earth. In the element of , the notation $[name:displayName] is replaced with . If you substitute the value of the name attribute of the element in this format (for example, $[holeYardage], the attribute value is replaced with . By default, the Placemark's balloon displays the name/value pairs associated with it.


schemaData

protected java.util.List<SchemaData> schemaData

The can be a full URL, a reference to a Schema ID defined in an external KML file, or a reference to a Schema ID defined in the same KML file. All of the following specifications are acceptable:

The Schema element is always a child of Document. The ExtendedData element is a child of the Feature that contains the custom data.

This element is used in conjunction with to add typed custom data to a KML Feature. The Schema element (identified by the schemaUrl attribute) declares the custom data type. The actual data objects ("instances" of the custom data) are defined using the SchemaData element.


any

protected java.util.List<java.lang.Object> any
Constructor Detail

ExtendedData

public ExtendedData()
Method Detail

getData

public java.util.List<Data> getData()
See Also:
data

getSchemaData

public java.util.List<SchemaData> getSchemaData()
See Also:
schemaData

getAny

public java.util.List<java.lang.Object> getAny()
See Also:
any

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

createAndAddData

public Data createAndAddData(java.lang.String value)
Creates a new instance of Data and adds it to data. This method is a short version for: Data data = new Data(); this.getData().add(data);

Parameters:
value - required parameter

createAndAddSchemaData

public SchemaData createAndAddSchemaData()
Creates a new instance of SchemaData and adds it to schemaData. This method is a short version for: SchemaData schemaData = new SchemaData(); this.getSchemaData().add(schemaData);


setData

public void setData(java.util.List<Data> data)
Parameters:
data -
See Also:
data

addToData

public ExtendedData addToData(Data data)
add a value to the data property collection

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

setSchemaData

public void setSchemaData(java.util.List<SchemaData> schemaData)
Parameters:
schemaData -
See Also:
schemaData

addToSchemaData

public ExtendedData addToSchemaData(SchemaData schemaData)
add a value to the schemaData property collection

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

setAny

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

addToAny

public ExtendedData addToAny(java.lang.Object any)
add a value to the any property collection

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

withData

public ExtendedData withData(java.util.List<Data> data)
fluent setter

Parameters:
data - required parameter
See Also:
#setData(List)

withSchemaData

public ExtendedData withSchemaData(java.util.List<SchemaData> schemaData)
fluent setter

Parameters:
schemaData - required parameter
See Also:
#setSchemaData(List)

withAny

public ExtendedData withAny(java.util.List<java.lang.Object> any)
fluent setter

Parameters:
any - required parameter
See Also:
#setAny(List)

clone

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