Class TLcdFeatureMetaDataProvider

java.lang.Object
com.luciad.format.geojson.TLcdFeatureMetaDataProvider

public class TLcdFeatureMetaDataProvider extends Object
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 Details

    • TLcdFeatureMetaDataProvider

      public TLcdFeatureMetaDataProvider()
  • Method Details

    • getIdPropertyName

      public String getIdPropertyName(Object aObject)
      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's id property. Note that GeoJSON usually assumes the ID to be a string or integer. If you return null, the GeoJSON Feature will be encoded without an id property.
      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

      public Map<String,String> getForeignMembers(Object aObject)
      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, null is returned.
      Parameters:
      aObject - The object for which foreign members are retrieved
      Returns:
      a map with foreign members to be encoded, or null if there are none.
      Since:
      2020.1.05
    • getPropertyNames

      public Set<String> getPropertyNames(Object aDomainObject)
      Returns the names of the properties of an object that must be included in the GeoJSON Feature's property object. All properties except the ID property (See getIdPropertyName(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 Set of property names that must be included in the GeoJson encoded feature. If no properties must be included, an empty array must be returned.
    • getPropertyValue

      public Object getPropertyValue(Object aDomainObject, String aPropertyName)
      This method is used by the TLcdGeoJsonModelEncoder to retrieve the property values of the objects that are being encoded. By default, the object is assumed to be an instance of ILcdDataObject. The property name must exist in the object's TLcdDataType.If you want to use another domain model, you must override this method.
      Parameters:
      aDomainObject - The object for which the property value must be retrieved
      aPropertyName - The name of the property whose value is to be retrieved. These property names will match those that were returned by getPropertyNames(java.lang.Object).
      Returns:
      The property value.
      Throws:
      IllegalArgumentException - if the property cannot be retrieved from the aDomainObject
    • getId

      public Object getId(Object aDomainObject)
      Returns the id of aDomainObject. This is the method that is called by the TLcdGeoJsonModelEncoder to obtain the id of the domain object. The default implementation of this method delegates to getIdPropertyName(Object) and getPropertyValue(Object, String).
      Parameters:
      aDomainObject - The domain object
      Returns:
      The id, or null in case the domain object has no id.
      Since:
      2017.0