use of com.webcohesion.enunciate.util.PathSummaryComparator in project enunciate by stoicflame.
the class AnnotationBasedResourceGroupImpl method getPaths.
@Override
public List<PathSummary> getPaths() {
HashMap<String, PathSummary> paths = new HashMap<String, PathSummary>();
for (Resource resource : this.resources) {
PathSummary pathSummary = paths.get(resource.getPath());
if (pathSummary == null) {
pathSummary = new PathSummaryImpl(resource.getPath(), new TreeSet<String>(), resource.getStyles());
paths.put(resource.getPath(), pathSummary);
}
for (Method method : resource.getMethods()) {
pathSummary.getMethods().add(method.getHttpMethod());
}
}
ArrayList<PathSummary> pathSummaries = new ArrayList<PathSummary>(paths.values());
Collections.sort(pathSummaries, new PathSummaryComparator(sortStrategy));
return pathSummaries;
}
use of com.webcohesion.enunciate.util.PathSummaryComparator in project enunciate by stoicflame.
the class ResourceClassResourceGroupImpl method getPaths.
@Override
public List<PathSummary> getPaths() {
HashMap<String, PathSummary> summaries = new HashMap<String, PathSummary>();
for (Resource resource : this.resources) {
Set<String> methods = new TreeSet<String>();
for (Method method : resource.getMethods()) {
methods.add(method.getHttpMethod());
}
PathSummary summary = summaries.get(resource.getPath());
if (summary == null) {
summary = new PathSummaryImpl(resource.getPath(), methods, resource.getStyles());
summaries.put(resource.getPath(), summary);
} else {
summary.getMethods().addAll(methods);
}
}
ArrayList<PathSummary> pathSummaries = new ArrayList<PathSummary>(summaries.values());
Collections.sort(pathSummaries, new PathSummaryComparator(controllerClass.getContext().getPathSortStrategy()));
return pathSummaries;
}
use of com.webcohesion.enunciate.util.PathSummaryComparator in project enunciate by stoicflame.
the class ResourceClassResourceGroupImpl method getPaths.
@Override
public List<PathSummary> getPaths() {
HashMap<String, PathSummary> summaries = new HashMap<String, PathSummary>();
for (Resource resource : this.resources) {
Set<String> methods = new TreeSet<String>();
for (Method method : resource.getMethods()) {
methods.add(method.getHttpMethod());
}
PathSummary summary = summaries.get(resource.getPath());
if (summary == null) {
summary = new PathSummaryImpl(resource.getPath(), methods, resource.getStyles());
summaries.put(resource.getPath(), summary);
} else {
summary.getMethods().addAll(methods);
}
}
ArrayList<PathSummary> pathSummaries = new ArrayList<PathSummary>(summaries.values());
Collections.sort(pathSummaries, new PathSummaryComparator(resourceClass.getContext().getPathSortStrategy()));
return pathSummaries;
}
use of com.webcohesion.enunciate.util.PathSummaryComparator in project enunciate by stoicflame.
the class AnnotationBasedResourceGroupImpl method getPaths.
@Override
public List<PathSummary> getPaths() {
HashMap<String, PathSummary> paths = new HashMap<String, PathSummary>();
for (Resource resource : this.resources) {
PathSummary pathSummary = paths.get(resource.getPath());
if (pathSummary == null) {
pathSummary = new PathSummaryImpl(resource.getPath(), new TreeSet<String>(), resource.getStyles());
paths.put(resource.getPath(), pathSummary);
}
for (Method method : resource.getMethods()) {
pathSummary.getMethods().add(method.getHttpMethod());
}
}
ArrayList<PathSummary> pathSummaries = new ArrayList<PathSummary>(paths.values());
Collections.sort(pathSummaries, new PathSummaryComparator(sortStrategy));
return pathSummaries;
}
Aggregations