/** * {@inheritDoc} */ public ClassInfo getClassByName(final DotName className) { for (IndexView index : indexes) { final ClassInfo info = index.getClassByName(className); if (info != null) { return info; } } return null; }
Tuple2<IJavaModuleData, ClassInfo> getClassByName(DotName fqName) { for (ModuleJandexIndex m : modules) { IndexView indexView = m.getIndex().get(); if (indexView != null) { ClassInfo info = indexView.getClassByName(fqName); if (info != null) { return Tuples.of(m, info); } } } return null; }
@Override public Set<String> apply(DotName name) { ClassInfo annotationClassInfo = index.getClassByName(name); ImmutableSet.Builder<String> builder = ImmutableSet.builder(); if (annotationClassInfo != null) { for (DotName annotationName : annotationClassInfo.annotations().keySet()) { builder.add(annotationName.toString()); } } else { try { Class<?> annotationClass = classLoader.loadClass(name.toString()); for (Annotation annotation : annotationClass.getDeclaredAnnotations()) { builder.add(annotation.annotationType().getName()); } } catch (ClassNotFoundException e) { throw CommonLogger.LOG.unableToLoadAnnotation(name.toString()); } } return builder.build(); } }
@Override public Set<String> apply(DotName name) { ClassInfo annotationClassInfo = index.getClassByName(name); ImmutableSet.Builder<String> builder = ImmutableSet.builder(); if (annotationClassInfo != null) { for (DotName annotationName : annotationClassInfo.annotations().keySet()) { builder.add(annotationName.toString()); } } else { try { Class<?> annotationClass = classLoader.loadClass(name.toString()); for (Annotation annotation : annotationClass.getDeclaredAnnotations()) { builder.add(annotation.annotationType().getName()); } } catch (ClassNotFoundException e) { throw CommonLogger.LOG.unableToLoadAnnotation(name.toString()); } } return builder.build(); } }
@Override public Set<String> apply(DotName name) { ClassInfo annotationClassInfo = index.getClassByName(name); ImmutableSet.Builder<String> builder = ImmutableSet.builder(); if (annotationClassInfo != null) { for (DotName annotationName : annotationClassInfo.annotations().keySet()) { builder.add(annotationName.toString()); } } else { try { Class<?> annotationClass = classLoader.loadClass(name.toString()); for (Annotation annotation : annotationClass.getDeclaredAnnotations()) { builder.add(annotation.annotationType().getName()); } } catch (ClassNotFoundException e) { throw CommonLogger.LOG.unableToLoadAnnotation(name.toString()); } } return builder.build(); } }
@Override public Set<String> apply(DotName name) { ClassInfo annotationClassInfo = index.getClassByName(name); ImmutableSet.Builder<String> builder = ImmutableSet.builder(); if (annotationClassInfo != null) { for (DotName annotationName : annotationClassInfo.annotations().keySet()) { builder.add(annotationName.toString()); } } else { try { Class<?> annotationClass = classLoader.loadClass(name.toString()); for (Annotation annotation : annotationClass.getDeclaredAnnotations()) { builder.add(annotation.annotationType().getName()); } } catch (ClassNotFoundException e) { throw CommonLogger.LOG.unableToLoadAnnotation(name.toString()); } } return builder.build(); } }
public JandexClassFileInfo(String className, IndexView index, ComputingCache<DotName, Set<String>> annotationClassAnnotationsCache, ClassLoader classLoader) { this.index = index; this.annotationClassAnnotationsCache = annotationClassAnnotationsCache; this.classInfo = index.getClassByName(DotName.createSimple(className)); if (this.classInfo == null) { throw CommonLogger.LOG.indexForNameNotFound(className); } this.isVetoed = isVetoedTypeOrPackage(); this.hasCdiConstructor = this.classInfo.hasNoArgsConstructor() || hasInjectConstructor(); this.classLoader = classLoader; }
public JandexClassFileInfo(String className, IndexView index, ComputingCache<DotName, Set<String>> annotationClassAnnotationsCache, ClassLoader classLoader) { this.index = index; this.annotationClassAnnotationsCache = annotationClassAnnotationsCache; this.classInfo = index.getClassByName(DotName.createSimple(className)); if (this.classInfo == null) { throw CommonLogger.LOG.indexForNameNotFound(className); } this.isVetoed = isVetoedTypeOrPackage(); this.hasCdiConstructor = this.classInfo.hasNoArgsConstructor() || hasInjectConstructor(); this.classLoader = classLoader; }
private boolean isVetoedTypeOrPackage() { if (isAnnotationDeclared(classInfo, DOT_NAME_VETOED)) { return true; } final DotName packageInfoName = DotName.createComponentized(getPackageName(classInfo.name()), PACKAGE_INFO_NAME); ClassInfo packageInfo = index.getClassByName(packageInfoName); if (packageInfo != null && isAnnotationDeclared(packageInfo, DOT_NAME_VETOED)) { return true; } return false; }
private boolean isVetoedTypeOrPackage() { if (isAnnotationDeclared(classInfo, DOT_NAME_VETOED)) { return true; } final DotName packageInfoName = DotName.createComponentized(getPackageName(classInfo.name()), PACKAGE_INFO_NAME); ClassInfo packageInfo = index.getClassByName(packageInfoName); if (packageInfo != null && isAnnotationDeclared(packageInfo, DOT_NAME_VETOED)) { return true; } return false; }
public JandexClassFileInfo(String className, IndexView index, ComputingCache<DotName, Set<String>> annotationClassAnnotationsCache, ClassLoader classLoader) { this.index = index; this.annotationClassAnnotationsCache = annotationClassAnnotationsCache; this.classInfo = index.getClassByName(DotName.createSimple(className)); if (this.classInfo == null) { throw CommonLogger.LOG.indexForNameNotFound(className); } this.isVetoed = isVetoedTypeOrPackage(); this.hasCdiConstructor = this.classInfo.hasNoArgsConstructor() || hasInjectConstructor(); this.classLoader = classLoader; }
private boolean isVetoedTypeOrPackage() { if (isAnnotationDeclared(classInfo, DOT_NAME_VETOED)) { return true; } final DotName packageInfoName = DotName.createComponentized(getPackageName(classInfo.name()), PACKAGE_INFO_NAME); ClassInfo packageInfo = index.getClassByName(packageInfoName); if (packageInfo != null && isAnnotationDeclared(packageInfo, DOT_NAME_VETOED)) { return true; } return false; }
public JandexClassFileInfo(String className, IndexView index, ComputingCache<DotName, Set<String>> annotationClassAnnotationsCache, ClassLoader classLoader) { this.index = index; this.annotationClassAnnotationsCache = annotationClassAnnotationsCache; this.classInfo = index.getClassByName(DotName.createSimple(className)); if (this.classInfo == null) { throw CommonLogger.LOG.indexForNameNotFound(className); } this.isVetoed = isVetoedTypeOrPackage(); this.hasCdiConstructor = this.classInfo.hasNoArgsConstructor() || hasInjectConstructor(); this.classLoader = classLoader; }
private boolean isVetoedTypeOrPackage() { if (isAnnotationDeclared(classInfo, DOT_NAME_VETOED)) { return true; } final DotName packageInfoName = DotName.createComponentized(getPackageName(classInfo.name()), PACKAGE_INFO_NAME); ClassInfo packageInfo = index.getClassByName(packageInfoName); if (packageInfo != null && isAnnotationDeclared(packageInfo, DOT_NAME_VETOED)) { return true; } return false; }
private boolean isVetoedTypeOrPackage() { if (isAnnotationDeclared(classInfo, DOT_NAME_VETOED)) { return true; } final DotName packageInfoName = DotName.createComponentized(getPackageName(classInfo.name()), PACKAGE_INFO_NAME); ClassInfo packageInfo = index.getClassByName(packageInfoName); if (packageInfo != null && isAnnotationDeclared(packageInfo, DOT_NAME_VETOED)) { return true; } return false; }
private boolean isVetoedTypeOrPackage() { if (isAnnotationDeclared(classInfo, DOT_NAME_VETOED)) { return true; } final DotName packageInfoName = DotName.createComponentized(getPackageName(classInfo.name()), PACKAGE_INFO_NAME); ClassInfo packageInfo = index.getClassByName(packageInfoName); if (packageInfo != null && isAnnotationDeclared(packageInfo, DOT_NAME_VETOED)) { return true; } return false; }
public JandexClassFileInfo(String className, IndexView index, ComputingCache<DotName, Set<String>> annotationClassAnnotationsCache, ClassLoader classLoader) { this.index = index; this.annotationClassAnnotationsCache = annotationClassAnnotationsCache; this.classInfo = index.getClassByName(DotName.createSimple(className)); if (this.classInfo == null) { throw CommonLogger.LOG.indexForNameNotFound(className); } this.isVetoed = isVetoedTypeOrPackage(); this.hasCdiConstructor = this.classInfo.hasNoArgsConstructor() || hasInjectConstructor(); this.classLoader = classLoader; }
private boolean isVetoedTypeOrPackage() { if (isAnnotationDeclared(classInfo, DOT_NAME_VETOED)) { return true; } final DotName packageInfoName = DotName.createComponentized(getPackageName(classInfo.name()), PACKAGE_INFO_NAME); ClassInfo packageInfo = index.getClassByName(packageInfoName); if (packageInfo != null && isAnnotationDeclared(packageInfo, DOT_NAME_VETOED)) { return true; } return false; }
public JandexClassFileInfo(String className, IndexView index, ComputingCache<DotName, Set<String>> annotationClassAnnotationsCache, ClassLoader classLoader) { this.index = index; this.annotationClassAnnotationsCache = annotationClassAnnotationsCache; this.classInfo = index.getClassByName(DotName.createSimple(className)); if (this.classInfo == null) { throw CommonLogger.LOG.indexForNameNotFound(className); } this.isVetoed = isVetoedTypeOrPackage(); this.hasCdiConstructor = this.classInfo.hasNoArgsConstructor() || hasInjectConstructor(); this.classLoader = classLoader; }
public JandexClassFileInfo(String className, IndexView index, ComputingCache<DotName, Set<String>> annotationClassAnnotationsCache, ClassLoader classLoader) { this.index = index; this.annotationClassAnnotationsCache = annotationClassAnnotationsCache; this.classInfo = index.getClassByName(DotName.createSimple(className)); if (this.classInfo == null) { throw CommonLogger.LOG.indexForNameNotFound(className); } this.isVetoed = isVetoedTypeOrPackage(); this.hasCdiConstructor = this.classInfo.hasNoArgsConstructor() || hasInjectConstructor(); this.classLoader = classLoader; }