Tabnine Logo
javax.lang.model.util
Code IndexAdd Tabnine to your IDE (free)

How to use javax.lang.model.util

Best Java code snippets using javax.lang.model.util (Showing top 20 results out of 4,077)

origin: androidannotations/androidannotations

protected boolean hasAndroidxFragmentInClasspath() {
  return elementUtils.getTypeElement(CanonicalNameConstants.ANDROIDX_FRAGMENT) != null;
}
origin: neo4j/neo4j

public PrimitiveType primitive( TypeKind kind )
{
  return typeUtils.getPrimitiveType( kind );
}
origin: bumptech/glide

List<TypeElement> getElementsFor(
  Class<? extends Annotation> clazz, RoundEnvironment env) {
 Collection<? extends Element> annotatedElements = env.getElementsAnnotatedWith(clazz);
 return ElementFilter.typesIn(annotatedElements);
}
origin: airbnb/epoxy

static Element getElementByName(String name, Elements elements, Types types) {
 try {
  return elements.getTypeElement(name);
 } catch (MirroredTypeException mte) {
  return types.asElement(mte.getTypeMirror());
 }
}
origin: androidannotations/androidannotations

private List<VariableElement> getKeyEventEnclosedFieldElements() {
  TypeElement keyEventElement = getElementUtils().getTypeElement(CanonicalNameConstants.KEY_EVENT);
  return ElementFilter.fieldsIn(keyEventElement.getEnclosedElements());
}
origin: spring-projects/spring-framework

/**
 * Return the super class of the specified {@link Element} or null if this
 * {@code element} represents {@link Object}.
 */
public Element getSuperClass(Element element) {
  List<? extends TypeMirror> superTypes = this.types.directSupertypes(element.asType());
  if (superTypes.isEmpty()) {
    return null;  // reached java.lang.Object
  }
  return this.types.asElement(superTypes.get(0));
}
origin: bumptech/glide

private boolean isReturnValueTypeMatching(
  ExecutableElement method, TypeMirror expectedReturnType) {
 return processingEnv.getTypeUtils().isAssignable(
   method.getReturnType(), expectedReturnType);
}
origin: JakeWharton/butterknife

/** Uses both {@link Types#erasure} and string manipulation to strip any generic types. */
private String doubleErasure(TypeMirror elementType) {
 String name = typeUtils.erasure(elementType).toString();
 int typeParamStart = name.indexOf('<');
 if (typeParamStart != -1) {
  name = name.substring(0, typeParamStart);
 }
 return name;
}
origin: androidannotations/androidannotations

  private void createDaoParametrizedTypes() {
    daoTypeElement = helper.typeElementFromQualifiedName(OrmLiteClasses.DAO);
    runtimeExceptionDaoTypeElement = helper.typeElementFromQualifiedName(OrmLiteClasses.RUNTIME_EXCEPTION_DAO);

    Types typeUtils = helper.getTypeUtils();
    TypeMirror wildcardType = typeUtils.getWildcardType(null, null);
    daoParametrizedType = helper.getTypeUtils().getDeclaredType(daoTypeElement, wildcardType, wildcardType);
    runtimeExceptionDaoParametrizedType = helper.getTypeUtils().getDeclaredType(runtimeExceptionDaoTypeElement, wildcardType, wildcardType);
  }
}
origin: spring-projects/spring-framework

public List<? extends AnnotationMirror> getAllAnnotationMirrors(Element e) {
  return this.env.getElementUtils().getAllAnnotationMirrors(e);
}
origin: androidannotations/androidannotations

protected boolean hasFragmentSupportInClasspath() {
  return elementUtils.getTypeElement(CanonicalNameConstants.SUPPORT_V4_FRAGMENT) != null;
}
origin: square/dagger

private static TypeElement getTypeElement(Elements elements, CharSequence className) {
 try {
  return elements.getTypeElement(className);
 } catch (ClassCastException e) {
  // work-around issue in javac in Java 7 where querying for non-existent type can
  // throw a ClassCastException
  // TODO(jh): refer to Oracle Bug ID if/when one is assigned to bug report
  // (Review ID: JI-9027367)
  return null;
 }
}
origin: bumptech/glide

GlideGenerator(ProcessingEnvironment processingEnv, ProcessorUtil processorUtil) {
 this.processingEnv = processingEnv;
 this.processorUtil = processorUtil;
 Elements elementUtils = processingEnv.getElementUtils();
 requestManagerType = elementUtils.getTypeElement(REQUEST_MANAGER_QUALIFIED_NAME);
 glideType = elementUtils.getTypeElement(GLIDE_QUALIFIED_NAME);
}
origin: bumptech/glide

RequestOptionsOverrideGenerator(
  ProcessingEnvironment processingEnv, ProcessorUtil processorUtil) {
 this.processorUtil = processorUtil;
 baseRequestOptionsType = processingEnv.getElementUtils().getTypeElement(
   BASE_REQUEST_OPTIONS_QUALIFIED_NAME);
}
origin: bumptech/glide

ProcessorUtil(ProcessingEnvironment processingEnv) {
 this.processingEnv = processingEnv;
 appGlideModuleType =
   processingEnv.getElementUtils().getTypeElement(APP_GLIDE_MODULE_QUALIFIED_NAME);
 libraryGlideModuleType =
   processingEnv.getElementUtils().getTypeElement(LIBRARY_GLIDE_MODULE_QUALIFIED_NAME);
}
origin: spring-projects/spring-framework

private boolean deletedInCurrentBuild(String sourceType) {
  return this.processingEnvironment.getElementUtils()
      .getTypeElement(sourceType) == null;
}
origin: bumptech/glide

RequestManagerFactoryGenerator(ProcessingEnvironment processingEnv) {
 Elements elementUtils = processingEnv.getElementUtils();
 glideType = elementUtils.getTypeElement(GLIDE_QUALIFIED_NAME);
 lifecycleType = elementUtils.getTypeElement(LIFECYCLE_QUALIFIED_NAME);
 requestManagerTreeNodeType =
   elementUtils.getTypeElement(REQUEST_MANAGER_TREE_NODE_QUALIFIED_NAME);
 requestManagerFactoryInterface =
   elementUtils.getTypeElement(REQUEST_MANAGER_FACTORY_QUALIFIED_NAME);
 TypeElement requestManagerType = elementUtils.getTypeElement(REQUEST_MANAGER_QUALIFIED_NAME);
 requestManagerClassName = ClassName.get(requestManagerType);
}
origin: bumptech/glide

RequestBuilderGenerator(ProcessingEnvironment processingEnv, ProcessorUtil processorUtil) {
 this.processingEnv = processingEnv;
 this.processorUtil = processorUtil;
 requestBuilderType = processingEnv.getElementUtils()
   .getTypeElement(REQUEST_BUILDER_QUALIFIED_NAME);
 transcodeTypeName = TypeVariableName.get(TRANSCODE_TYPE_NAME);
 requestOptionsType = processingEnv.getElementUtils().getTypeElement(
   REQUEST_OPTIONS_QUALIFIED_NAME);
}
origin: androidannotations/androidannotations

/**
 * This method may return null if the {@link TypeElement} cannot be found in the
 * processor classpath
 */
public TypeElement typeElementFromQualifiedName(String qualifiedName) {
  return getElementUtils().getTypeElement(qualifiedName);
}
origin: androidannotations/androidannotations

private AbstractJClass getActivityCompat() {
  TypeElement androidxActivityCompat = elementUtils.getTypeElement(CanonicalNameConstants.ANDROIDX_ACTIVITY_COMPAT);
  if (hasActivityOptions(androidxActivityCompat, 2)) {
    return getClasses().ANDROIDX_ACTIVITY_COMPAT;
  }
  TypeElement activityCompat = elementUtils.getTypeElement(CanonicalNameConstants.ACTIVITY_COMPAT);
  if (hasActivityOptions(activityCompat, 2)) {
    return getClasses().ACTIVITY_COMPAT;
  }
  return null;
}
javax.lang.model.util

Most used classes

  • Elements
    Utility methods for operating on program elements.Compatibility Note: Methods may be added to this i
  • Types
    Utility methods for operating on types.Compatibility Note: Methods may be added to this interface in
  • ElementFilter
    Filters for selecting just the elements of interest from a collection of elements. The returned sets
  • ElementScanner6
    A scanning visitor of program elements with default behavior appropriate for the SourceVersion#RELEA
  • SimpleTypeVisitor6
    A simple visitor of types with default behavior appropriate for the SourceVersion#RELEASE_6 source v
  • AbstractTypeVisitor6,
  • SimpleAnnotationValueVisitor6,
  • SimpleElementVisitor6,
  • ElementKindVisitor6,
  • ElementScanner7,
  • TypeKindVisitor6,
  • SimpleElementVisitor8,
  • SimpleTypeVisitor7,
  • ElementScanner8,
  • SimpleAnnotationValueVisitor8,
  • TypeKindVisitor8,
  • ElementKindVisitor7,
  • SimpleAnnotationValueVisitor7,
  • SimpleElementVisitor7
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now