Examples of CoreAnnotationProcessorEnv


Examples of org.apache.beehive.netui.compiler.typesystem.env.CoreAnnotationProcessorEnv

        super( annotationTypeDecls, env );
    }

    public BaseChecker getChecker( ClassDeclaration classDecl, Diagnostics diagnostics )
    {
        CoreAnnotationProcessorEnv env = getAnnotationProcessorEnvironment();
       
        if ( CompilerUtils.isAssignableFrom( JPF_BASE_CLASS, classDecl, env ) )
        {
            if ( expectAnnotation( classDecl, CONTROLLER_TAG_NAME, JPF_FILE_EXTENSION_DOT, JPF_BASE_CLASS, diagnostics ) )
            {
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.env.CoreAnnotationProcessorEnv

        return null;
    }

    public BaseGenerator getGenerator( ClassDeclaration classDecl, Diagnostics diags )
    {
        CoreAnnotationProcessorEnv env = getAnnotationProcessorEnvironment();
        SourceFileInfo sourceFileInfo = getSourceFileInfo( classDecl );
       
        if ( CompilerUtils.isAssignableFrom( JPF_BASE_CLASS, classDecl, env ) )
        {
            assert sourceFileInfo != null : classDecl.getQualifiedName();
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.env.CoreAnnotationProcessorEnv

     * processor to do the real work.
     */
    public final AnnotationProcessor getProcessorFor(Set annotationTypeDeclarations, AnnotationProcessorEnvironment env)
    {

        CoreAnnotationProcessorEnv coreEnv = CoreAnnotationProcessorEnvImpl.get( env );
        AnnotationTypeDeclaration[] atds = new AnnotationTypeDeclaration[ annotationTypeDeclarations.size() ];
        int j = 0;
        for ( Iterator i = annotationTypeDeclarations.iterator(); i.hasNext(); )
        {
            // Wrap each Sun/Mirror annotation type declaration with our core AnnotationTypeDeclaration.
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.env.CoreAnnotationProcessorEnv

            hasOne |= checkValidationAnnotation( method, VALIDATE_DATE_TAG_NAME, _baseValidationRuleGrammar );
            hasOne |= checkValidationAnnotation( method, VALIDATE_TYPE_TAG_NAME, _validateTypeGrammar );
            */
        }
       
        CoreAnnotationProcessorEnv env = getEnv();
       
        // Make sure ActionForm subclasses are public static, and that they have default constructors.
        if ( isFormBeanClass || CompilerUtils.isAssignableFrom( STRUTS_FORM_CLASS_NAME, jclass, env ) )
        {
            if ( jclass.getDeclaringType() != null && ! jclass.hasModifier( Modifier.STATIC ) )
            {
                getDiagnostics().addError( jclass, "error.form-not-static" );
            }
           
            if ( ! jclass.hasModifier( Modifier.PUBLIC ) )
            {
                getDiagnostics().addError( jclass, "error.form-not-public" );
            }
           
            if ( ! CompilerUtils.hasDefaultConstructor( jclass ) )
            {
               getDiagnostics().addError( jclass, "error.form-no-default-constructor" );
            }
        }
       
       
        // Check to see if this class extends the (deprecated) FormData class and overrides its validate() method.
        // If so, then declarative validation annotations won't work unless the override calls super.validate().
        // Print a warning describing this behavior and suggesting implementing Validatable instead.
        methods = jclass.getMethods();
        if (CompilerUtils.isAssignableFrom(PAGEFLOW_FORM_CLASS_NAME, jclass, env)) {
            for (int i = 0; i < methods.length; i++) {
               
                MethodDeclaration method = methods[i];
                if (method.getSimpleName().equals("validate")) {
                    ParameterDeclaration[] params = method.getParameters();
                   
                    if (params.length == 2) {
                        TypeInstance param1Type = params[0].getType();
                        TypeInstance param2Type = params[1].getType();
                       
                        if (param1Type instanceof DeclaredType && param2Type instanceof DeclaredType) {
                            TypeDeclaration param1Decl = ((DeclaredType) param1Type).getDeclaration();
                            TypeDeclaration param2Decl = ((DeclaredType) param2Type).getDeclaration();
                            TypeDeclaration actionMappingDecl = env.getTypeDeclaration(STRUTS_ACTION_MAPPING_CLASS_NAME);
                            TypeDeclaration httpRequestDecl = env.getTypeDeclaration(HTTP_REQUEST_CLASS_NAME);
                           
                            if (param1Decl != null && CompilerUtils.typesAreEqual(param1Decl, actionMappingDecl)
                                && param2Decl != null && CompilerUtils.typesAreEqual(param2Decl, httpRequestDecl)) {
                                    getDiagnostics().addWarning(method, "warning.formdata-override-validate",
                                                                jclass.getQualifiedName(), PAGEFLOW_FORM_CLASS_NAME,
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.env.CoreAnnotationProcessorEnv

     * processor to do the real work.
     */
    public final AnnotationProcessor getProcessorFor(Set annotationTypeDeclarations, AnnotationProcessorEnvironment env)
    {

        CoreAnnotationProcessorEnv coreEnv = CoreAnnotationProcessorEnvImpl.get( env );
        AnnotationTypeDeclaration[] atds = new AnnotationTypeDeclaration[ annotationTypeDeclarations.size() ];
        int j = 0;
        for ( Iterator i = annotationTypeDeclarations.iterator(); i.hasNext(); )
        {
            // Wrap each Sun/Mirror annotation type declaration with our core AnnotationTypeDeclaration.
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.env.CoreAnnotationProcessorEnv

        super.check(classDecls);
    }

    public BaseChecker getChecker( ClassDeclaration classDecl, Diagnostics diagnostics )
    {
        CoreAnnotationProcessorEnv env = getAnnotationProcessorEnvironment();

        if ( CompilerUtils.isAssignableFrom( JPF_BASE_CLASS, classDecl, env ) )
        {
            if ( expectAnnotation( classDecl, CONTROLLER_TAG_NAME, JPF_FILE_EXTENSION_DOT, JPF_BASE_CLASS, diagnostics ) )
            {
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.env.CoreAnnotationProcessorEnv

        return new FormBeanChecker(getAnnotationProcessorEnvironment(), diagnostics);
    }

    public BaseGenerator getGenerator( ClassDeclaration classDecl, Diagnostics diags )
    {
        CoreAnnotationProcessorEnv env = getAnnotationProcessorEnvironment();
        SourceFileInfo sourceFileInfo = getSourceFileInfo( classDecl );

        if ( CompilerUtils.isAssignableFrom( JPF_BASE_CLASS, classDecl, env ) )
        {
            assert sourceFileInfo != null : classDecl.getQualifiedName();
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.env.CoreAnnotationProcessorEnv

            hasOne |= checkValidationAnnotation( method, VALIDATE_DATE_TAG_NAME, _baseValidationRuleGrammar );
            hasOne |= checkValidationAnnotation( method, VALIDATE_TYPE_TAG_NAME, _validateTypeGrammar );
            */
        }
       
        CoreAnnotationProcessorEnv env = getEnv();
       
        // Make sure ActionForm subclasses are public static, and that they have default constructors.
        if ( isFormBeanClass || CompilerUtils.isAssignableFrom( STRUTS_FORM_CLASS_NAME, jclass, env ) )
        {
            if ( jclass.getDeclaringType() != null && ! jclass.hasModifier( Modifier.STATIC ) )
            {
                getDiagnostics().addError( jclass, "error.form-not-static" );
            }
           
            if ( ! jclass.hasModifier( Modifier.PUBLIC ) )
            {
                getDiagnostics().addError( jclass, "error.form-not-public" );
            }
           
            if ( ! CompilerUtils.hasDefaultConstructor( jclass ) )
            {
               getDiagnostics().addError( jclass, "error.form-no-default-constructor" );
            }
        }

        // check that a class with declarative validation  uses a FormBean annotation
        if (isFormBeanClass && !hasFormBeanAnnotation) {
            getDiagnostics().addWarning(jclass, "warning.validatable-formbean-use-formbean",
                                        ANNOTATION_INTERFACE_PREFIX + FORM_BEAN_TAG_NAME);
        }
       
        // Check to see if this class extends the (deprecated) FormData class and overrides its validate() method.
        // If so, then declarative validation annotations won't work unless the override calls super.validate().
        // Print a warning describing this behavior and suggesting implementing Validatable instead.
        methods = jclass.getMethods();
        if (CompilerUtils.isAssignableFrom(PAGEFLOW_FORM_CLASS_NAME, jclass, env)) {
            for (int i = 0; i < methods.length; i++) {
               
                MethodDeclaration method = methods[i];
                if (method.getSimpleName().equals("validate")) {
                    ParameterDeclaration[] params = method.getParameters();
                   
                    if (params.length == 2) {
                        TypeInstance param1Type = params[0].getType();
                        TypeInstance param2Type = params[1].getType();
                       
                        if (param1Type instanceof DeclaredType && param2Type instanceof DeclaredType) {
                            TypeDeclaration param1Decl = ((DeclaredType) param1Type).getDeclaration();
                            TypeDeclaration param2Decl = ((DeclaredType) param2Type).getDeclaration();
                            TypeDeclaration actionMappingDecl = env.getTypeDeclaration(STRUTS_ACTION_MAPPING_CLASS_NAME);
                            TypeDeclaration httpRequestDecl = env.getTypeDeclaration(HTTP_REQUEST_CLASS_NAME);
                           
                            if (param1Decl != null && CompilerUtils.typesAreEqual(param1Decl, actionMappingDecl)
                                && param2Decl != null && CompilerUtils.typesAreEqual(param2Decl, httpRequestDecl)) {
                                    getDiagnostics().addWarning(method, "warning.formdata-override-validate",
                                                                jclass.getQualifiedName(), PAGEFLOW_FORM_CLASS_NAME,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.