Package org.codehaus.jra

Examples of org.codehaus.jra.HttpResource


* <a href="http://jra.codehaus.org">Java Rest Annotations</a>.
*/
public class JRAStrategy implements ResourceStrategy {

    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);
       
        return true;
    }
View Full Code Here


*/
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;
    }
View Full Code Here

*/
public class JRAStrategy implements ResourceStrategy {
    private static final Logger LOG = LogUtils.getL7dLogger(JRAStrategy.class);
   
    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;
    }
View Full Code Here

TOP

Related Classes of org.codehaus.jra.HttpResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.