Package com.sun.jersey.api.model

Examples of com.sun.jersey.api.model.AbstractSubResourceLocator


        assertTrue(resourceMethod.getSupportedInputTypes().contains(MediaType.valueOf("application/json")));
        assertTrue(resourceMethod.getSupportedInputTypes().contains(MediaType.valueOf("application/xml")));
        assertEquals(1, resourceMethod.getSupportedOutputTypes().size());
        assertEquals("*/*", resourceMethod.getSupportedOutputTypes().get(0).toString());
       
        AbstractSubResourceLocator locator = rootResource.getSubResourceLocators().get(0);
//        @Path("/subres-locator/{p1}")
//        public TestSubResourceOne getSubResourceMethodTester(
//                @PathParam("p1") String pOne, @MatrixParam("p2") int pTwo, @HeaderParam("p3") String pThree) {
//            return new TestSubResourceOne();
//        }
        assertEquals("/subres-locator/{p1}", locator.getPath().getValue());
        assertEquals(3, locator.getParameters().size());
        assertEquals(Parameter.Source.PATH, locator.getParameters().get(0).getSource());
        assertEquals("p1", locator.getParameters().get(0).getSourceName());
        assertEquals(String.class, locator.getParameters().get(0).getParameterClass());
        assertEquals(String.class, locator.getParameters().get(0).getParameterType());
        assertEquals(Parameter.Source.MATRIX, locator.getParameters().get(1).getSource());
        assertEquals("p2", locator.getParameters().get(1).getSourceName());
        assertEquals(int.class, locator.getParameters().get(1).getParameterClass());
        assertEquals(int.class, locator.getParameters().get(1).getParameterType());
        assertEquals(Parameter.Source.HEADER, locator.getParameters().get(2).getSource());
        assertEquals("p3", locator.getParameters().get(2).getSourceName());

        AbstractSubResourceMethod putSubResMethod1 = null;
        AbstractSubResourceMethod putSubResMethod2 = null;
        AbstractSubResourceMethod getSubResMethod = null;
        for (AbstractSubResourceMethod m: rootResource.getSubResourceMethods()) {
View Full Code Here


            boolean isEncoded) {

        for (AnnotatedMethod m : methodList.hasNotMetaAnnotation(HttpMethod.class).
                hasAnnotation(Path.class)) {
            final Path mPathAnnotation = m.getAnnotation(Path.class);
            final AbstractSubResourceLocator subResourceLocator = new AbstractSubResourceLocator(
                    resource,
                    m.getMethod(),
                    new PathValue(
                        mPathAnnotation.value()),
                    m.getAnnotations());

            processParameters(
                    subResourceLocator.getResource().getResourceClass(),
                    subResourceLocator.getMethod().getDeclaringClass(),
                    subResourceLocator, m, isEncoded);

            resource.getSubResourceLocators().add(subResourceLocator);
        }
    }
View Full Code Here

            boolean isEncoded) {

        for (AnnotatedMethod m : methodList.hasNotMetaAnnotation(HttpMethod.class).
                hasAnnotation(Path.class)) {
            final Path mPathAnnotation = m.getAnnotation(Path.class);
            final AbstractSubResourceLocator subResourceLocator = new AbstractSubResourceLocator(
                    resource,
                    m.getMethod(),
                    new PathValue(
                        mPathAnnotation.value()),
                    m.getAnnotations());

            processParameters(
                    subResourceLocator.getResource().getResourceClass(),
                    subResourceLocator.getMethod().getDeclaringClass(),
                    subResourceLocator, m, isEncoded);

            resource.getSubResourceLocators().add(subResourceLocator);
        }
    }
View Full Code Here

            boolean isEncoded) {

        for (AnnotatedMethod m : methodList.hasNotMetaAnnotation(HttpMethod.class).
                hasAnnotation(Path.class)) {
            final Path mPathAnnotation = m.getAnnotation(Path.class);
            final AbstractSubResourceLocator subResourceLocator = new AbstractSubResourceLocator(
                    resource,
                    m.getMethod(),
                    new PathValue(
                        mPathAnnotation.value()),
                    m.getAnnotations());
View Full Code Here

            boolean isEncoded) {

        for (AnnotatedMethod m : methodList.hasNotMetaAnnotation(HttpMethod.class).
                hasAnnotation(Path.class)) {
            final Path mPathAnnotation = m.getAnnotation(Path.class);
            final AbstractSubResourceLocator subResourceLocator = new AbstractSubResourceLocator(
                    resource,
                    m.getMethod(),
                    new PathValue(
                        mPathAnnotation.value()),
                    m.getAnnotations());

            processParameters(
                    subResourceLocator.getResource().getResourceClass(),
                    subResourceLocator.getMethod().getDeclaringClass(),
                    subResourceLocator, m, isEncoded);

            resource.getSubResourceLocators().add(subResourceLocator);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.model.AbstractSubResourceLocator

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.