Examples of MethodList


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

    private static List<Method> getPostConstructMethods(Class c) {
        Class postConstructClass = ReflectionHelper.classForName("javax.annotation.PostConstruct");
        LinkedList<Method> list = new LinkedList<Method>();
        HashSet<String> names = new HashSet<String>();
        if (postConstructClass != null) {
            MethodList methodList = new MethodList(c, true);
            for (AnnotatedMethod m : methodList.
                    hasAnnotation(postConstructClass).
                    hasNumParams(0).
                    hasReturnType(void.class)) {
                Method method = m.getMethod();
                // only add method if not hidden/overridden
View Full Code Here

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

    private static List<Method> getPreDestroyMethods(Class c) {
        Class preDestroyClass = ReflectionHelper.classForName("javax.annotation.PreDestroy");
        List<Method> list = new ArrayList<Method>();
        HashSet<String> names = new HashSet<String>();
        if (preDestroyClass != null) {
            MethodList methodList = new MethodList(c, true);
            for (AnnotatedMethod m : methodList.
                    hasAnnotation(preDestroyClass).
                    hasNumParams(0).
                    hasReturnType(void.class)) {
                Method method = m.getMethod();
                // only add method if not hidden/overridden
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);
        HashSet<String> names = new HashSet<String>();
        for (AnnotatedMethod m : methodList.
                hasAnnotation(postConstruct).
                hasNumParams(0).
                hasReturnType(void.class)) {
            Method method = m.getMethod();
            // only add method if not hidden/overridden
            if (names.add(method.getName())) {
                ReflectionHelper.setAccessibleMethod(method);
                resource.getPostConstructMethods().add(0, method);
            }
        }

        names = new HashSet<String>();
        for (AnnotatedMethod m : methodList.
                hasAnnotation(preDestroy).
                hasNumParams(0).
                hasReturnType(void.class)) {
            Method method = m.getMethod();
            // only add method if not hidden/overridden
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

        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);
        HashSet<String> names = new HashSet<String>();
        for (AnnotatedMethod m : methodList.
                hasAnnotation(postConstruct).
                hasNumParams(0).
                hasReturnType(void.class)) {
            Method method = m.getMethod();
            // only add method if not hidden/overridden
            if (names.add(method.getName())) {
                ReflectionHelper.setAccessibleMethod(method);
                resource.getPostConstructMethods().add(0, method);
            }
        }

        names = new HashSet<String>();
        for (AnnotatedMethod m : methodList.
                hasAnnotation(preDestroy).
                hasNumParams(0).
                hasReturnType(void.class)) {
            Method method = m.getMethod();
            // only add method if not hidden/overridden
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

            }
            oClass = oClass.getSuperclass();
        }

        MethodList ml = new MethodList(c.getMethods());
        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);
            for (AnnotatedMethod m : methodList.
                    hasAnnotation(postConstructClass).
                    hasNumParams(0).
                    hasReturnType(void.class)) {
                return m.getMethod();
            }
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.