Package javax.lang.model.element

Examples of javax.lang.model.element.Element


    private boolean isOperatorHelper(ExecutableElement method) {
        assert method != null;
        for (AnnotationMirror mirror : method.getAnnotationMirrors()) {
            DeclaredType annotationType = mirror.getAnnotationType();
            Element element = annotationType.asElement();
            if (element != null && element.getAnnotation(OperatorHelper.class) != null) {
                return true;
            }
        }
        return false;
    }
View Full Code Here


        TypeVariable var = (TypeVariable) type;
        TypeParameterElement parameter = (TypeParameterElement) var.asElement();
        if (hasKindMatched(environment, parameter) == false) {
            return false;
        }
        Element parent = parameter.getEnclosingElement();
        // MEMO Eclipse JDT returns null for "TypeParameterElement.enclosingElement."
        if (parent == null) {
            return true;
        }
        return isOperatorSource(environment, parent);
View Full Code Here

        return factory.newSimpleName(simpleName.toString());
    }

    private NamedType convertToRawType(DeclaredType type) {
        assert type != null;
        Element element = type.asElement();
        if (element == null) {
            return null;
        }
        switch (element.getKind()) {
        case CLASS:
        case INTERFACE:
        case ENUM:
        case ANNOTATION_TYPE: {
            Name name = asName(((TypeElement) element).getQualifiedName());
View Full Code Here

    final TypeMirror superClass = entity.getTypeElement().getSuperclass();
    //superclass of Object is of NoType which returns some other kind
    if ( superClass.getKind() == TypeKind.DECLARED ) {
      //F..king Ch...t Have those people used their horrible APIs even once?
      final Element superClassElement = ( ( DeclaredType ) superClass ).asElement();
      String superClassName = ( ( TypeElement ) superClassElement ).getQualifiedName().toString();
      if ( context.getMetaEntitiesToProcess().containsKey( superClassName )
          || context.getMetaSuperclassAndEmbeddableToProcess().containsKey( superClassName ) ) {
        pw.print( " extends " + superClassName + "_" );
      }
View Full Code Here

  static public TypeElement getSuperclassTypeElement(TypeElement element) {
    final TypeMirror superClass = element.getSuperclass();
    //superclass of Object is of NoType which returns some other kind
    if ( superClass.getKind() == TypeKind.DECLARED ) {
      //F..king Ch...t Have those people used their horrible APIs even once?
      final Element superClassElement = ( ( DeclaredType ) superClass ).asElement();
      return ( TypeElement ) superClassElement;
    }
    else {
      return null;
    }
View Full Code Here

  private AccessType determineAnnotationSpecifiedAccessType(Element element) {
    final AnnotationMirror accessAnnotationMirror = TypeUtils.getAnnotationMirror( element, Access.class );
    AccessType forcedAccessType = null;
    if ( accessAnnotationMirror != null ) {
      Element accessElement = ( Element ) TypeUtils.getAnnotationValue(
          accessAnnotationMirror,
          DEFAULT_ANNOTATION_PARAMETER_NAME
      );
      if ( accessElement.getKind().equals( ElementKind.ENUM_CONSTANT ) ) {
        if ( accessElement.getSimpleName().toString().equals( AccessType.PROPERTY.toString() ) ) {
          forcedAccessType = AccessType.PROPERTY;
        }
        else if ( accessElement.getSimpleName().toString().equals( AccessType.FIELD.toString() ) ) {
          forcedAccessType = AccessType.FIELD;

        }
        else {
          context.logMessage( Diagnostic.Kind.ERROR, "Unexpected type for access type" );
View Full Code Here

  public static boolean isString(TypeMirror mirror) {
    if (!(mirror instanceof DeclaredType))
      return false;
   
    DeclaredType type = (DeclaredType) mirror;
    Element e = type.asElement();
    if (!(e instanceof TypeElement))
      return false;
   
    TypeElement typeElement = (TypeElement) e;
   
View Full Code Here

        try {
            ElementScanner6<Void,Void> scanner = new ElementScanner6<Void, Void>() {
                @Override
                public Void visitType(TypeElement e, Void aVoid) {
                    if(!e.getModifiers().contains(Modifier.ABSTRACT)) {
                        Element sc = asElement(e.getSuperclass());
                        if (sc!=null && ((TypeElement)sc).getQualifiedName().contentEquals("hudson.Plugin")) {
                            try {
                                write(e);
                            } catch (IOException x) {
                                StringWriter sw = new StringWriter();
View Full Code Here

  public static TypeElement getSuperclassTypeElement(TypeElement element) {
    final TypeMirror superClass = element.getSuperclass();
    //superclass of Object is of NoType which returns some other kind
    if ( superClass.getKind() == TypeKind.DECLARED ) {
      //F..king Ch...t Have those people used their horrible APIs even once?
      final Element superClassElement = ( (DeclaredType) superClass ).asElement();
      return (TypeElement) superClassElement;
    }
    else {
      return null;
    }
View Full Code Here

  public static AccessType determineAnnotationSpecifiedAccessType(Element element) {
    final AnnotationMirror accessAnnotationMirror = TypeUtils.getAnnotationMirror( element, Access.class );
    AccessType forcedAccessType = null;
    if ( accessAnnotationMirror != null ) {
      Element accessElement = (Element) TypeUtils.getAnnotationValue(
          accessAnnotationMirror,
          DEFAULT_ANNOTATION_PARAMETER_NAME
      );
      if ( accessElement.getKind().equals( ElementKind.ENUM_CONSTANT ) ) {
        if ( accessElement.getSimpleName().toString().equals( AccessType.PROPERTY.toString() ) ) {
          forcedAccessType = AccessType.PROPERTY;
        }
        else if ( accessElement.getSimpleName().toString().equals( AccessType.FIELD.toString() ) ) {
          forcedAccessType = AccessType.FIELD;
        }
      }
    }
    return forcedAccessType;
View Full Code Here

TOP

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

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.