Class: KmlElementsFactory

KmlElementsFactory()

new KmlElementsFactory()

Simple factory, which understands the mapping between the XML and the internal Elements.
Source:

Methods

(static) applicationWide() → {KmlElementsFactory}

It returns application wide instance of the factory.
Source:
Returns:
Singleton instance of factory for Application.
Type
KmlElementsFactory

all(element) → {Array.<KmlObject>}

It returns all children, which it is possible to map on the KmlObject.
Parameters:
Name Type Description
element KmlObject Element whose children we want to retrieve.
Source:
Returns:
All KmlObjects present in given node.
Type
Array.<KmlObject>

any(element, options) → {KmlObject}

It returns child which is among the ones in the options.name. It is meant to be used when any descendant is accepted.
Parameters:
Name Type Description
element KmlObject Element whose children are scanned.
options Object
Properties
Name Type Description
name Array.<String> All names which are accepted to return.
Source:
Returns:
Kml representation of given node
Type
KmlObject

specific(element, options)

It retrieves specific child of the element. This one can retrieve primitive as well as KmlObject. Transformer is used to get relevant value from the node.
Parameters:
Name Type Description
element KmlObject Element whose children are considered.
options Object
Properties
Name Type Description
name String Name of the element to retrieve from the element
transformer function Function returning correct value. It accepts the node and returns value. This mechanism can be used for the attributes as well.
Source:
Returns:
Relevant value.