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

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


                                                        "warning.runtime-version", new Object[]{ PAGEFLOW_RUNTIME_JAR } );

        //
        // Check the Jpf.Controller annotation on this class.
        //
        AnnotationInstance controllerAnnotation = CompilerUtils.getAnnotation( jclass, CONTROLLER_TAG_NAME );
        if ( controllerAnnotation != null ) _controllerGrammar.check( controllerAnnotation, null, jclass );
       
        //
        // Check relative paths on Jpf.Catch, Jpf.Forward, and Jpf.SimpleAction annotations on superclasses.
        // If inheritLocalPaths is set to true on @Jpf.Controller, then we don't need to do this check, since
View Full Code Here


           
            if ( simpleActions != null )
            {
                for ( Iterator j = simpleActions.iterator(); j.hasNext();
                {
                    AnnotationInstance i = ( AnnotationInstance ) j.next();
                    checkRelativePath( i, PATH_ATTR, jclass, decl, false );
                    List conditionalForwards = CompilerUtils.getAnnotationArray( i, CONDITIONAL_FORWARDS_ATTR, true );
                   
                    if ( conditionalForwards != null )
                    {
                        for ( Iterator k = conditionalForwards.iterator(); k.hasNext();
                        {
                            AnnotationInstance ann = ( AnnotationInstance ) k.next();
                            checkRelativePath( ann, PATH_ATTR, jclass, decl, false );
                        }
                    }
                }
            }
           
            //
            // Check Forwards in the Controller annotation.
            //
            List forwards = CompilerUtils.getAnnotationArrayValue( decl, CONTROLLER_TAG_NAME, FORWARDS_ATTR, true );
           
            if ( forwards != null )
            {
                for ( Iterator ii = forwards.iterator(); ii.hasNext();
                {
                    AnnotationInstance i = ( AnnotationInstance ) ii.next();
                    checkRelativePath( i, PATH_ATTR, jclass, decl, false );
                }
            }
           
            //
            // Check Catches in the Controller annotation.
            //
            List catches = CompilerUtils.getAnnotationArrayValue( decl, CONTROLLER_TAG_NAME, CATCHES_ATTR, true );
           
            if ( catches != null )
            {
                for ( Iterator j = catches.iterator(); j.hasNext();
                {
                    AnnotationInstance i = ( AnnotationInstance ) j.next();
                    checkRelativePath( i, PATH_ATTR, jclass, decl, false );
                }
            }

            //
            // Check strutsMerge and validatorMerge in the Controller annotation.
            //
            AnnotationInstance controllerAnnotation = CompilerUtils.getAnnotation( decl, CONTROLLER_TAG_NAME );

            if ( controllerAnnotation != null )
            {
                checkRelativePath( controllerAnnotation, VALIDATOR_MERGE_ATTR, jclass, decl, true );
                checkRelativePath( controllerAnnotation, STRUTSMERGE_ATTR, jclass, decl, true );
            }
           
            //
            // Check Forwards and Catches on action methods and exception-handler methods.
            //
            MethodDeclaration[] methods = decl.getMethods();
            for ( int i = 0; i < methods.length; i++ )
            {
                MethodDeclaration method = methods[i];
                AnnotationInstance ann = CompilerUtils.getAnnotation( method, ACTION_TAG_NAME);
                if ( ann == null ) ann = CompilerUtils.getAnnotation( method, EXCEPTION_HANDLER_TAG_NAME );
               
                if ( ann != null )
                {
                    List methodForwards = CompilerUtils.getAnnotationArray( ann, FORWARDS_ATTR, true );
                    String methodName = method.getSimpleName();
                   
                    if ( methodForwards != null )
                    {
                        for ( Iterator j = methodForwards.iterator(); j.hasNext(); )
                        {
                            AnnotationInstance methodForward = ( AnnotationInstance ) j.next();
                            checkRelativePath( methodName, methodForward, PATH_ATTR, jclass, decl, false );
                        }
                    }
                   
                    List methodCatches = CompilerUtils.getAnnotationArray( ann, CATCHES_ATTR, true );
                   
                    if ( methodCatches != null )
                    {
                        for ( Iterator j = methodCatches.iterator(); j.hasNext(); )
                        {
                            AnnotationInstance methodCatch = ( AnnotationInstance ) j.next();
                            checkRelativePath( methodName, methodCatch, PATH_ATTR, jclass, decl, false );
                        }
                    }
                }
            }
View Full Code Here

    {
        AnnotationInstance[] annotations = method.getAnnotationInstances();
       
        for ( int i = 0; i < annotations.length; i++ )
        {
            AnnotationInstance annotation = annotations[i];
            String annotationName = CompilerUtils.getDeclaration( annotation.getAnnotationType() ).getSimpleName();
           
            if ( annotationName.equals( ACTION_TAG_NAME ) )
            {
                actionGrammar.check( annotation, null, method );
               
View Full Code Here

    {
        if ( messageResources != null )
        {
            for ( Iterator ii = messageResources.iterator(); ii.hasNext();
            {
                AnnotationInstance ann = ( AnnotationInstance ) ii.next();
                addMessageResources( new GenMessageBundleModel( this, ann ) );
            }
        }
    }
View Full Code Here

    {
        if ( messageBundles != null )
        {
            for ( Iterator ii = messageBundles.iterator(); ii.hasNext();
            {
                AnnotationInstance ann = ( AnnotationInstance ) ii.next();
                addMessageResources( new GenMessageBundleModel( this, ann ) );
            }
        }
    }
View Full Code Here

    {
        if ( simpleActionAnnotations != null )
        {
            for ( Iterator ii = simpleActionAnnotations.iterator(); ii.hasNext();
            {
                AnnotationInstance ann = ( AnnotationInstance ) ii.next();
                addActionMapping( new GenSimpleActionModel( ann, this, _jclass ) );
            }
        }
    }
View Full Code Here

    {
        if ( ! ( formTypeDecl instanceof ClassDeclaration ) ) return;
       
        ClassDeclaration formClassDecl = ( ClassDeclaration ) formTypeDecl;
       
        AnnotationInstance ann = CompilerUtils.getAnnotation( formClassDecl, FORM_BEAN_TAG_NAME, true );
       
        if ( ann != null )
        {
            String defaultMessageResources = CompilerUtils.getString( ann, MESSAGE_BUNDLE_ATTR, true );
           
View Full Code Here

           
            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 ) )
                    {
View Full Code Here

            //
            if ( catches != null )
            {
                for ( Iterator ii = catches.iterator(); ii.hasNext();
                {
                    AnnotationInstance catchAnnotation = ( AnnotationInstance ) ii.next();
                    String methodName = CompilerUtils.getString( catchAnnotation, METHOD_ATTR, false );
                   
                    if ( methodName.length() > 0 )
                    {
                        MethodDeclaration[] allMethods = CompilerUtils.getClassMethods( outerType, null );
                       
                        for ( int i = 0; i < allMethods.length; i++ )
                        {
                            MethodDeclaration method = allMethods[i];
                            AnnotationInstance exHandlerAnnotation =
                                CompilerUtils.getAnnotation( method, EXCEPTION_HANDLER_TAG_NAME );
                           
                            if ( exHandlerAnnotation != null && method.getSimpleName().equals( methodName ) )
                            {
                                Collection forwardAnnotations =
                                        CompilerUtils.getAnnotationArray( exHandlerAnnotation, FORWARDS_ATTR, false );
                               
                                for ( Iterator i3 = forwardAnnotations.iterator(); i3.hasNext();
                                {
                                    AnnotationInstance forwardAnnotation = ( AnnotationInstance ) i3.next();
                                    additionalEntities.add( forwardAnnotation );
                                }
                            }
                        }
                    }
View Full Code Here

                    getFlowControllerInfo().getMergedControllerAnnotation().getForwards();
            String forwardName = ( String ) member.getValue();
           
            for ( Iterator ii = forwards.iterator(); ii.hasNext();
            {
                AnnotationInstance forwardAnn = ( AnnotationInstance ) ii.next();
                if ( forwardName.equals( CompilerUtils.getString( forwardAnn, NAME_ATTR, true ) ) ) return null;
            }
           
            // TODO: comment
            if ( forwardName.equals( "_auto" ) ) return null;
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance

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.