ArrayList<Method> matches = uriMethodMappings.get(uri);
LOG.info(new StringBuilder().append("Found methods ")
.append(matches.toString()).append(" ").append(matches.size())
.toString());
Service service =
new Service(identifier, multiUriMappings.get(uri), new Controller(
controller.getType(), controller.getJavadoc(), matches));
services.add(service);
service.assertValid();
JiBXUtils.marshallService(service,
ServiceUtils.serviceFile(dirs, identifier));
identifier++;
}
LOG.info("Processing services...");
Services list = new Services();
for (Service service : services) {
org.apache.commons.collections.Predicate predicate =
new ControllerTypePredicate(service.getController().getType());
if (CollectionUtils.exists(list.getControllers(), predicate)) {
ControllerSummary controller =
(ControllerSummary) CollectionUtils.find(list.getControllers(),
predicate);
controller.addService(service);
} else {
ControllerSummary controller =
new ControllerSummary(service.getController().getType(),
service.getController().getJavadoc());
controller.addService(service);
list.addController(controller);
}
}