use of com.revolsys.collection.map.LinkedHashMapEx 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;
}
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class CsvMapIterator method parseMap.
private MapEx parseMap(final List<String> record) {
final MapEx map = new LinkedHashMapEx();
for (int i = 0; i < this.fieldNames.size() && i < record.size(); i++) {
final String fieldName = this.fieldNames.get(i);
final String value = record.get(i);
if (value != null) {
map.put(fieldName, value);
}
}
return map;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class SpringExpresssionLanguageFilter method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
addTypeToMap(map, "queryFilter");
map.put("query", this.query);
return map;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class MapGuideWebService method getResource.
public Resource getResource(final String operation, final String format, final Map<String, ? extends Object> parameters) throws Error {
final MapEx newParameters = new LinkedHashMapEx(parameters);
newParameters.put("VERSION", "1.0.0");
newParameters.put("OPERATION", operation);
newParameters.put("format", format);
final UrlResource serviceUrl = getServiceUrl();
final UrlResource mapAgentUrl = serviceUrl.newChildResource("mapagent/mapagent.fcgi");
final UrlResource resource = mapAgentUrl.newUrlResource(newParameters);
return resource;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class MapGuideWebService method getResources.
public Map<PathName, MapGuideResource> getResources(final String path) {
final MapEx parameters = new LinkedHashMapEx();
parameters.put("RESOURCEID", "Library:/" + path);
parameters.put("COMPUTECHILDREN", "1");
parameters.put("DEPTH", "-1");
final MapEx response = getJsonResponse("ENUMERATERESOURCES", parameters);
final MapEx resourceList = response.getValue("ResourceList");
final List<MapEx> resourceFolders = resourceList.getValue("ResourceFolder");
final Map<PathName, Folder> folderByPath = new HashMap<>();
final Map<PathName, MapGuideResource> resourceByPath = new HashMap<>();
for (final MapEx resourceDefinition : resourceFolders) {
final Folder folder = new Folder(resourceDefinition);
folder.setWebService(this);
final PathName resourcePath = folder.getPath();
folderByPath.put(resourcePath, folder);
resourceByPath.put(resourcePath, folder);
final PathName parentPath = resourcePath.getParent();
if (parentPath != null) {
final Folder parent = folderByPath.get(parentPath);
parent.addResource(folder);
}
}
final List<MapEx> resourceDocuments = resourceList.getValue("ResourceDocument");
for (final MapEx resourceDefinition : resourceDocuments) {
final List<String> resourceIdList = resourceDefinition.getValue("ResourceId");
final String resourceId = resourceIdList.get(0);
final String resourceType = resourceId.substring(resourceId.lastIndexOf(".") + 1);
final Function<MapEx, ResourceDocument> factory = RESOURCE_DOCUMENT_FACTORIES.get(resourceType);
if (factory != null) {
final ResourceDocument resource = factory.apply(resourceDefinition);
resource.setWebService(this);
final PathName resourcePath = resource.getPath();
resourceByPath.put(resourcePath, resource);
final PathName parentPath = resourcePath.getParent();
if (parentPath != null) {
final Folder parent = folderByPath.get(parentPath);
parent.addResource(resource);
}
} else {
Logs.debug(this, "Unsupported resource type: " + resourceType);
}
}
final Folder root = folderByPath.get(PathName.ROOT);
if (root != null) {
this.root = root;
}
return resourceByPath;
}
Aggregations