Search in sources :

Example 6 with MapEx

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

the class InvokeConstructorMapObjectFactory method toMap.

@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    map.put("typeName", getTypeName());
    map.put("description", getDescription());
    map.put("typeClass", this.typeClass);
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 7 with MapEx

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

the class MapObjectFactory method toObject.

static <V> V toObject(final Object source) {
    final Resource resource = Resource.getResource(source);
    final Resource oldResource = Resource.setBaseResource(resource.getParent());
    try {
        final MapEx properties = Json.toMap(resource);
        return toObject(properties);
    } 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 8 with MapEx

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

the class InvokeMethodMapObjectFactory method toMap.

@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    map.put("typeName", getTypeName());
    map.put("description", getDescription());
    map.put("typeClass", this.typeClass);
    map.put("methodName", this.methodName);
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 9 with MapEx

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

the class MavenPom method getDependencyVersions.

public Map<String, String> getDependencyVersions() {
    final Map<String, String> versions = new HashMap<>();
    final MavenPom parent = getParentPom();
    if (parent != null) {
        versions.putAll(parent.getDependencyVersions());
    }
    final MapEx dependencyManagement = getProperty("dependencyManagement");
    if (dependencyManagement != null) {
        final MapEx dependencyMap = dependencyManagement.getValue("dependencies");
        if (dependencyMap != null) {
            final List<MapEx> dependencyList = getList(dependencyMap, "dependency");
            if (dependencyList != null) {
                for (final MapEx dependency : dependencyList) {
                    final String groupId = getMapValue(dependency, "groupId", null);
                    final String artifactId = getMapValue(dependency, "artifactId", null);
                    final String version = getMapValue(dependency, "version", null);
                    versions.put(groupId + ":" + artifactId, version);
                }
            }
        }
    }
    return versions;
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx)

Example 10 with MapEx

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

the class MavenPom method getPomProperties.

@Override
public MapEx getPomProperties() {
    if (this.pomProperties == null) {
        return MapEx.EMPTY;
    } else {
        if (this.mergedPomProperties == null) {
            final MapEx properties = new LinkedHashMapEx();
            final MavenPom parentPom = getParentPom();
            if (parentPom != null) {
                final MapEx parentProperties = parentPom.getPomProperties();
                properties.putAll(parentProperties);
            }
            properties.putAll(this.pomProperties);
            properties.put("project.artifactId", getArtifactId());
            properties.put("project.version", getVersion());
            properties.put("project.groupId", getGroupId());
            this.mergedPomProperties = properties;
        }
        return this.mergedPomProperties;
    }
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

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