Package java.lang.annotation

Examples of java.lang.annotation.Annotation


    /*
     * return true if controller class is a default controller, false otherwise
     */
    private boolean checkForDefaultController(Class<?> controllerClass) {

        Annotation annot = controllerClass.getAnnotation(DefaultController.class);
        if (annot != null) {
            if (defaultControllerClass != null) {
                throw new ConfigurationException("only one controller class can be annotated with @"
                        + DefaultController.class.getSimpleName());
            }
View Full Code Here


        FastClass fastClass = FastClass.create(controllerClass);
        classToFastClassMap.put(controllerClass, fastClass);

        for (int i = 0; i < methods.length; i++) {

            Annotation ann = methods[i].getAnnotation(Action.class);
            if (ann != null) {
                Action actionAnn = (Action) ann;
                String action = actionAnn.value();
                if (action == null || action.trim().length() == 0) {
                    /*
 
View Full Code Here

        }
    }
   
    private void setInterceptorsFor(Class<?> controllerClass) {

        Annotation annot = controllerClass.getAnnotation(InterceptedBy.class);
        if (annot != null) {

            List<Class<?>> processedInterceptors = processInterceptors(annot, controllerClass);

            controllerClassToInterceptorsMap.put(controllerClass, Collections.unmodifiableList(processedInterceptors));
View Full Code Here

    }

    private void setInterceptorsForAction(Class<?> controllerClass, String action, Method method,
            Map<String, List<Class<?>>> actionInterceptorsMap) {

        Annotation annot = method.getAnnotation(InterceptedBy.class);
        if (annot != null) {

            List<Class<?>> processedInterceptors = processInterceptors(annot, controllerClass, method);

            actionInterceptorsMap.put(action, Collections.unmodifiableList(processedInterceptors));
View Full Code Here

    }

    private void setInterceptorsForHttpMethodAction(Class<?> controllerClass, HttpMethod httpMethod, Method method,
            Map<HttpMethod, List<Class<?>>> httpMethodActionInterceptorsMap) {

        Annotation annot = method.getAnnotation(InterceptedBy.class);
        if (annot != null) {

            List<Class<?>> processedInterceptors = processInterceptors(annot, controllerClass, method);

            httpMethodActionInterceptorsMap.put(httpMethod, Collections.unmodifiableList(processedInterceptors));
View Full Code Here

        }
    }

    private void setInterceptorsForDefaultAction(Class<?> controllerClass, Method method) {

        Annotation annot = method.getAnnotation(InterceptedBy.class);
        if (annot != null) {

            List<Class<?>> processedInterceptors = processInterceptors(annot, controllerClass, method);

            controllerClassToDefaultActionInterceptorsMap.put(controllerClass,
View Full Code Here

            FastClass fastClass = FastClass.create(interceptorClass);
            classToFastClassMap.put(interceptorClass, fastClass);

            for (int i = 0; i < methods.length; i++) {

                Annotation ann = methods[i].getAnnotation(BeforeAction.class);
                if (ann != null) {
                    addBeforeOrAfterActionSignature(interceptorClassToBeforeActionMap, BeforeAction.class,
                            interceptorClass, methods[i], fastClass);
                    continue;
                }
View Full Code Here

    if (this.field != null) {
      return;
    }

    Annotation annotation = field.getAnnotation(annotationType);
    if (annotation != null) {
      this.field = field;
    }
  }
View Full Code Here

 
  static boolean hasJdoAnnotation(Class<?> clazz) {
    if (JDO_PERSISTENCE_CAPABLE_ANNOTATION == null) {
      return false;
    }
    Annotation annotation = clazz.getAnnotation(JDO_PERSISTENCE_CAPABLE_ANNOTATION);
    if (annotation == null) {
      return false;
    }
    try {
      Object value = JDO_PERSISTENCE_CAPABLE_DETACHABLE_METHOD.invoke(annotation, (Object[]) null);
View Full Code Here

    @Test
    public void presentAnnotationIsAvailable() throws Exception {
        Method method = ClassWithDummyMethod.class.getMethod("annotatedDummyMethod");
        FrameworkMethod frameworkMethod = new FrameworkMethod(method);
        Annotation annotation = frameworkMethod.getAnnotation(Rule.class);
        assertTrue(Rule.class.isAssignableFrom(annotation.getClass()));
    }
View Full Code Here

TOP

Related Classes of java.lang.annotation.Annotation

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.