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

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


                return new FacesBackingChecker( env, fbInfo, diagnostics );
            }
        }
        else
        {
            AnnotationInstance ann = CompilerUtils.getAnnotation( classDecl, CONTROLLER_TAG_NAME );
           
            if ( ann != null )
            {
                diagnostics.addError( ann, "error.annotation-invalid-base-class2",
                                      CONTROLLER_TAG_NAME, JPF_BASE_CLASS, SHARED_FLOW_BASE_CLASS );
View Full Code Here


    public void generate( ClassDeclaration publicClass )
        throws FatalCompileTimeException
    {
        File sourceFile = CompilerUtils.getSourceFile( publicClass, true );
        AnnotationInstance facesBackingAnnotation = CompilerUtils.getAnnotation( publicClass, FACES_BACKING_TAG_NAME );
        assert facesBackingAnnotation != null// checker should enforce this
        AnnotationToXML atx = new AnnotationToXML( publicClass );
       
        // Add the class-level @Jpf.FacesBacking annotation.
        atx.include( publicClass, facesBackingAnnotation );
       
        // For each method, add the @Jpf.CommandHandler annotation.
        MethodDeclaration[] methods = CompilerUtils.getClassMethods( publicClass, COMMAND_HANDLER_TAG_NAME );
        for ( int i = 0; i < methods.length; i++ )
        {
            MethodDeclaration method = methods[i];
            AnnotationInstance commandHandlerAnn = CompilerUtils.getAnnotation( method, COMMAND_HANDLER_TAG_NAME );
            atx.include( method, commandHandlerAnn );
        }
       
        // Add @Jpf.SharedFlowField, @Jpf.PageFlowField, @Control.
        FlowControllerGenerator.includeFieldAnnotations( atx, publicClass, PAGE_FLOW_FIELD_TAG_NAME );
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

    {
        //
        // 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 );
            assert sharedFlowName != null;
           
            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

    private void addReturnActions( Collection forwardAnnotations, FlowControllerInfo fcInfo,
                                   TypeDeclaration outerType, String childArrayAttr )
    {
        for ( Iterator ii = forwardAnnotations.iterator(); ii.hasNext();
        {
            AnnotationInstance ann = ( AnnotationInstance ) ii.next();
            String returnAction = CompilerUtils.getString( ann, RETURN_ACTION_ATTR, true );
            if ( returnAction != null ) fcInfo.addReturnAction( returnAction, ann, outerType );
           
            if ( childArrayAttr != null )
            {
View Full Code Here

    private boolean checkValidationAnnotation( MethodDeclaration method, String annotationTagName,
                                               AnnotationGrammar grammar )
            throws FatalCompileTimeException
    {
        AnnotationInstance annotation = CompilerUtils.getAnnotation( method, annotationTagName );
       
        if ( annotation != null )
        {
            if ( CompilerUtils.getBeanProperty( method ) == null )
            {
View Full Code Here

       
        if ( annotations != null )
        {
            for ( Iterator ii = annotations.iterator(); ii.hasNext();
            {
                AnnotationInstance ann = ( AnnotationInstance ) ii.next();
                Object key = CompilerUtils.getAnnotationValue( ann, keyAttr, true );
                if ( key != null ) keyedList.put( key.toString(), ann );
            }
        }
    }
View Full Code Here

        //
        if ( jclass != null && jclass instanceof ClassDeclaration )
        {
            ClassType superClass = ( ( ClassDeclaration ) jclass ).getSuperclass();
            if ( superClass != null ) mergeControllerAnnotations( superClass.getDeclaration() );
            AnnotationInstance controllerAnnotation = CompilerUtils.getAnnotation( jclass, CONTROLLER_TAG_NAME );
            if ( controllerAnnotation != null ) mergeAnnotation( controllerAnnotation );
        }
    }
View Full Code Here

   
    public Object onCheck( AnnotationTypeElementDeclaration valueDecl, AnnotationValue member,
                           AnnotationInstance[] parentAnnotations, MemberDeclaration classMember,
                           int annotationArrayIndex )
    {
        AnnotationInstance parentAnnotation = parentAnnotations[ parentAnnotations.length - 1 ];
        Boolean loginRequired = CompilerUtils.getBoolean( parentAnnotation, LOGIN_REQUIRED_ATTR, true );
       
        if ( loginRequired != null && ! loginRequired.booleanValue() )
        {
            addError( member, "error.roles-with-no-login-required" );
View Full Code Here

            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

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.