Examples of MethodList


Examples of com.sun.jersey.core.reflection.MethodList

    }

    private static Method getPreDestroyMethod(Class c) {
        Class preDestroyClass = ReflectionHelper.classForName("javax.annotation.PreDestroy");
        if (preDestroyClass != null) {
            MethodList methodList = new MethodList(c);
            for (AnnotatedMethod m : methodList.
                    hasAnnotation(preDestroyClass).
                    hasNumParams(0).
                    hasReturnType(void.class)) {
                return m.getMethod();
            }
View Full Code Here

Examples of com.sun.jersey.core.reflection.MethodList

        workOutConstructorsList(resource, resourceClass.getConstructors(),
                isEncodedAnotOnClass);

        workOutFieldsList(resource, isEncodedAnotOnClass);
       
        final MethodList methodList = new MethodList(resourceClass);

        workOutSetterMethodsList(resource, methodList, isEncodedAnotOnClass);
       
        final Consumes classScopeConsumesAnnotation =
                annotatedResourceClass.getAnnotation(Consumes.class);
View Full Code Here

Examples of com.sun.jersey.core.reflection.MethodList

       
        if (!LOGGER.isLoggable(Level.WARNING)) {
            return; // does not make sense to check when logging is disabled anyway
        }
       
        final MethodList declaredMethods = new MethodList(
                getDeclaredMethods(resourceClass));

        // non-public resource methods
        for (AnnotatedMethod m : declaredMethods.hasMetaAnnotation(HttpMethod.class).
                hasNotAnnotation(Path.class).isNotPublic()) {
            LOGGER.warning(ImplMessages.NON_PUB_RES_METHOD(m.getMethod().toGenericString()));
        }
        // non-public subres methods
        for (AnnotatedMethod m : declaredMethods.hasMetaAnnotation(HttpMethod.class).
                hasAnnotation(Path.class).isNotPublic()) {
            LOGGER.warning(ImplMessages.NON_PUB_SUB_RES_METHOD(m.getMethod().toGenericString()));
        }
        // non-public subres locators
        for (AnnotatedMethod m : declaredMethods.hasNotMetaAnnotation(HttpMethod.class).
                hasAnnotation(Path.class).isNotPublic()) {
            LOGGER.warning(ImplMessages.NON_PUB_SUB_RES_LOC(m.getMethod().toGenericString()));
        }
    }
View Full Code Here

Examples of com.sun.jersey.core.reflection.MethodList

        workOutConstructorsList(resource, resourceClass.getConstructors(),
                isEncodedAnotOnClass);

        workOutFieldsList(resource, isEncodedAnotOnClass);
       
        final MethodList methodList = new MethodList(resourceClass);

        workOutSetterMethodsList(resource, methodList, isEncodedAnotOnClass);
       
        final Consumes classScopeConsumesAnnotation =
                annotatedResourceClass.getAnnotation(Consumes.class);
View Full Code Here

Examples of com.sun.jersey.core.reflection.MethodList

        if (postConstruct == null)
            return;

        Class preDestroy = ReflectionHelper.classForName("javax.annotation.PreDestroy");

        final MethodList methodList = new MethodList(resource.getResourceClass(), true);
        for (AnnotatedMethod m : methodList.
                hasAnnotation(postConstruct).
                hasNumParams(0).
                hasReturnType(void.class)) {
            ReflectionHelper.setAccessibleMethod(m.getMethod());
            resource.getPostConstructMethods().add(m.getMethod());
        }

        for (AnnotatedMethod m : methodList.
                hasAnnotation(preDestroy).
                hasNumParams(0).
                hasReturnType(void.class)) {
            ReflectionHelper.setAccessibleMethod(m.getMethod());
            resource.getPreDestroyMethods().add(m.getMethod());
View Full Code Here

Examples of com.sun.jersey.core.reflection.MethodList

            }
            oClass = oClass.getSuperclass();
        }

        MethodList ml = new MethodList(c.getMethods());
        int methodIndex = 0;
        for (AnnotatedMethod m : ml.
                hasNotMetaAnnotation(HttpMethod.class).
                hasNotAnnotation(Path.class).
                hasNumParams(1).
                hasReturnType(void.class).
                nameStartsWith("set")) {
View Full Code Here

Examples of com.sun.jersey.core.reflection.MethodList

    }

    private static Method getPostConstructMethod(Class c) {
        Class postConstructClass = ReflectionHelper.classForName("javax.annotation.PostConstruct");
        if (postConstructClass != null) {
            MethodList methodList = new MethodList(c, true);
            for (AnnotatedMethod m : methodList.
                    hasAnnotation(postConstructClass).
                    hasNumParams(0).
                    hasReturnType(void.class)) {
                ReflectionHelper.setAccessibleMethod(m.getMethod());
                return m.getMethod();
View Full Code Here

Examples of com.sun.jersey.core.reflection.MethodList

    }

    private static Method getPreDestroyMethod(Class c) {
        Class preDestroyClass = ReflectionHelper.classForName("javax.annotation.PreDestroy");
        if (preDestroyClass != null) {
            MethodList methodList = new MethodList(c, true);
            for (AnnotatedMethod m : methodList.
                    hasAnnotation(preDestroyClass).
                    hasNumParams(0).
                    hasReturnType(void.class)) {
                ReflectionHelper.setAccessibleMethod(m.getMethod());
                return m.getMethod();
View Full Code Here

Examples of com.sun.jersey.core.reflection.MethodList

        return ml;
    }

    private void checkNonPublicMethods(final AbstractResource ar) {

        final MethodList declaredMethods = new MethodList(
                getDeclaredMethods(ar.getResourceClass()));

        // non-public resource methods
        for (AnnotatedMethod m : declaredMethods.hasMetaAnnotation(HttpMethod.class).
                hasNotAnnotation(Path.class).isNotPublic()) {
            issueList.add(new ResourceModelIssue(ar, ImplMessages.NON_PUB_RES_METHOD(m.getMethod().toGenericString()), false));
        }
        // non-public subres methods
        for (AnnotatedMethod m : declaredMethods.hasMetaAnnotation(HttpMethod.class).
                hasAnnotation(Path.class).isNotPublic()) {
            issueList.add(new ResourceModelIssue(ar, ImplMessages.NON_PUB_SUB_RES_METHOD(m.getMethod().toGenericString()), false));
        }
        // non-public subres locators
        for (AnnotatedMethod m : declaredMethods.hasNotMetaAnnotation(HttpMethod.class).
                hasAnnotation(Path.class).isNotPublic()) {
            issueList.add(new ResourceModelIssue(ar, ImplMessages.NON_PUB_SUB_RES_LOC(m.getMethod().toGenericString()), false));
        }
    }
View Full Code Here

Examples of com.sun.jersey.core.reflection.MethodList

            // extract template from specified class' @Path annotation
            Path path = link.resource().getAnnotation(Path.class);
            template = path==null ? "" : path.value();
            if (link.method().length() > 0) {
                // append value of method's @Path annotation
                MethodList methods = new MethodList(link.resource());
                methods = methods.hasAnnotation(Path.class);
                Iterator<AnnotatedMethod> iterator = methods.iterator();
                while (iterator.hasNext()) {
                    AnnotatedMethod method = iterator.next();
                    if (!method.getMethod().getName().equals(link.method()))
                        continue;
                    Path methodPath = method.getAnnotation(Path.class);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.