*/
public class JRAStrategy implements ResourceStrategy {
private static final Logger LOG = Logger.getLogger(JRAStrategy.class.getName());
public boolean map(BindingOperationInfo bop, Method m, URIMapper mapper) {
HttpResource r = m.getAnnotation(HttpResource.class);
if (r == null) {
return false;
}
String verb;
if (m.isAnnotationPresent(Get.class)) {
verb = GET;
} else if (m.isAnnotationPresent(Post.class)) {
verb = POST;
} else if (m.isAnnotationPresent(Put.class)) {
verb = PUT;
} else if (m.isAnnotationPresent(Delete.class)) {
verb = DELETE;
} else {
verb = POST;
}
mapper.bind(bop, r.location(), verb);
LOG.info("Mapping method " + m.getName() + " to resource " + r.location() + " and verb " + verb);
return true;
}