Package javax.lang.model.element

Examples of javax.lang.model.element.PackageElement


        final Types typeUtils = processingEnv.getTypeUtils();
        final Elements elementUtils = processingEnv.getElementUtils();

        for (Element e : roundEnv.getElementsAnnotatedWith(Store.class)) {
            TypeElement storeElement = (TypeElement) e;
            PackageElement packageElement = (PackageElement) storeElement.getEnclosingElement();

            final String packageName = packageElement.getQualifiedName().toString();
            final String storeDelegate = storeElement.getSimpleName().toString();
            final boolean changeSupport = typeUtils.isAssignable(storeElement.asType(),
                    elementUtils.getTypeElement(ChangeSupport.class.getName()).asType());
            final String storeClassName = GenerationUtil.storeImplementation(storeDelegate);
            messager.printMessage(NOTE,
View Full Code Here


                final String module = comps.value();
                if (module != null && module.length() > 0) {
                    modules.add(module);
                }

                PackageElement packageElement = processingEnv.getElementUtils().getPackageOf(element);
                String fqn = packageElement.getQualifiedName().toString()+"."+
                        element.getSimpleName().toString();
                System.out.println("Components: " + fqn);
                discoveredExtensions.add(fqn);
            }
        }
View Full Code Here

        {
            final String annotationType = mirror.getAnnotationType().toString();

            if ( annotationType.equals(BeanFactoryExtension.class.getName()) )
            {
                PackageElement packageElement = processingEnv.getElementUtils().getPackageOf(element);
                String fqn = packageElement.getQualifiedName().toString()+"."+
                        element.getSimpleName().toString();
                System.out.println("Factory: " + fqn);
                discoveredBeanFactories.add(fqn);
            } else if (annotationType.equals("com.google.web.bindery.autobean.shared.AutoBeanFactory.Category")) {
                final Collection<? extends AnnotationValue> values = mirror.getElementValues().values();
View Full Code Here

  public final String getQualifiedName() {
    return element.getQualifiedName().toString();
  }

  public final String getPackageName() {
    PackageElement packageOf = context.getElementUtils().getPackageOf( element );
    return context.getElementUtils().getName( packageOf.getQualifiedName() ).toString();
  }
View Full Code Here

  // end::prePassivate[]

  // tag::processBundle[]
  private void processBundle(ApplicationMetaModel application, ElementHandle.Package pkg, String bundleName) {
    ProcessingContext context = application.getProcessingContext();
    PackageElement pkgElt = context.get(pkg);
    Properties properties = loadBundle(context, pkg, bundleName);
    if (properties == null) {
      throw BUNDLE_NOT_FOUND.failure(pkgElt, bundleName);
    } else {
      try {
View Full Code Here

                GinExtension comps = element.getAnnotation(GinExtension.class);
                final String module = comps.value();
                if (module != null && module.length() > 0) {
                    modules.add(module);
                }
                PackageElement packageElement = processingEnv.getElementUtils().getPackageOf(element);
                String fqn = packageElement.getQualifiedName().toString() + "." +
                        element.getSimpleName().toString();
                System.out.println("Components: " + fqn);
                discoveredExtensions.add(fqn);
            }
        }
View Full Code Here

    private void handleBeanFactoryElement(Element element) {
        List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();
        for (AnnotationMirror mirror : annotationMirrors) {
            final String annotationType = mirror.getAnnotationType().toString();
            if (annotationType.equals(BeanFactoryExtension.class.getName())) {
                PackageElement packageElement = processingEnv.getElementUtils().getPackageOf(element);
                String fqn = packageElement.getQualifiedName().toString() + "." +
                        element.getSimpleName().toString();
                System.out.println("Factory: " + fqn);
                discoveredBeanFactories.add(fqn);
            } else if (annotationType.equals("com.google.web.bindery.autobean.shared.AutoBeanFactory.Category")) {
                final Collection<? extends AnnotationValue> values = mirror.getElementValues().values();
View Full Code Here

    if (element.getSimpleName().length() != 0) {
      return element.getSimpleName().toString();
    }

    // take the binary name for anonymous classes
    PackageElement pack = ElementUtils.enclosingPackage(element);
    String packageName = pack != null && !pack.isUnnamed() ? pack.getQualifiedName().toString() : "";

    if (element instanceof ClassSymbol) {
      return ((ClassSymbol) element).flatName().toString().substring(packageName.length() + 1);
    }
    return null;
View Full Code Here

  private <A extends Annotation> A getAnnotation(Class<A> annotationType) {
    A a = element.getAnnotation(annotationType);
    if (a != null) {
      return a;
    }
    PackageElement pack = ElementUtils.enclosingPackage(element);
    return pack == null ? null : pack.getAnnotation(annotationType);
  }
View Full Code Here

   * @param element an element enclosed by a class, or a {@code TypeElement}
   * @return The qualified {@code Name} of the innermost class enclosing the element
   */
  public static/* @Nullable */Name getQualifiedClassName(Element element) {
    if (element.getKind() == ElementKind.PACKAGE) {
      PackageElement elem = (PackageElement) element;
      return elem.getQualifiedName();
    }

    TypeElement elem = enclosingClass(element);
    if (elem == null) {
      return null;
    }

    return elem.getQualifiedName();
  }
View Full Code Here

TOP

Related Classes of javax.lang.model.element.PackageElement

Copyright © 2018 www.massapicom. 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.