use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class MappedLocation method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
map.put("sourceX", this.sourcePixel.getX());
map.put("sourceY", this.sourcePixel.getY());
map.put("target", this.targetPoint.toEwkt());
return map;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class FeatureSource method refreshDo.
@Override
protected void refreshDo() {
final MapEx properties = new LinkedHashMapEx();
final String resourceId = getResourceId();
properties.put("RESOURCEID", resourceId);
final MapGuideWebService webService = getWebService();
final MapEx schemaResource = webService.getJsonResponse("DESCRIBEFEATURESCHEMA", properties);
final MapEx schema = schemaResource.getValue("xs:schema");
if (schema != null) {
final Map<String, String> prefixByUri = new HashMap<>();
for (final String name : schema.keySet()) {
if (name.startsWith("@xmlns:")) {
final String namespaceUri = getString(schema, name);
final String prefix = name.substring(7);
prefixByUri.put(namespaceUri, prefix);
}
}
final String targetNamespace = getString(schema, "@targetNamespace");
final String prefix = prefixByUri.get(targetNamespace);
final Map<String, MapEx> complexTypeDefinitions = new HashMap<>();
for (final MapEx complexType : schema.getValue("xs:complexType", Collections.<MapEx>emptyList())) {
String name = getString(complexType, "@name");
if (prefix != null) {
name = prefix + ":" + name;
}
complexTypeDefinitions.put(name, complexType);
}
final List<FeatureLayer> layers = new ArrayList<>();
final Map<String, FeatureLayer> layerByName = new HashMap<>();
for (final MapEx element : schema.getValue("xs:element", Collections.<MapEx>emptyList())) {
final String name = getString(element, "@name");
final String type = getString(element, "@type");
final MapEx complexType = complexTypeDefinitions.get(type);
final FeatureLayer layer = newLayer(name, element, complexType);
if (layer != null) {
layers.add(layer);
layerByName.put(name.toLowerCase(), layer);
}
this.layers = layers;
this.layerByName = layerByName;
}
}
}
use of com.revolsys.collection.map.LinkedHashMapEx 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;
}
use of com.revolsys.collection.map.LinkedHashMapEx 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;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class MarkerStyle method toMap.
@Override
public MapEx toMap() {
final boolean geometryStyle = this instanceof GeometryStyle;
final MapEx map = new LinkedHashMapEx();
for (final String name : PROPERTY_NAMES) {
if (geometryStyle || name.startsWith("marker")) {
final Object value = Property.get(this, name);
boolean defaultEqual = false;
if (DEFAULT_VALUES.containsKey(name)) {
final Object defaultValue = DEFAULT_VALUES.get(name);
defaultEqual = DataType.equal(defaultValue, value);
}
if (!defaultEqual) {
addToMap(map, name, value);
}
}
}
return map;
}
Aggregations