Package com.luciad.format.geojson
Class TLcdFeatureMetaDataProvider
java.lang.Object
com.luciad.format.geojson.TLcdFeatureMetaDataProvider
The
TLcdFeatureMetaDataProvider is used by the GeoJson encoder to retrieve object
specific encoding meta information. This class provides a default implementation (see the
method documentation) which can be overridden as needed.- Since:
- 2012.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetForeignMembers(Object aObject) Returns the foreign members to be encoded for the given domain object.Returns the id ofaDomainObject.getIdPropertyName(Object aObject) Returns the name of the property that holds the ID of the object that is being encoded.getPropertyNames(Object aDomainObject) Returns the names of the properties of an object that must be included in the GeoJSON Feature'spropertyobject.getPropertyValue(Object aDomainObject, String aPropertyName) This method is used by theTLcdGeoJsonModelEncoderto retrieve the property values of the objects that are being encoded.
-
Constructor Details
-
TLcdFeatureMetaDataProvider
public TLcdFeatureMetaDataProvider()
-
-
Method Details
-
getIdPropertyName
Returns the name of the property that holds the ID of the object that is being encoded. This property will be used to determine the value of the GeoJson Feature'sidproperty. Note that GeoJSON usually assumes the ID to be a string or integer. If you returnnull, the GeoJSON Feature will be encoded without anidproperty.- Parameters:
aObject- The object from which the ID must be determined.- Returns:
- the object's ID, or null if the object has no particular ID.
-
getForeignMembers
Returns the foreign members to be encoded for the given domain object. These foreign members represent metadata properties (as key/value pairs) that go beyond the default information to be encoded, i.e. "type", "id", "geometry" and "properties". This can for instance be used to encode additional information that is not part of the object's properties. By default,nullis returned.- Parameters:
aObject- The object for which foreign members are retrieved- Returns:
- a map with foreign members to be encoded, or
nullif there are none. - Since:
- 2020.1.05
-
getPropertyNames
Returns the names of the properties of an object that must be included in the GeoJSON Feature'spropertyobject. All properties except the ID property (SeegetIdPropertyName(Object)are returned. Override this method if other behavior is required.- Parameters:
aDomainObject- The object for which the properties names must be determined- Returns:
- A
Setof property names that must be included in the GeoJson encoded feature. If no properties must be included, an empty array must be returned.
-
getPropertyValue
This method is used by theTLcdGeoJsonModelEncoderto retrieve the property values of the objects that are being encoded. By default, the object is assumed to be an instance ofILcdDataObject. The property name must exist in the object'sTLcdDataType.If you want to use another domain model, you must override this method.- Parameters:
aDomainObject- The object for which the property value must be retrievedaPropertyName- The name of the property whose value is to be retrieved. These property names will match those that were returned bygetPropertyNames(java.lang.Object).- Returns:
- The property value.
- Throws:
IllegalArgumentException- if the property cannot be retrieved from the aDomainObject
-
getId
Returns the id ofaDomainObject. This is the method that is called by theTLcdGeoJsonModelEncoderto obtain the id of the domain object. The default implementation of this method delegates togetIdPropertyName(Object)andgetPropertyValue(Object, String).- Parameters:
aDomainObject- The domain object- Returns:
- The id, or
nullin case the domain object has no id. - Since:
- 2017.0
-