Examples of TypeElement


Examples of javax.lang.model.element.TypeElement

      String baseName = extensionTag.baseClassName();
      description.append("<p><b>Extended tag: </b>");
      description.append(baseName);
      description.append("</p>");

      TypeElement declaration = getInterfaceDeclaration(baseName + "Declaration");
      if (declaration != null) {
        UIComponentTag baseComponentTag = declaration.getAnnotation(UIComponentTag.class);
        if (baseComponentTag != null) {
          description.append(createDescription(baseComponentTag));
        }
      }
    }
View Full Code Here

Examples of javax.lang.model.element.TypeElement

    }
   
    // if empty, we're probably extending an existing factory
    if (factory.getTypeArguments().size() > 0) {
      DeclaredType argument = ((DeclaredType) factory.getTypeArguments().get(0));
      TypeElement factoryType = (TypeElement) argument.asElement();
      if (!factoryType.getQualifiedName().equals(declaration.getQualifiedName())) {
        success = false;
        messager.printMessage(ERROR,
            format("Expected EntityFactory<%s>, but found EntityFactory<%s>",
                declaration.getSimpleName(),
                factoryType.getSimpleName()),
            declaration);
      }
    }
   
    for (FactoryMethod method : methods)
View Full Code Here

Examples of javax.lang.model.element.TypeElement

      return null;
    }
  }

  private FactoryMethod bindMethod(ExecutableElement method, DeclaredType value) {
    TypeElement component = (TypeElement)value.asElement();
    components.add(component);
   
    // scan for UseSetter
    String setterMethod = null;
    AnnotationMirror setterMirror = ProcessorUtil.mirror(UseSetter.class, method);
View Full Code Here

Examples of javax.lang.model.element.TypeElement

  }

  private Map<String, TypeElement> readGlobalCRefs(TypeElement declaration) {
    Map<String, TypeElement> autoResolvable = new HashMap<String, TypeElement>();
    for (AnnotationValue value : readCRef(declaration)) {
      TypeElement type = (TypeElement)((DeclaredType)value.getValue()).asElement();
      this.components.add(type);
      autoResolvable.put(key(type), type);
    }
   
    return autoResolvable;
View Full Code Here

Examples of javax.lang.model.element.TypeElement

 
  private static void parentInterfaces(List<? extends TypeMirror> interfaceMirrors,
      Set<TypeElement> target) {
   
    for (TypeMirror mirror : interfaceMirrors) {
      TypeElement found = (TypeElement) ((DeclaredType) mirror).asElement();
      target.add(found);
      parentInterfaces(found.getInterfaces(), target);
    }
  }
View Full Code Here

Examples of javax.lang.model.element.TypeElement

    DeclaredType type = (DeclaredType) mirror;
    Element e = type.asElement();
    if (!(e instanceof TypeElement))
      return false;
   
    TypeElement typeElement = (TypeElement) e;
   
    return typeElement.getQualifiedName().toString().equals("java.lang.String");
  }
View Full Code Here

Examples of javax.lang.model.element.TypeElement

      annotatedElementsOfMethod.add(element);
    }
  }

  private void checkOverriddenMethods(ExecutableElement method) {
    TypeElement declaringType = (TypeElement)method.getEnclosingElement();
    Set<Element> errorElements = new HashSet<Element>();
    Set<Element> warnedElements = new HashSet<Element>();
    typeLoop:
    for (TypeMirror supertypeMirror : getAllSupertypes(processingEnv.getTypeUtils().getDeclaredType(declaringType))) {
      for (Element element : ((TypeElement)processingEnv.getTypeUtils().asElement(supertypeMirror)).getEnclosedElements()) {
View Full Code Here

Examples of javax.lang.model.element.TypeElement

  private Set<ConstraintCheckError> checkAnnotationValue(TypeElement element, AnnotationMirror annotation) {
    Set<ConstraintCheckError> errors = CollectionHelper.newHashSet();
    AnnotationValue value = annotationApiHelper.getAnnotationValue( annotation, "value" );
    TypeMirror valueType = (TypeMirror) value.getValue();
    TypeElement valueElement = (TypeElement) typeUtils.asElement( valueType );

    if ( valueElement.getKind().isInterface() || valueElement.getModifiers().contains( Modifier.ABSTRACT ) ) {
      errors.add(
          new ConstraintCheckError(
              element,
              annotation,
              "GROUP_SEQUENCE_PROVIDER_ANNOTATION_VALUE_MUST_BE_AN_IMPLEMENTATION_CLASS"
View Full Code Here

Examples of javax.lang.model.element.TypeElement

      String packageName = mappings.getPackage();

      for ( Entity entity : mappings.getEntity() ) {
        String name = entity.getClazz();
        fqcn = StringUtil.determineFullyQualifiedClassName( packageName, name );
        TypeElement element = context.getTypeElementForFullyQualifiedName( fqcn );
        if ( element != null ) {
          TypeUtils.determineAccessTypeForHierarchy( element, context );
        }
      }

      for ( org.hibernate.jpamodelgen.xml.jaxb.MappedSuperclass mappedSuperClass : mappings.getMappedSuperclass() ) {
        String name = mappedSuperClass.getClazz();
        fqcn = StringUtil.determineFullyQualifiedClassName( packageName, name );
        TypeElement element = context.getTypeElementForFullyQualifiedName( fqcn );
        if ( element != null ) {
          TypeUtils.determineAccessTypeForHierarchy( element, context );
        }
      }
    }
View Full Code Here

Examples of javax.lang.model.element.TypeElement

      this.type = elem;
    }

    @Override
    public Boolean visitDeclared(DeclaredType declaredType, Element element) {
      TypeElement returnedElement = (TypeElement) context.getTypeUtils().asElement( declaredType );

      String fqNameOfReturnType = returnedElement.getQualifiedName().toString();
      String collection = Constants.COLLECTIONS.get( fqNameOfReturnType );
      if ( collection != null ) {
        TypeMirror collectionElementType = TypeUtils.getCollectionElementType(
            declaredType, fqNameOfReturnType, null, context
        );
        returnedElement = (TypeElement) context.getTypeUtils().asElement( collectionElementType );
      }

      if ( type.getQualifiedName().toString().equals( returnedElement.getQualifiedName().toString() ) ) {
        return Boolean.TRUE;
      }
      else {
        return Boolean.FALSE;
      }
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.