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

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


            addError( value, "error.empty-string-not-allowed" );
            return null;
        }
       
        if ( parentAnnotations.length < 2 ) return null;    // invalid parents -- will be caught elsewhere
        AnnotationInstance parentElement = parentAnnotations[ parentAnnotations.length - 2 ];
        List memberGroup = CompilerUtils.getAnnotationArray( parentElement, _memberGroupName, true );
       
        //
        // If memberGroup is null, then this annotation was in the wrong place, and there will be other errors.
        //
        if ( memberGroup != null )
        {
            String valueName = valueDecl.getSimpleName();
            AnnotationInstance parentAnnotation = parentAnnotations[ parentAnnotations.length - 1 ];
            checkForDuplicates( value, valueName, parentAnnotation, classMember, memberGroup, false,
                                annotationArrayIndex );
           
            //
            // Get a list of additional annotations (presumably not from the this one's parent) to check.
            //
            List additionalAnnsToCheck = getAdditionalAnnotationsToCheck( classMember );
           
            if ( additionalAnnsToCheck != null )
            {
                // Check this value against the list of additional annotations.
                checkForDuplicates( value, valueName, parentAnnotation, classMember, additionalAnnsToCheck, true, -1 );
               
                // Check for duplicates *within* within the list of additional annotations.
                for ( int i = 0; i < additionalAnnsToCheck.size(); ++i )
                {
                    AnnotationInstance ann = ( AnnotationInstance ) additionalAnnsToCheck.get( i );
                    AnnotationValue valueToCheck = CompilerUtils.getAnnotationValue( ann, valueName, true );
                    checkForDuplicates( valueToCheck, valueName, ann, classMember, additionalAnnsToCheck, true, -1 );
                }
            }
        }
View Full Code Here


    {
        Object memberValue = member.getValue();
       
        for ( int i = 0; i < annotationsToCheck.size(); ++i )
        {
            AnnotationInstance annotation = ( AnnotationInstance ) annotationsToCheck.get( i );
           
            if ( ( annotationArrayIndex != -1 && annotationArrayIndex != i ) ||
                 ! CompilerUtils.annotationsAreEqual( annotation, parentAnnotation, allowExactDuplicates(), getEnv() ) )
            {
                AnnotationValue valueToCheck =
View Full Code Here

                return;
            }
           
            for ( Iterator ii = catches.iterator(); ii.hasNext();
            {
                AnnotationInstance catchAnnotation = ( AnnotationInstance ) ii.next();
                //
                // Find the method referred to in this annotation.  If we can't find it, do nothing -- this
                // will get caught elsewhere in the checking.
                //
                String methodName = CompilerUtils.getString( catchAnnotation, METHOD_ATTR, false );
           
                if ( methodName.length() > 0 && ! methodName.equals( methodBeingChecked.getSimpleName() ) )
                {
                    MethodDeclaration otherMethod = findMethod( methodName, outerType );
                   
                    if ( otherMethod != null )
                    {
                        //
                        // Look through this other method's forwards.  None may have the same name (and different path)
                        // as the current one.
                        //
                        Collection otherForwards =
                                CompilerUtils.getAnnotationArrayValue( otherMethod, EXCEPTION_HANDLER_TAG_NAME,
                                                                          FORWARDS_ATTR, false );
                       
                        for ( Iterator i2 = otherForwards.iterator(); i2.hasNext();
                        {
                            AnnotationInstance otherForward = ( AnnotationInstance ) i2.next();
                            String otherForwardName = CompilerUtils.getString( otherForward, NAME_ATTR, true );
                            String otherForwardPath = CompilerUtils.getString( otherForward, PATH_ATTR, true );
                            String otherFwdNavigateTo =
                                    CompilerUtils.getEnumFieldName( otherForward, NAVIGATE_TO_ATTR, true );
                       
                            Collection forwards =
                                    CompilerUtils.getAnnotationArrayValue( methodBeingChecked,
                                                                              EXCEPTION_HANDLER_TAG_NAME,
                                                                              FORWARDS_ATTR, false );
                           
                            for ( Iterator i3 = forwards.iterator(); i3.hasNext();
                            {
                                AnnotationInstance forward = ( AnnotationInstance ) i3.next();
                                String forwardName = CompilerUtils.getString( forward, NAME_ATTR, true );
                                String forwardPath = CompilerUtils.getString( forward, PATH_ATTR, true );
                                String fwdNavigateTo = CompilerUtils.getEnumFieldName( forward, NAVIGATE_TO_ATTR, true );
                           
                                if ( forwardName != null && forwardName.equals( otherForwardName ) )
View Full Code Here

        // Look through all annotation parents for @Jpf.Action or @Jpf.SimpleAction.  If we find one, and there's
        // no validationErrorForward on it, print a warning.
        //
        for ( int i = parentAnnotations.length - 1; i >= 0; --i )
        {
            AnnotationInstance ann = parentAnnotations[i];
           
            if ( CompilerUtils.isJpfAnnotation( ann, ACTION_TAG_NAME )
                 || CompilerUtils.isJpfAnnotation( ann, SIMPLE_ACTION_TAG_NAME ) )
            {
                //
                // Give a warning if there is no validationErrorForward annotation and doValidation isn't set to false.
                //
                if ( CompilerUtils.getAnnotationValue( ann, VALIDATION_ERROR_FORWARD_ATTR, true ) == null )
                {
                    Boolean doValidation = CompilerUtils.getBoolean( ann, DO_VALIDATION_ATTR, true );
                   
                    if ( doValidation == null || doValidation.booleanValue() )
                    {
                        addWarning( annotation, "warning.validation-annotations-no-forward",
                                    ANNOTATION_INTERFACE_PREFIX + ann.getAnnotationType().getDeclaration().getSimpleName(),
                                    VALIDATION_ERROR_FORWARD_ATTR );
                    }
                }
            }
        }
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

       
        public Object onCheck( AnnotationTypeElementDeclaration valueDecl, AnnotationValue member,
                               AnnotationInstance[] parentAnnotations, MemberDeclaration classMember,
                               int annotationArrayIndex )
        {
            AnnotationInstance parentAnnotation = parentAnnotations[ parentAnnotations.length - 1 ];
            String language = CompilerUtils.getString( parentAnnotation, LANGUAGE_ATTR, true );
           
            if ( ( ( Boolean ) member.getValue() ).booleanValue() )
            {
                if ( language != null )
View Full Code Here

       
        if ( sharedFlowRefs != null )
        {
            for ( Iterator i = sharedFlowRefs.iterator(); i.hasNext();
            {
                AnnotationInstance sharedFlowRef = ( AnnotationInstance ) i.next();
                String name = CompilerUtils.getString( sharedFlowRef, NAME_ATTR, true );
                TypeInstance type = CompilerUtils.getTypeInstance( sharedFlowRef, TYPE_ATTR, true );
               
                if ( type instanceof DeclaredType )   // if it's not a DeclaredType, the error will be caught elsewhere.
                {
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

        getForwards( annotation, jclass, parentApp );
       
        //
        // validationErrorForward -- the forward used when validation fails
        //
        AnnotationInstance validateErrFwd = CompilerUtils.getAnnotation( annotation, VALIDATION_ERROR_FORWARD_ATTR, true );
        boolean doValidation = false;
        if ( validateErrFwd != null )
        {
            ForwardModel fwd = new GenForwardModel( parentApp, validateErrFwd, jclass, " (validationErrorForward)" );
            addForward( fwd );
View Full Code Here

    {
        //
        // Check to make sure that if this is a Shared Flow field, its type matches up with the type declared
        // for the shared flow of that name.
        //
        AnnotationInstance sfFieldAnn = CompilerUtils.getAnnotation( field, SHARED_FLOW_FIELD_TAG_NAME );
       
        if ( sfFieldAnn != null )
        {
            String sharedFlowName = CompilerUtils.getString( sfFieldAnn, NAME_ATTR, true );

            // sharedFlow name is a required attribute, if not defined return and let apt error.
            if (sharedFlowName == null) {
                return;
            }

            Collection sharedFlowRefs =
                    getFCSourceFileInfo().getMergedControllerAnnotation().getSharedFlowRefs();
           
            boolean foundOne = false;
           
            if ( sharedFlowRefs != null )
            {
                for ( Iterator ii = sharedFlowRefs.iterator(); ii.hasNext();
                {
                    AnnotationInstance sharedFlowRef = ( AnnotationInstance ) ii.next();
                    if ( sharedFlowName.equals( CompilerUtils.getString( sharedFlowRef, NAME_ATTR, true ) ) )
                    {
                        foundOne = true;
                       
                        TypeInstance sfType = CompilerUtils.getTypeInstance( sharedFlowRef, TYPE_ATTR, true );
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.