Examples of InterfaceDeclaration


Examples of com.sun.mirror.declaration.InterfaceDeclaration

        //
        ArrayList<InterfaceDeclaration> intfList = new ArrayList<InterfaceDeclaration>();
        intfList.add(_eventSet);
        for (int i = 0; i < intfList.size(); i++)
        {
            InterfaceDeclaration intfDecl = intfList.get(i);

            //
            // Don't add events that are derived from a super event set.  These are not added because
            // this class picks a single super interface to extend from when building a hierarchy
            // of callback notifiers (etc).  So, the super event set that was chosen first is left out
            // of the list of event methods since they're captured in superclasses in the Control's implementation
            //
            if (_superEventSet != null && _superEventSet.getClassName().equals(intfDecl.getQualifiedName()))
                continue;

            // Add all declared methods, but ignore the mystery <clinit> methods
            for (MethodDeclaration methodDecl : intfDecl.getMethods())
                if (!methodDecl.toString().equals("<clinit>()"))
                    events.add(new AptEvent(this, methodDecl, _ap));

            //
            // Add all superinterfaces of the target interface to the list
            //
            for (InterfaceType superType: intfDecl.getSuperinterfaces())
            {
                InterfaceDeclaration superDecl = superType.getDeclaration();
                if (superDecl != null && !intfList.contains(superDecl))
                    intfList.add(superDecl);
            }
        }
View Full Code Here

Examples of com.sun.mirror.declaration.InterfaceDeclaration

            return null;
       
        Collection<InterfaceType> superInterfaces = _implDecl.getSuperinterfaces();
        for (InterfaceType intfType : superInterfaces)
        {
            InterfaceDeclaration intfDecl = intfType.getDeclaration();
            if (intfDecl != null &&
                intfDecl.getAnnotation(org.apache.beehive.controls.api.bean.ControlInterface.class) != null)
                return new AptControlInterface(intfDecl, _ap);
        }

        return null;
    }
View Full Code Here

Examples of com.sun.mirror.declaration.InterfaceDeclaration

        if ( _intfDecl.getSuperinterfaces() == null )
            return null;

        for (InterfaceType intfType : _intfDecl.getSuperinterfaces())
        {
            InterfaceDeclaration superDecl = intfType.getDeclaration();
            if ( superDecl != null )
            {
                if (superDecl.getAnnotation(ControlExtension.class) != null ||
                    superDecl.getAnnotation(ControlInterface.class) != null)
                {
                    _superDecl = superDecl;
                    return intfType;
                }
            }
View Full Code Here

Examples of com.sun.mirror.declaration.InterfaceDeclaration

            }

            return null;
        }

        InterfaceDeclaration superDecl = superType.getDeclaration();
        if ( superDecl != null )
        {
            if (superDecl.getAnnotation(ControlExtension.class) != null ||
                superDecl.getAnnotation(ControlInterface.class) != null)
            {
                _superDecl = superDecl;
                AptControlInterface superIntf = new AptControlInterface(_superDecl, _ap);

                if (!isExtension() && superIntf.isExtension())
View Full Code Here

Examples of com.sun.mirror.declaration.InterfaceDeclaration

        Vector<InterfaceDeclaration> checkIntfs = new Vector<InterfaceDeclaration>();
        checkIntfs.add(_intfDecl);

        for (int i = 0; i < checkIntfs.size(); i++)
        {
            InterfaceDeclaration intfDecl = checkIntfs.elementAt(i);
            if (intfDecl.equals(_superDecl))
                continue;

            if ( intfDecl.getMethods() == null )
                continue;

            // Add all declared methods, but ignore the mystery <clinit> methods
            for (MethodDeclaration methodDecl : intfDecl.getMethods())
                if (!methodDecl.toString().equals("<clinit>()"))
                    operList.add(new AptOperation(this, methodDecl, _ap));

            if ( intfDecl.getSuperinterfaces() == null )
                continue;

            for (InterfaceType superType : intfDecl.getSuperinterfaces())
            {
                InterfaceDeclaration superDecl = superType.getDeclaration();
                if (superDecl != null && !checkIntfs.contains(superDecl))
                    checkIntfs.add(superDecl);
            }
        }
View Full Code Here

Examples of com.sun.mirror.declaration.InterfaceDeclaration

        AptControlInterface mostDerived = (AptControlInterface) getMostDerivedInterface();
        if ( mostDerived == null )
            return;

        InterfaceDeclaration intfDecl = mostDerived._intfDecl;

        if ( intfDecl == null )
            return;

        AnnotationMirror controlMirror = null;

        for (AnnotationMirror annot : intfDecl.getAnnotationMirrors())
        {
            if (annot.getAnnotationType().getDeclaration().getQualifiedName().equals(
                    "org.apache.beehive.controls.api.bean.ControlInterface"))
            {
                controlMirror = annot;
                break;
            }
        }

        assert ( controlMirror != null ) : "Found a control interface that isn't annotated properly: " + intfDecl;

        AptAnnotationHelper controlAnnot = new AptAnnotationHelper(controlMirror);

        //
        // Read the name of the checker class from the @ControlInterface annotation,
        // dynamically load and run it.
        //

        DeclaredType checkerMirror = (DeclaredType)controlAnnot.getObjectValue("checker");
        if ( checkerMirror == null )
        {
            // try the deprecated 'checkerClass' attribute
            checkerMirror = (DeclaredType)controlAnnot.getObjectValue("checkerClass");
        }

        if ( checkerMirror != null && checkerMirror.getDeclaration() != null )
        {
            // TODO: optimize to not invoke default checker?
            String checkerName = checkerMirror.toString();

            try
            {
                ClassLoader loader = getExternalClassLoader();

                Class checkerClass = loader.loadClass( checkerName );
                if ( !ControlChecker.class.isAssignableFrom(checkerClass) )
                {
                    _ap.printError( intfDecl, "control.interface.illegal.checker", intfDecl.getSimpleName(), checkerName );
                }
                else
                {

                    Constructor ctor = checkerClass.getConstructor();

                    ControlChecker checker = (ControlChecker) ctor.newInstance();
                    CheckerAnnotationProcessorEnvironmentImpl ape =
                            new CheckerAnnotationProcessorEnvironmentImpl(_ap);
                    checker.check( _intfDecl, ape );
                }
            }
            catch ( Exception e ) {
                _ap.printError( intfDecl, "control.interface.checker.load.failed", intfDecl.getSimpleName(), checkerName );
            }
        }
    }
View Full Code Here

Examples of com.sun.mirror.declaration.InterfaceDeclaration

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

      InterfaceDeclaration 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 com.sun.mirror.declaration.InterfaceDeclaration

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

      InterfaceDeclaration 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 com.sun.mirror.declaration.InterfaceDeclaration

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

      InterfaceDeclaration 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 lombok.ast.InterfaceDeclaration

    if (tail != null) for (Node n : tail) if (n != null) result.superInterfaces.add(n);
    return posify(result);
  }
 
  public Node createInterfaceDeclaration(Node modifiers, Node name, Node params, Node body, List<Node> addons) {
    InterfaceDeclaration decl = new InterfaceDeclaration().astName(createIdentifierIfNeeded(name, currentPos())).rawBody(body);
    if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
    if (params instanceof TemporaryNode.OrphanedTypeVariables) {
      TemporaryNode.OrphanedTypeVariables otv = (TemporaryNode.OrphanedTypeVariables)params;
      if (otv.variables != null) for (Node typeParameter : otv.variables) {
        if (typeParameter != null) decl.rawTypeVariables().addToEnd(typeParameter);
      }
    }
   
    if (addons != null) for (Node n : addons) {
      if (n instanceof TemporaryNode.ExtendsClause) {
        //if (!decl.extending().isEmpty()) //TODO add error node: multiple extends clauses.
        List<Node> superClasses = ((TemporaryNode.ExtendsClause)n).superTypes;
        if (superClasses != null) for (Node superClass : superClasses) if (superClass != null) decl.rawExtending().addToEnd(superClass);
      }
     
      //if (n instanceof TemporaryNode.ImplementsClause) //TODO add error node: implements not allowed here.
    }
   
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.