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

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


        // Check to make sure that either the parent ValidatableProperty annotation has a displayName property,
        // or this rule specifies a first argument to the default message, or this rule specifies its own message.
        // If none of these are true, output a warning.
        //
        assert parentAnnotations.length > 0;
        AnnotationInstance immediateParent = parentAnnotations[parentAnnotations.length - 1];
       
        if ( CompilerUtils.getString( immediateParent, DISPLAY_NAME_ATTR, true ) == null
             && CompilerUtils.getString( immediateParent, DISPLAY_NAME_KEY_ATTR, true ) == null
             && CompilerUtils.getString( annotation, MESSAGE_KEY_ATTR, true ) == null
             && CompilerUtils.getString( annotation, MESSAGE_ATTR, true ) == null )
        {
            boolean useDefaultDisplayName = true;
            List messageArgs =
                    CompilerUtils.getAnnotationArray( annotation, MESSAGE_ARGS_ATTR, true );

            if ( messageArgs != null )
            {
                boolean firstArg = true;

                for ( Iterator ii = messageArgs.iterator(); ii.hasNext();
                {
                    AnnotationInstance messageArg = ( AnnotationInstance ) ii.next();
                    Integer position = CompilerUtils.getInteger( messageArg, POSITION_ATTR, true );

                    if ( ( position == null && firstArg ) || ( position != null && position.intValue() == 0 ) )
                    {
                        useDefaultDisplayName = false;
View Full Code Here


       
        if ( simpleActionAnnotations != null )
        {
            for ( Iterator ii = simpleActionAnnotations.iterator(); ii.hasNext();
            {
                AnnotationInstance ann = ( AnnotationInstance ) ii.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

        MethodDeclaration[] methods = CompilerUtils.getClassMethods( flowControllerClass, null );
       
        for ( int i = 0; i < methods.length; i++ )
        {
            MethodDeclaration method = methods[i];
            AnnotationInstance ann = CompilerUtils.getAnnotation( method, ACTION_TAG_NAME );
           
            if ( ann != null )
            {
                enableNavigateTo( CompilerUtils.getAnnotation( ann, VALIDATION_ERROR_FORWARD_ATTR, true ), fcInfo );
            }
View Full Code Here

    {
        if ( childAnnotations != null )
        {
            for ( Iterator ii = childAnnotations.iterator(); ii.hasNext();
            {
                AnnotationInstance childAnnotation = ( AnnotationInstance ) ii.next();
                enableNavigateTo( childAnnotation, fcInfo );
            }
        }
    }
View Full Code Here

                                                        "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.
        //
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

                {
                    List annotations = CompilerUtils.getAnnotationArray( value );
               
                    for ( int j = 0; j < annotations.size(); ++j )
                    {
                        AnnotationInstance ann = ( AnnotationInstance ) annotations.get( j );
                        arrayGrammar.check( ann, parentsIncludingMe, classMember, j );
                    }
                }
            }
            else
View Full Code Here

        if ( fields.size() > 0 )
        {
            for ( Iterator i = fields.iterator(); i.hasNext(); )
            {
                FieldDeclaration field = ( FieldDeclaration ) i.next();
                AnnotationInstance fieldAnnotation =
                        CompilerUtils.getAnnotation( field, JpfLanguageConstants.SHARED_FLOW_FIELD_TAG_NAME );
               
                if ( fieldAnnotation == null )
                {
                    fieldAnnotation = CompilerUtils.getAnnotationFullyQualified( field, CONTROL_ANNOTATION );
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.