Package javax.lang.model.element

Examples of javax.lang.model.element.Element.accept()


    if (!result) {
      Element superclass =
          utils.typeUtils.asElement(e.getSuperclass());
      if (superclass != null) {
        /* Scans up in the syntax tree looking for contract annotations. */
        result = superclass.accept(this, null);
      }
    }

    /* Checks interfaces. */
    if (!result) {
View Full Code Here


    /* Checks interfaces. */
    if (!result) {
      Collection<? extends TypeMirror> interfaces = e.getInterfaces();
      for (TypeMirror i : interfaces) {
        Element iface = utils.typeUtils.asElement(i);
        result = iface.accept(this, null);
        if (result) {
          break;
        }
      }
    }
View Full Code Here

      messager.printMessage(Kind.ERROR,
          "Only one " + hookAnnotation.getCanonicalName() + " hook is allowed with the project", annotated.iterator().next());
      return null;
    }
    Element updateElement = annotated.iterator().next();
    TypeElement typeElement = updateElement.accept(new TypeResolvingVisitor(), null);
    boolean implementsDbUpdate = false;
    for (TypeMirror typeMirror : typeElement.getInterfaces()) {
      if (typeMirror.toString().equals(hookInterface.getCanonicalName())) {
        implementsDbUpdate = true;
      }
View Full Code Here

    if (updateAnnotated.size() > 1) {
      messager.printMessage(Kind.ERROR, "Only one @Update hook is allowed with the project", updateAnnotated.iterator().next());
      return null;
    }
    Element updateElement = updateAnnotated.iterator().next();
    TypeElement typeElement = updateElement.accept(new TypeResolvingVisitor(), null);
    boolean implementsDbUpdate = false;
    for (TypeMirror typeMirror : typeElement.getInterfaces()) {
      if (typeMirror.toString().equals(DbUpdate.class.getCanonicalName())) {
        implementsDbUpdate = true;
      }
View Full Code Here

  public static TypeElement asTypeElement(Types types, TypeMirror mirror) {
    checkNotNull(types);
    checkNotNull(mirror);
    Element element = types.asElement(mirror);
    checkArgument(element != null);
    return element.accept(new SimpleElementVisitor6<TypeElement, Void>() {
      @Override
      protected TypeElement defaultAction(Element e, Void p) {
        throw new IllegalArgumentException();
      }
View Full Code Here

  FactoryMethodDescriptor generateDescriptorForConstructor(final AutoFactoryDeclaration declaration,
      ExecutableElement constructor) {
    checkNotNull(constructor);
    checkArgument(constructor.getKind() == ElementKind.CONSTRUCTOR);
    Element classElement = constructor.getEnclosingElement();
    Name returnType = classElement.accept(
        new ElementKindVisitor6<Name, Void>() {
          @Override
          protected Name defaultAction(Element e, Void p) {
            throw new AssertionError();
          }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.