public class ExtendedData extends Object implements Cloneable
Adding untyped data/value pairs using the element (basic) Declaring new typed
fields using the
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>Contained By:
<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>
| Modifier and Type | Field and Description |
|---|---|
protected List<Object> |
any |
protected List<Data> |
data
Creates an untyped name/value pair.
|
protected List<SchemaData> |
schemaData
|
| Constructor and Description |
|---|
ExtendedData() |
| Modifier and Type | Method and Description |
|---|---|
ExtendedData |
addToAny(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(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(Object obj) |
List<Object> |
getAny() |
List<Data> |
getData() |
List<SchemaData> |
getSchemaData() |
int |
hashCode() |
void |
setAny(List<Object> any) |
void |
setData(List<Data> data) |
void |
setSchemaData(List<SchemaData> schemaData) |
ExtendedData |
withAny(List<Object> any)
fluent setter
|
ExtendedData |
withData(List<Data> data)
fluent setter
|
ExtendedData |
withSchemaData(List<SchemaData> schemaData)
fluent setter
|
protected 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
protected List<SchemaData> schemaData
The
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
public List<SchemaData> getSchemaData()
schemaDatapublic Data createAndAddData(String value)
Data and adds it to data.
This method is a short version for:
Data data = new Data();
this.getData().add(data); value - required parameterpublic SchemaData createAndAddSchemaData()
SchemaData and adds it to schemaData.
This method is a short version for:
SchemaData schemaData = new SchemaData();
this.getSchemaData().add(schemaData); public ExtendedData addToData(Data data)
data - Objects of the following type are allowed in the list: Datapublic void setSchemaData(List<SchemaData> schemaData)
schemaData - schemaDatapublic ExtendedData addToSchemaData(SchemaData schemaData)
schemaData - Objects of the following type are allowed in the list: SchemaDatapublic ExtendedData addToAny(Object any)
public ExtendedData withData(List<Data> data)
data - required parameter#setData(List)public ExtendedData withSchemaData(List<SchemaData> schemaData)
schemaData - required parameter#setSchemaData(List) public ExtendedData withAny(List<Object> any)
any - required parameter#setAny(Listpublic ExtendedData clone()
Copyright © 2014 Micromata GmbH. All rights reserved.