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

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


    {
        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


        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

            rule = new ValidatorRule( ruleName );
            List ruleVars = CompilerUtils.getAnnotationArray( ruleAnnotation, VARIABLES_ATTR, false );
           
            for ( Iterator ii = ruleVars.iterator(); ii.hasNext();
            {
                AnnotationInstance ruleVar = ( AnnotationInstance ) ii.next();
                rule.setVar( CompilerUtils.getString( ruleVar, NAME_ATTR, false ),
                             CompilerUtils.getString( ruleVar, VALUE_ATTR, false ) );
            }
        }
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

   
    public Object onCheck( AnnotationTypeElementDeclaration valueDecl, AnnotationValue member,
                           AnnotationInstance[] parentAnnotations, MemberDeclaration classMember,
                           int annotationArrayIndex )
    {
        AnnotationInstance parentAnnotation = parentAnnotations[ parentAnnotations.length - 1 ];
        String path = CompilerUtils.getString( parentAnnotation, PATH_ATTR, false );
        if ( ! path.startsWith("/") ) addError( member, "error.absolute-path-required-for-external-redirect", null );
        return null;
    }
View Full Code Here

                    {
                        String formName = ( String ) j.next();
                       
                        for ( int i = 0; i < annotations.length; i++ )
                        {
                            AnnotationInstance ann = annotations[i];
                           
                            if ( CompilerUtils.isJpfAnnotation( ann, VALIDATABLE_PROPERTY_TAG_NAME ) )
                            {
                                //
                                // Add field rules from the Jpf.ValidationLocaleRules annotation.
View Full Code Here

        RuleInfo ruleInfo = new RuleInfo( entityName, propertyName, displayName, displayNameKey );
               
       
        for ( Iterator ii = localeRulesAnnotations.iterator(); ii.hasNext();
        {
            AnnotationInstance ann = ( AnnotationInstance ) ii.next();
            addFieldRules( ann, ruleInfo, false );
        }
       
        addFieldRules( validationFieldAnn, ruleInfo, true );
    }
View Full Code Here

        MethodDeclaration[] methods = CompilerUtils.getClassMethods( jclass, ACTION_TAG_NAME );
       
        for ( int i = 0; i < methods.length; i++ )
        {
            MethodDeclaration method = methods[i];
            AnnotationInstance actionAnnotation = CompilerUtils.getAnnotation( method, ACTION_TAG_NAME );
            assert actionAnnotation != null;
            addRulesFromActionAnnotation( actionAnnotation, method.getSimpleName() );
           
            ParameterDeclaration[] parameters = method.getParameters();
            if ( parameters.length > 0 )
            {
                TypeInstance type = parameters[0].getType();
               
                if ( type instanceof ClassType )
                {
                    ClassDeclaration classDecl = ( ( ClassType ) type ).getClassTypeDeclaration();
                    if ( classDecl.getDeclaringType() == null ) addRulesFromBeanClass( classDecl );
                }
            }
        }
       
       
        Collection simpleActions = mca.getSimpleActions();
       
        if ( simpleActions != null )
        {
            for ( Iterator ii = simpleActions.iterator(); ii.hasNext();
            {
                AnnotationInstance simpleAction = ( AnnotationInstance ) ii.next();
                String actionName = CompilerUtils.getString( simpleAction, NAME_ATTR, true );
                assert actionName != null//checker should enforce this.
                addRulesFromActionAnnotation( simpleAction, actionName );
            }
        }
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

        Collection validatablePropertyAnnotations =
                CompilerUtils.getAnnotationArray( actionAnnotation, VALIDATABLE_PROPERTIES_ATTR, false );
       
        for ( Iterator ii = validatablePropertyAnnotations.iterator(); ii.hasNext();
        {
            AnnotationInstance validationFieldAnnotation = ( AnnotationInstance ) ii.next();
            String propertyName = CompilerUtils.getString( validationFieldAnnotation, PROPERTY_NAME_ATTR, true );
            assert propertyName != null;            // TODO: checker must enforce this
            assert ! propertyName.equals( "" );     // TODO: checker must enforce this
           
            //
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.