/** * Returns true when the class contains main method. * @param qualifiedName the fully qualified name of class * @param cpInfo the classpath used to resolve the class * @return true when the class contains a main method */ public static boolean isMainClass (final String qualifiedName, ClasspathInfo cpInfo) { return isMainClass(qualifiedName, cpInfo, false); }
public static boolean isMainClass (final String className, ClassPath bootPath, ClassPath compilePath, ClassPath sourcePath) { ClasspathInfo cpInfo = ClasspathInfo.create(bootPath, compilePath, sourcePath); return SourceUtils.isMainClass(className, cpInfo); }
public boolean isInjectionTarget(CompilationController controller, TypeElement typeElement) { Car apiCar = Car.getCar(controller.getFileObject()); if (apiCar != null && !Profile.J2EE_13.equals(apiCar.getJ2eeProfile()) && !Profile.J2EE_14.equals(apiCar.getJ2eeProfile())) { return SourceUtils.isMainClass(typeElement.getQualifiedName().toString(), controller.getClasspathInfo()); } return false; }