Examples of TypeInstance


Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

                ParameterDeclaration[] params = actionMethod.getParameters();
               
                if ( params.length > 0 )
                {
                    ParameterDeclaration param1 = params[0];
                    TypeInstance paramType = param1.getType();
                   
                    if ( paramType instanceof DeclaredType )
                    {
                        getMessageResourcesFromForm( CompilerUtils.getDeclaration( ( DeclaredType ) paramType ), actionModel );
                    }
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

            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 );
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

                {
                    //
                    // Add a warning if this annotation is on a property getter of the same type, in which case the
                    // validation rule will never fail.
                    //
                    TypeInstance returnType = ( ( MethodDeclaration ) classMember ).getReturnType();
                   
                    if ( returnType instanceof PrimitiveType )
                    {
                        if ( ( ( PrimitiveType ) returnType ).getKind().equals( kind ) )
                        {
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

        for ( Iterator ii = fields.iterator(); ii.hasNext();
        {
            FieldDeclaration field = ( FieldDeclaration ) ii.next();
            if ( field.getSimpleName().equals( fieldName ) )
            {
                TypeInstance fieldType = CompilerUtils.getGenericBoundsType( field.getType() );
               
                if ( _requiredSuperclassName != null
                     && ! CompilerUtils.isAssignableFrom( _requiredSuperclassName, fieldType, getEnv() ) )
                {
                    addError( member, "error.wrong-field-type", new Object[]{ fieldName, _requiredSuperclassName } );
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

        }
        else
        {
            setReadonly( true );     // can't modify member state; mark as read-only
           
            TypeInstance formBeanType = CompilerUtils.getTypeInstance( annotation, USE_FORM_BEAN_TYPE_ATTR, true );
           
            if ( formBeanType != null )
            {
                setFormBeanName( addFormBean( formBeanType, parentApp ) );
            }
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

            throws FatalCompileTimeException
    {
        //
        // First check the form bean type.
        //
        TypeInstance argType = getFormBeanType( annotation, classMember );
        TypeDeclaration argTypeDecl = null;
       
        if ( ! ( argType instanceof DeclaredType ) )
        {
            if ( argType != null )
            {
                getDiagnostics().addError( annotation, "error.action-invalid-form-bean-type", argType.toString() );
                argType = null;
            }
        }
        else
        {
            argTypeDecl = CompilerUtils.getDeclaration( ( DeclaredType ) argType );
            boolean isClass = argTypeDecl instanceof ClassDeclaration;
           
            if ( isClass && ! CompilerUtils.hasDefaultConstructor( argTypeDecl ) )
            {
                getDiagnostics().addError( annotation, "error.action-form-bean-no-default-constructor",
                                           argTypeDecl.getQualifiedName() );
            }
           
            if ( ! argTypeDecl.hasModifier( Modifier.PUBLIC ) )
            {
                getDiagnostics().addError( annotation, "error.action-form-bean-not-public",
                                           argTypeDecl.getQualifiedName() );
            }
           
            if ( isClass && argTypeDecl.getDeclaringType() != null && ! argTypeDecl.hasModifier( Modifier.STATIC ) )
            {
                getDiagnostics().addError( annotation, "error.action-form-bean-not-static",
                                           argTypeDecl.getQualifiedName() );
            }
           
            //
            // Give a warning if there is no validationErrorForward annotation and doValidation isn't set to false.
            //
            if ( CompilerUtils.getAnnotationValue( annotation, VALIDATION_ERROR_FORWARD_ATTR, true ) == null
                 && hasValidationAnnotations( argTypeDecl ) )
            {
                Boolean doValidation = CompilerUtils.getBoolean( annotation, DO_VALIDATION_ATTR, true );
               
                if ( doValidation == null || doValidation.booleanValue() )
                {
                    getDiagnostics().addWarning(
                            annotation, "warning.validatable-formbean-no-forward",
                            ANNOTATION_INTERFACE_PREFIX + annotation.getAnnotationType().getDeclaration().getSimpleName(),
                            VALIDATION_ERROR_FORWARD_ATTR, argTypeDecl.getQualifiedName() );
                }
            }
        }
       
        //
        // Add this action to the FlowControllerInfo.
        //
        getFlowControllerInfo().addAction( getActionName( annotation, classMember ),
                                           argTypeDecl != null ? argTypeDecl.getQualifiedName() : null );

        //
        // Check to make sure the 'useFormBean' attribute (reference to a member variable) matches the form declared as
        // an argument to the action method.
        //
        TypeInstance useFormBeanType = getUseFormBeanType( annotation, classMember );
       
        if ( useFormBeanType != null && useFormBeanType instanceof DeclaredType )
        {
            if ( argType == null )
            {
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

        // If this is a return-action, store its info in the FlowControllerInfo (which is eventually provided to tools).
        //
        if ( isReturnAction )
        {
            TypeDeclaration outerType = CompilerUtils.getOuterClass( classMember );
            TypeInstance formBeanType =
                    getFlowControllerInfo().addReturnAction( ( String ) value.getValue(), annotation, outerType );
           
            if ( formBeanType != null && ! ( formBeanType instanceof DeclaredType ) )
            {
                addError( annotation, "error.action-invalid-form-bean-type", formBeanType.toString() );
            }
        }
    }
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

        }
        else {
            // can't modify member state; mark as read-only
            setReadonly(Boolean.valueOf(true));

            TypeInstance formBeanType = CompilerUtils.getTypeInstance(annotation, USE_FORM_BEAN_TYPE_ATTR, true);
            if (formBeanType != null) {
                setFormBeanName(addFormBean(formBeanType, parent));
            }
        }
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

            // Add a warning if the typeHint type can't be resolved.
            if (typeHint == null) {
                addWarning(member, "warning.type-hint-unresolvable", TYPE_HINT_ATTR, typeHintStr);
            } else {
                // Add a warning if the typeHint type can't be assigned to the actual type.
                TypeInstance actualType = CompilerUtils.getTypeInstance(annotation, TYPE_ATTR, true);
                if (! CompilerUtils.isAssignableFrom(actualType, typeHint)) {
                    addWarning(member, "warning.type-hint-mismatch",
                               new Object[]{ TYPE_HINT_ATTR, typeHintStr, TYPE_ATTR, actualType.toString() });
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

        // Add a warning when this annotation is on a getter method which returns a primitive type.
        // In that case, it will never be null.
        //
        if ( classMember instanceof MethodDeclaration )
        {
            TypeInstance returnType = ( ( MethodDeclaration ) classMember ).getReturnType();
           
            if ( returnType instanceof PrimitiveType )
            {
                addWarning( annotation, "warning.validate-required-on-primitive-type",
                            ANNOTATION_INTERFACE_PREFIX + VALIDATE_REQUIRED_TAG_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.