Package com.sun.mirror.declaration

Examples of com.sun.mirror.declaration.ClassDeclaration


    return shortest;
  }

  @NotNull
  public ClassDeclaration findClassDeclarationWithShortestFQName() {
    ClassDeclaration shortest = null;
    for ( ClassDeclaration classDeclaration : classDeclarations ) {
      if ( shortest == null || shortest.getQualifiedName().length() > classDeclaration.getQualifiedName().length() ) {
        shortest = classDeclaration;
      }
    }

    if ( shortest == null ) {
View Full Code Here


  @Nonnull
  public static Collection<FieldDeclaration> findFieldsIncludingSuperClasses( @Nonnull ClassDeclaration classDeclaration ) {
    Collection<FieldDeclaration> fields = new ArrayList<FieldDeclaration>();

    ClassDeclaration current = classDeclaration;
    while ( current != null && isNotObject( current ) ) {
      fields.addAll( current.getFields() );
      current = current.getSuperclass().getDeclaration();
    }

    return fields;
  }
View Full Code Here

  @Nonnull
  public static Collection<? extends MethodDeclaration> findMethodsIncludingSuperClass( @Nonnull ClassDeclaration classDeclaration ) {
    Collection<MethodDeclaration> methods = new ArrayList<MethodDeclaration>();

    ClassDeclaration current = classDeclaration;
    while ( current != null && isNotObject( current ) ) {
      methods.addAll( current.getMethods() );
      current = current.getSuperclass().getDeclaration();
    }

    return methods;
  }
View Full Code Here

    if ( classDeclarations.size() == 1 ) {
      return classDeclarations.get( 0 );
    }

    //Find the shortest
    ClassDeclaration shortest = findClassDeclarationWithShortestFQName();

    //Verify the other are just inner classes!
    for ( ClassDeclaration classDeclaration : classDeclarations ) {
      if ( !classDeclaration.getQualifiedName().startsWith( shortest.getQualifiedName() ) ) {
        throw new IllegalStateException( "Invalid class declarations count found: " + classDeclarations.size() + " (" + classDeclarations + ")" );
      }
    }

    return shortest;
View Full Code Here

  }

  @Deprecated
  @Nonnull
  public ClassDeclaration findClassDeclarationWithShortestFQName() {
    ClassDeclaration shortest = null;
    for ( ClassDeclaration classDeclaration : classDeclarations ) {
      if ( shortest == null || shortest.getQualifiedName().length() > classDeclaration.getQualifiedName().length() ) {
        shortest = classDeclaration;
      }
    }

    if ( shortest == null ) {
View Full Code Here

                for (InterfaceType intf : d.getSuperinterfaces()) {
                    checkContract(intf.getDeclaration(), d);
                }

                // look for contract in super classes
                ClassDeclaration sd = d;
                while(sd.getSuperclass()!=null) {
                    sd = sd.getSuperclass().getDeclaration();
                    checkContract(sd,d);
                }
            } else {
                // we need to check if that class previously add an @Service annotation so
                // we remove the entry from the META-INF file
View Full Code Here

        // traverse up the inheritance tree and find all supertypes that have @Contract
        while(true) {
            checkSuperInterfaces(d);
            if (d instanceof ClassDeclaration) {
                ClassDeclaration cd = (ClassDeclaration) d;
                checkContract(cd);
                ClassType sc = cd.getSuperclass();
                if(sc==null)    break;
                d = sc.getDeclaration();
            } else
                break;
        }
View Full Code Here

TOP

Related Classes of com.sun.mirror.declaration.ClassDeclaration

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.