Search in sources :

Example 86 with MapEx

use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.

the class LasPoint8GpsTimeRgbNir method toMap.

@Override
public MapEx toMap() {
    final MapEx map = super.toMap();
    addToMap(map, "nir", this.nir);
    return map;
}
Also used : MapEx(com.revolsys.collection.map.MapEx)

Example 87 with MapEx

use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.

the class Node method getProperties.

@Override
public MapEx getProperties() {
    if (this.graph == null) {
        return MapEx.EMPTY;
    } else {
        final Map<Integer, MapEx> propertiesById = this.graph.getNodePropertiesById();
        MapEx properties = propertiesById.get(this.id);
        if (properties == null) {
            properties = new LinkedHashMapEx();
            propertiesById.put(this.id, properties);
        }
        return properties;
    }
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 88 with MapEx

use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.

the class FolderConnection method toMap.

@Override
public MapEx toMap() {
    final MapEx map = super.toMap();
    addTypeToMap(map, "folderConnection");
    map.put("name", getName());
    map.put("file", this.path.toAbsolutePath().toString());
    return map;
}
Also used : MapEx(com.revolsys.collection.map.MapEx)

Example 89 with MapEx

use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.

the class MapObjectFactory method toObject.

/**
 * Convert the resource specified in the source parameter to an object. The properties parameter
 * will override those specific properties.
 *
 * @param source
 * @param properties
 * @return
 */
static <V> V toObject(final Object source, final Map<String, ? extends Object> properties) {
    final Resource resource = Resource.getResource(source);
    final Resource oldResource = Resource.setBaseResource(resource.getParent());
    try {
        final MapEx resourceProperties = Json.toMap(resource);
        resourceProperties.putAll(properties);
        return toObject(resourceProperties);
    } catch (final Throwable t) {
        Logs.error(MapObjectFactoryRegistry.class, "Cannot load object from " + resource, t);
        return null;
    } finally {
        Resource.setBaseResource(oldResource);
    }
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) PathResource(com.revolsys.spring.resource.PathResource) Resource(com.revolsys.spring.resource.Resource)

Example 90 with MapEx

use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.

the class MapObjectFactory method toObject.

/**
 * Convert the resource specified in the source parameter to an object. The properties parameter
 * will override those specific properties.
 *
 * @param source
 * @param properties
 * @return
 */
static <V> V toObject(final Object source, final Map<String, ? extends Object> properties, final BiConsumer<Resource, Throwable> errorHandler) {
    final Resource resource = Resource.getResource(source);
    final Resource oldResource = Resource.setBaseResource(resource.getParent());
    try {
        final MapEx resourceProperties = Json.toMap(resource);
        resourceProperties.putAll(properties);
        return toObject(resourceProperties);
    } catch (final Throwable t) {
        errorHandler.accept(resource, t);
        return null;
    } finally {
        Resource.setBaseResource(oldResource);
    }
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) PathResource(com.revolsys.spring.resource.PathResource) Resource(com.revolsys.spring.resource.Resource)

Aggregations

MapEx (com.revolsys.collection.map.MapEx)144 LinkedHashMapEx (com.revolsys.collection.map.LinkedHashMapEx)48 ArrayList (java.util.ArrayList)17 Resource (com.revolsys.spring.resource.Resource)9 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)7 Map (java.util.Map)7 HashMap (java.util.HashMap)6 PathName (com.revolsys.io.PathName)5 UrlResource (com.revolsys.spring.resource.UrlResource)5 DataType (com.revolsys.datatype.DataType)4 FieldDefinition (com.revolsys.record.schema.FieldDefinition)4 PathResource (com.revolsys.spring.resource.PathResource)4 Color (java.awt.Color)4 LinkedHashMap (java.util.LinkedHashMap)4 List (java.util.List)4 TreeMap (java.util.TreeMap)4 NamedLinkedHashMapEx (com.revolsys.collection.map.NamedLinkedHashMapEx)3 Geometry (com.revolsys.geometry.model.Geometry)3 LineString (com.revolsys.geometry.model.LineString)3 Record (com.revolsys.record.Record)3