Search in sources :

Example 41 with MapEx

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

the class ArcGisResponse method newObject.

public static <T extends ObjectWithProperties> T newObject(final Class<T> clazz, final MapEx properties, final String name) {
    final MapEx values = properties.getValue(name);
    if (values == null) {
        return null;
    } else {
        try {
            final T value = clazz.newInstance();
            value.setProperties(values);
            return value;
        } catch (final Throwable t) {
            t.printStackTrace();
            return null;
        }
    }
}
Also used : MapEx(com.revolsys.collection.map.MapEx)

Example 42 with MapEx

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

the class WebServiceConnection method getWebService.

@SuppressWarnings("unchecked")
public <W extends WebService<?>> W getWebService() {
    synchronized (this) {
        if (this.webService == null || this.webService.isClosed()) {
            this.webService = null;
            try {
                final MapEx config = getConfig();
                this.webService = MapObjectFactory.toObject(config);
            } catch (final Throwable e) {
                Exceptions.throwUncheckedException(e);
            }
        }
    }
    return (W) this.webService;
}
Also used : MapEx(com.revolsys.collection.map.MapEx)

Example 43 with MapEx

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

the class WebServiceConnection method refresh.

@Override
public void refresh() {
    final WebService<?> webService = getWebService();
    final MapEx config = getConfig();
    webService.setProperties(config);
    webService.refresh();
}
Also used : MapEx(com.revolsys.collection.map.MapEx)

Example 44 with MapEx

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

the class TestFile method toMap.

@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    map.put("type", "test");
    addToMap(map, "testDescription", this.testDescription);
    final Map<String, Object> properties = getProperties();
    addToMap(map, "properties", properties, Collections.emptyMap());
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 45 with MapEx

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

the class TestCase method toMap.

@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    map.put("type", "test");
    if (Property.hasValue(this.testDescription)) {
        map.put("description", this.testDescription);
    }
    addToMap(map, "geometryFactory", this.geometryFactory);
    final Map<String, Object> properties = new LinkedHashMap<>();
    if (this.testFile != null) {
        addAllToMap(properties, this.testFile.getProperties());
    }
    addToMap(properties, "a", this.a);
    addToMap(properties, "b", this.b);
    if (!properties.isEmpty()) {
        map.put("properties", properties);
    }
    // MapSerializerUtil.add(map, "tests", tests);
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) LinkedHashMap(java.util.LinkedHashMap)

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