if (propertiesByName != null) {
// Add the properties to any existing properties ...
Map<Name, Property> propsByName = request.getPropertiesFor(parent);
if (propsByName == null) propsByName = new HashMap<Name, Property>();
for (Property property : propertiesByName.values()) {
Property existingProperty = propsByName.get(property.getName());
if (existingProperty != null) {
// Merge the property values ...
property = merge(existingProperty, property, propertyFactory, true);
}
propsByName.put(property.getName(), property);
}
request.setProperties(parent, propsByName.values());
}
return;
}
for (Path path : projection.getPathsInRepository(parent.getPath(), pathFactory)) {
if (!path.isAtOrBelow(ancestorPath)) continue;
// Determine the list of children ...
Location parentInFederation = parent.with(path);
if (children != null) {
// Add the children to any existing children ...
List<Location> existing = request.getChildren(parentInFederation);
if (existing == null) existing = new ArrayList<Location>(children.size());
for (Location child : children) {
Path childPath = pathFactory.create(path, child.getPath().getLastSegment());
existing.add(child.with(childPath));
}
request.setChildren(parentInFederation, existing);
}
// Set or update the properties ...
if (propertiesByName != null) {
Map<Name, Property> propsByName = request.getPropertiesFor(parentInFederation);
if (propsByName == null) propsByName = new HashMap<Name, Property>();
for (Property property : propertiesByName.values()) {
Property existingProperty = propsByName.get(property.getName());
if (existingProperty != null) {
// Merge the property values ...
property = merge(existingProperty, property, propertyFactory, true);
}
propsByName.put(property.getName(), property);