// append value of method's @Path annotation
MethodList methods = new MethodList(link.resource());
methods = methods.withMetaAnnotation(HttpMethod.class);
Iterator<AnnotatedMethod> iterator = methods.iterator();
while (iterator.hasNext()) {
AnnotatedMethod method = iterator.next();
if (!method.getMethod().getName().equals(link.method())) {
continue;
}
StringBuilder builder = new StringBuilder();
builder.append(template);
Path methodPath = method.getAnnotation(Path.class);
if (methodPath != null) {
String methodTemplate = methodPath.value();
if (!(template.endsWith("/") || methodTemplate.startsWith("/"))) {
builder.append("/");
}
builder.append(methodTemplate);
}
// append query parameters
StringBuilder querySubString = new StringBuilder();
for (Annotation paramAnns[] : method.getParameterAnnotations()) {
for (Annotation ann : paramAnns) {
if (ann.annotationType() == QueryParam.class) {
querySubString.append(((QueryParam) ann).value());
querySubString.append(',');
}