List<OperationResourceInfo> sortedOps = sortOperationsByPath(
cri.getMethodDispatcher().getOperationResourceInfos());
boolean resourceTagOpened = false;
for (int i = 0; i < sortedOps.size(); i++) {
OperationResourceInfo ori = sortedOps.get(i);
if (ori.getHttpMethod() == null) {
Class<?> cls = getMethod(ori).getReturnType();
ClassResourceInfo subcri = cri.findResource(cls, cls);
if (subcri != null && !visitedResources.contains(subcri)) {
startResourceTag(sb, subcri.getServiceClass(), ori.getURITemplate().getValue());
handleDocs(subcri.getServiceClass().getAnnotations(), sb, DocTarget.RESOURCE, true,
isJson);
handlePathAndMatrixParams(sb, ori, isJson);
handleResource(sb, jaxbTypes, qnameResolver, clsMap, subcri,
visitedResources, isJson);
sb.append("</resource>");
} else {
handleDynamicSubresource(sb, jaxbTypes, qnameResolver, clsMap, ori, subcri, isJson);
}
continue;
}
OperationResourceInfo nextOp = i + 1 < sortedOps.size() ? sortedOps.get(i + 1) : null;
resourceTagOpened = handleOperation(sb, jaxbTypes, qnameResolver, clsMap, ori,
classParams, nextOp, resourceTagOpened, isJson, i);
}
}