1 19 20 package org.netbeans.modules.j2ee.clientproject; 21 22 import javax.lang.model.element.TypeElement; 23 import org.netbeans.api.java.source.CompilationController; 24 import org.netbeans.api.java.source.SourceUtils; 25 import org.netbeans.modules.j2ee.api.ejbjar.Car; 26 import org.netbeans.modules.j2ee.common.queries.spi.InjectionTargetQueryImplementation; 27 28 32 public class AppClientInjectionTargetQueryImplementation implements InjectionTargetQueryImplementation { 33 34 public AppClientInjectionTargetQueryImplementation() { 35 } 36 37 public boolean isInjectionTarget(CompilationController controller, TypeElement typeElement) { 38 Car apiCar = Car.getCar(controller.getFileObject()); 39 if (apiCar != null && 40 !apiCar.getJ2eePlatformVersion().equals("1.3") && 41 !apiCar.getJ2eePlatformVersion().equals("1.4")) { 42 return SourceUtils.isMainClass(typeElement.getQualifiedName().toString(), controller.getClasspathInfo()); 43 } 44 return false; 45 } 46 47 public boolean isStaticReferenceRequired(CompilationController controller, TypeElement typeElement) { 48 return isInjectionTarget(controller, typeElement); 50 } 51 } 52 | Popular Tags |