Package javax.lang.model.element

Examples of javax.lang.model.element.PackageElement


                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

    private void createSpecReference(ExecutableElement methodElement,
          Map<? extends ExecutableElement, ? extends AnnotationValue> annotationParameters) {
      
        SpecReference ref = new SpecReference();
       
        PackageElement packageElement = getEnclosingPackageElement(methodElement);
        ref.setPackageName(packageElement.getQualifiedName().toString());
        ref.setClassName(methodElement.getEnclosingElement().getSimpleName().toString());
        ref.setMethodName(methodElement.getSimpleName().toString());
        for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : annotationParameters.entrySet()) {
            final String elementKey = entry.getKey().toString();
           
View Full Code Here

  }

  @Override
  public void init(ApplicationMetaModel application) {
    ControllersMetaModel controllers = new ControllersMetaModel(this);
    PackageElement pkg = application.model.processingContext.get(application.getHandle());
    AnnotationMirror annotation = Tools.getAnnotation(pkg, Application.class.getName());
    AnnotationState values = AnnotationState.create(annotation);
    Boolean escapeXML = (Boolean)values.get("escapeXML");
    ElementHandle.Type defaultControllerElt = (ElementHandle.Type)values.get("defaultController");
    ElementHandle.Type errorControllerElt = (ElementHandle.Type)values.get("errorController");
View Full Code Here

        //
        if (version == null || version.length() == 0) {
          String path = "META-INF/maven/org.webjars/" + id + "/pom.properties";
          URL resource = WebJarAssetLocator.class.getClassLoader().getResource(path);
          ElementHandle.Package pkgHandle = ElementHandle.Package.create(pkg);
          PackageElement pkgElt = env.get(pkgHandle);
          if (resource == null) {
            throw MISSING_WEBJAR.failure(pkgElt, id);
          } else {
            Properties props = new Properties();
            InputStream in = null;
View Full Code Here

    // Distribute per application nevents
    context.processEvents();
  }

  void emitApplication(ProcessingContext env, ApplicationMetaModel application) throws ProcessingException {
    PackageElement elt = env.get(application.getHandle());
    Name fqn = application.getName().append("Application");

    //
    Writer writer = null;
    try {
View Full Code Here

      case CLASS: {
        TypeElement typeElt = (TypeElement)elt;
        return Type.create(typeElt);
      }
      case PACKAGE: {
        PackageElement packageElt = (PackageElement)elt;
        return Package.create(packageElt);
      }
      case METHOD: {
        ExecutableElement packageElt = (ExecutableElement)elt;
        return Method.create(packageElt);
View Full Code Here

    for (Map.Entry<Name, AnnotationState> entry : clone.entrySet()) {
      AnnotationState annotation = entry.getValue();
      Name pkg = entry.getKey();
      ProcessingContext env = metaModel.processingContext;
      ElementHandle.Package pkgHandle = ElementHandle.Package.create(pkg);
      PackageElement pkgElt = env.get(pkgHandle);
      Boolean minify = (Boolean)annotation.get("minify");
      List<String> resources = (List<String>)annotation.get("value");

      // WARNING THIS IS NOT CORRECT BUT WORK FOR NOW
      AnnotationMirror annotationMirror = Tools.getAnnotation(pkgElt, Less.class.getName());
View Full Code Here

  @Override
  public void postProcessAnnotations(ApplicationMetaModel metaModel) {
    ElementHandle.Package pkg = metaModel.getHandle();
    AnnotationState annotation = servlets.remove(pkg);
    if (annotation != null) {
      PackageElement pkgElt = metaModel.processingContext.get(pkg);
      String urlPattern = (String)annotation.get("value");
      String simpleName = (String)annotation.get("name");
      String resourceBundle = (String)annotation.get("resourceBundle");
      if (simpleName == null) {
        simpleName = metaModel.getBaseName() + "Servlet";
View Full Code Here

  public void postProcessEvents(ApplicationMetaModel application) {
    // Do GC
    ElementHandle.Package pkg = application.getHandle();
    String[] names = enabledMap.get(pkg);
    if (names != null) {
      PackageElement pkgElt = application.model.processingContext.get(pkg);
      AnnotationMirror am = Tools.getAnnotation(pkgElt, Portlet.class.getName());
      if (am == null) {
        enabledMap.remove(pkg);
        toEmit.remove(pkg);
      }
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.