Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2013, Red Hat, Inc., and individual contributors
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package org.jboss.as.weld.discovery;
 
 import java.util.List;
 
 
 
     private static final String CONSTRUCTOR_NAME = "<init>";
 
     private final IndexAdapter index;
 
         this. = index;
     }

    
Returns a list of classes that contain any of the given annotations as defined in CDI 1.1 - 11.4
 
     public List<ClassInfogetAffectedClasses(Iterable<AnnotationTypeannotations) {
         List<ClassInfoclasses = new ArrayList<ClassInfo>();
         for (AnnotationType annotation : annotations) {
             getAffectedClasses(classesannotation);
         }
         return classes;
     }
 
     protected List<ClassInfogetAffectedClasses(List<ClassInfoclassesAnnotationType annotation) {
         for (AnnotationInstance instance : .getAnnotations(annotation.getName())) {
             AnnotationTarget target = instance.target();
             if (target instanceof ClassInfo) {
                 processTopLevelClass(classes, (ClassInfotargetannotation.isInherited());
             } else if (target instanceof FieldInfo) {
                 processField(classes, (FieldInfotarget);
             } else if (target instanceof MethodInfo) {
                 MethodInfo method = (MethodInfotarget;
                 if (.equals(method.name())) {
                     processConstructor(classesmethod);
                 } else {
                     processMethod(classesmethod);
                 }
             } else if (target instanceof MethodParameterInfo) {
                 processParameter(classes, (MethodParameterInfotarget);
             }
         }
         return classes;
     }
 
     protected void processTopLevelClass(List<ClassInfoclassesClassInfo clazzboolean inherited) {
         classes.add(clazz);
         if (inherited) {
             processSubclasses(classesclazz);
         }
     }
 
     protected void processSubclasses(List<ClassInfoclassesClassInfo clazz) {
         for (ClassInfo subclass : .getKnownDirectSubclasses(clazz.name())) {
             classes.add(subclass);
             processSubclasses(classessubclass);
         }
 
     }
 
     protected void processField(List<ClassInfoclassesFieldInfo field) {
         classes.add(field.declaringClass());
         processSubclasses(classesfield.declaringClass());
     }
 
     protected void processMethod(List<ClassInfoclassesMethodInfo method) {
         classes.add(method.declaringClass());
         processSubclasses(classesmethod.declaringClass());
     }
 
     protected void processConstructor(List<ClassInfoclassesMethodInfo method) {
         processMethod(classesmethod);
     }
 
    protected void processParameter(List<ClassInfoclassesMethodParameterInfo parameter) {
        classes.add(parameter.method().declaringClass());
        processSubclasses(classesparameter.method().declaringClass());
    }
New to GrepCode? Check out our FAQ X