Package org.apache.beehive.netui.compiler.typesystem.declaration

Examples of org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration


        // First go through the other classes in this package to look for other classes of this type.  Only one per
        // directory is allowed.
        //
        for ( int i = 0; i < packageClasses.length; i++ )
        {
            ClassDeclaration classDecl = packageClasses[i];
            if ( CompilerUtils.getAnnotation( classDecl, CONTROLLER_TAG_NAME ) != null
                 && CompilerUtils.isAssignableFrom( baseClass, classDecl, getEnv() ) )
            {
                File file = CompilerUtils.getSourceFile( classDecl, false );
               
View Full Code Here


        if (! (typeDecl instanceof ClassDeclaration)) {
            return hasFieldAnnotations;
        }

        ClassDeclaration jclass = (ClassDeclaration) typeDecl;
        FieldDeclaration[] fields = jclass.getFields();

        for (int i = 0; i < fields.length; i++) {
            AnnotationInstance fieldAnnotation =
                    CompilerUtils.getAnnotation(fields[i], JpfLanguageConstants.SHARED_FLOW_FIELD_TAG_NAME);

            if (fieldAnnotation == null) {
                fieldAnnotation = CompilerUtils.getAnnotationFullyQualified(fields[i], CONTROL_ANNOTATION);
            }

            if (fieldAnnotation == null && additionalAnnotation != null) {
                fieldAnnotation = CompilerUtils.getAnnotation(fields[i], additionalAnnotation);
            }

            if (fieldAnnotation != null) {
                atx.include(fields[i], fieldAnnotation);
                hasFieldAnnotations = true;
            }
        }

        ClassType superclass = jclass.getSuperclass();
        boolean superclassHasFieldAnns = false;
        if (superclass != null) {
            superclassHasFieldAnns = includeFieldAnnotations(atx, CompilerUtils.getDeclaration(superclass), additionalAnnotation);
        }
View Full Code Here

            getDiagnostics().addError( jclass, "error.does-not-extend-base", FACES_BACKING_BEAN_CLASS );
            return null;
        }
       
        ClassDeclaration[] packageClasses = jclass.getPackage().getClasses();
        ClassDeclaration jpfClass = null;
       
        for ( int i = 0; i < packageClasses.length; i++ )
        {
            ClassDeclaration classDecl = packageClasses[i];
            if ( CompilerUtils.isPageFlowClass( classDecl, getEnv() ) ) jpfClass = classDecl;
        }
       
        // Don't run these checks if there's no associated page flow controller (or if it's in error).
        if (jpfClass != null) {
View Full Code Here

    {
        assert _sourceFileInfo != null;     // process() should guarantee this.
       
        if ( decl instanceof ClassDeclaration )
        {
            ClassDeclaration classDecl = ( ClassDeclaration ) decl;
            BaseChecker checker = getChecker( classDecl, this );
           
            if ( checker != null )
            {
                checker.check( classDecl );
               
                //
                // Also do a silent check on all base classes.  We don't want to generate if there were errors
                // in the base class.
                //
                SilentDiagnostics silentDiagnostics = new SilentDiagnostics();
               
                for ( ClassType i = classDecl.getSuperclass(); i != null; i = i.getSuperclass() )
                {
                    ClassDeclaration baseDecl = i.getClassTypeDeclaration();
                   
                    if ( CompilerUtils.getSourceFile( baseDecl, false ) != null )
                    {
                        BaseChecker silentChecker = getChecker( baseDecl, silentDiagnostics );
                        if ( silentChecker != null ) silentChecker.check( baseDecl );
View Full Code Here

    {
        assert _sourceFileInfo != null;     // process() should guarantee this.
       
        if ( decl instanceof ClassDeclaration )
        {
            ClassDeclaration classDecl = ( ClassDeclaration ) decl;
            BaseGenerator generator = getGenerator( classDecl, this );
            if ( generator != null ) generator.generate( classDecl );
        }
    }
View Full Code Here

        for ( Iterator ii = innerTypes.iterator(); ii.hasNext();
        {
            TypeDeclaration innerType = ( TypeDeclaration ) ii.next();
            if ( innerType instanceof ClassDeclaration )
            {
                ClassDeclaration innerClass = ( ClassDeclaration ) innerType;
               
                if ( innerType.hasModifier( Modifier.PUBLIC )
                     && CompilerUtils.isAssignableFrom( PAGEFLOW_FORM_CLASS_NAME, innerClass, _env ) )
                {
                    getMatchingFormBeans(innerClass, Boolean.valueOf(false));
View Full Code Here

     */
    String getMessageResourcesFromFormType( TypeDeclaration formTypeDecl )
    {
        if ( ! ( formTypeDecl instanceof ClassDeclaration ) ) return null;
       
        ClassDeclaration formClassDecl = ( ClassDeclaration ) formTypeDecl;
       
        AnnotationInstance ann = CompilerUtils.getAnnotation( formClassDecl, FORM_BEAN_TAG_NAME, true );
       
        if ( ann != null )
        {
View Full Code Here

        if ( ! ( type instanceof ClassDeclaration ) )
        {
            return false;
        }
       
        ClassDeclaration classDecl = ( ClassDeclaration ) type;
       
        do
        {
            //
            // First look through the action methods.
            //
            MethodDeclaration[] methods = classDecl.getMethods();
           
            for ( int i = 0; i < methods.length; i++ )
            {
                MethodDeclaration method = methods[i];
                if ( method.getSimpleName().equals( actionName )
                     && CompilerUtils.getAnnotation( method, ACTION_TAG_NAME ) != null )
                {
                    return true;
                }
            }
           
            //
            // Next, look through the simple actions (annotations).
            //
            Collection simpleActionAnnotations =
                CompilerUtils.getAnnotationArrayValue( classDecl, CONTROLLER_TAG_NAME, SIMPLE_ACTIONS_ATTR, true );
           
            if ( simpleActionAnnotations != null )
            {
                for ( Iterator i = simpleActionAnnotations.iterator(); i.hasNext();
                {
                    AnnotationInstance ann = ( AnnotationInstance ) i.next();
                    String name = CompilerUtils.getString( ann, NAME_ATTR, false );
               
                    if ( actionName.equals( name )
                            && ! CompilerUtils.annotationsAreEqual( ann, annotationToIgnore, false, env ) )
                    {
                        return true;
                    }
                }
            }
           
            ClassType superType = classDecl.getSuperclass();
            classDecl = superType != null ? superType.getClassTypeDeclaration() : null;
        } while ( checkInheritedActions && classDecl != null );
       
       
        return false;
View Full Code Here

        ArrayList classDecls = new ArrayList();
        HashSet classNames = new HashSet();
        for (Iterator i = decls.iterator(); i.hasNext();) {
            Declaration decl = (Declaration) i.next();
            if (decl instanceof ClassDeclaration) {
                ClassDeclaration jclass = (ClassDeclaration) decl;
                if (!classNames.contains(jclass.getQualifiedName())) {
                    classNames.add(jclass.getQualifiedName());
                    classDecls.add(jclass);
                }
            }
            else if (decl instanceof MethodDeclaration) {
                //
                // Declarative validation annotations on a method. Include as a
                // possible form bean that does not have the @FormBean annotation.
                //
                MethodDeclaration methodDecl = (MethodDeclaration) decl;
                TypeDeclaration type = methodDecl.getDeclaringType();
                if (type instanceof ClassDeclaration) {
                    ClassDeclaration jclass = (ClassDeclaration) type;
                    if (!classNames.contains(jclass.getQualifiedName())) {
                        classNames.add(jclass.getQualifiedName());
                        classDecls.add(jclass);
                    }
                }
            }
        }
View Full Code Here

        // First go through the other classes in this package to look for other classes of this type.  Only one per
        // directory is allowed.
        //
        for ( int i = 0; i < packageClasses.length; i++ )
        {
            ClassDeclaration classDecl = packageClasses[i];
            if ( CompilerUtils.getAnnotation( classDecl, CONTROLLER_TAG_NAME ) != null
                 && CompilerUtils.isAssignableFrom( baseClass, classDecl, getEnv() ) )
            {
                File file = CompilerUtils.getSourceFile( classDecl, false );
               
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.compiler.typesystem.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.