Package javax.lang.model.element

Examples of javax.lang.model.element.Name


    }
  }

  private Set<TypeMirror> getAllowedTypesForBuiltInConstraint(Class<? extends Annotation> annotation) {

    Name key = elementUtils.getName( annotation.getSimpleName() );
    Set<TypeMirror> allowedTypes = builtInConstraints.get( key );

    // create a mapping for the given annotation type if required
    if ( allowedTypes == null ) {
      allowedTypes = CollectionHelper.newHashSet();
View Full Code Here


        Set<? extends Element> elements = roundEnv.getElementsAnnotatedWith( SimpleAnnotation.class );

        for ( Element element : elements )
        {
            Name name = element.getSimpleName();

            PackageElement packageElement = elementUtils.getPackageOf( element );

            try
            {
                FileObject resource =
                    filer.createResource( StandardLocation.SOURCE_OUTPUT, packageElement.getQualifiedName(), name
                        + ".txt", element );

                Writer writer = resource.openWriter();
                writer.write( name.toString() );
                writer.close();
            }
            catch ( IOException e )
            {
                throw new RuntimeException( e );
View Full Code Here

    }
  }

  private Set<TypeMirror> getSupportedTypesForBuiltInConstraint(DeclaredType annotation) {

    Name key = getName( annotation );
    Set<TypeMirror> allowedTypes = builtInConstraints.get( key );

    // create a mapping for the given annotation type if required
    if ( allowedTypes == null ) {
      allowedTypes = CollectionHelper.newHashSet();
View Full Code Here


                }
                else if(element.getAnnotation(NoGatekeeper.class)==null)
                {
                    Name simpleName = element.getEnclosingElement()!=null ? element.getEnclosingElement().getSimpleName() : element.getSimpleName();
                    System.out.println(simpleName +"(#"+nameToken.value()+")" +" is missing @AccessControl annotation!");
                }
            }
        }
    }
View Full Code Here

   *
   * @return The given mirror's annotation type.
   */
  public AnnotationType getAnnotationType(AnnotationMirror annotationMirror) {

    Name key = getName( annotationMirror.getAnnotationType() );

    AnnotationType annotationType = annotationTypeCache.get( key );

    if ( annotationType != null ) {
      return annotationType;
View Full Code Here

   *
   * @return A set with the supported types.
   */
  private Set<TypeMirror> getSupportedTypes(DeclaredType constraintAnnotationType) {

    Name key = getName( constraintAnnotationType );
    Set<TypeMirror> supportedTypes = supportedTypesByConstraint.get( key );

    // create a mapping for the given annotation type if required
    if ( supportedTypes == null ) {
      supportedTypes = determineSupportedTypes( constraintAnnotationType );
View Full Code Here

    DeclaredType annotation = annotationApiHelper.getDeclaredTypeByName( annotationType );

    if ( annotation == null ) {
      return;
    }
    Name key = getName( annotation );
    Set<TypeMirror> types = supportedTypesByConstraint.get( key );

    if ( types == null ) {
      supportedTypesByConstraint.put( key, new HashSet<TypeMirror>( supportedTypes ) );
    }
View Full Code Here

    }
  }

  private Set<AnnotationMirror> getComposingConstraints(DeclaredType constraintAnnotationType) {

    Name key = getName( constraintAnnotationType );

    Set<AnnotationMirror> composingConstraints = composingConstraintsByConstraints.get( key );

    if( composingConstraints != null ) {
      return composingConstraints;
View Full Code Here

      // make sure we only work on classes or interfaces @Path annotated
      if (annotation != null && (element.getKind() == ElementKind.CLASS || element.getKind() == ElementKind.INTERFACE)) {
        messager.printMessage(Kind.NOTE, "Generating documentation class for : " + element);
        // extract some names
        Name name = element.getSimpleName();
        PackageElement elementPackage = elementUtils.getPackageOf(element);
        // the javadoc
        String doc = elementUtils.getDocComment(element);
        // build a new class name
        String className = elementPackage.getQualifiedName() + "." + name + "_Doc";
View Full Code Here

    }
    return null;
  }

  private boolean isNamed(ExecutableElement element, String name) {
    Name simpleName = element.getSimpleName();
    Name expectedName = elementUtils.getName(name);
    return expectedName.equals(simpleName);
  }
View Full Code Here

TOP

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

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.