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

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


        //
        MethodDeclaration[] methods = CompilerUtils.getClassMethods( jclass, null );
       
        for ( int i = 0; i < methods.length; i++ )
        {
            MethodDeclaration method = methods[i];
            TypeDeclaration declaringType = method.getDeclaringType();
           
            //
            // Only add diagnostics if the method is in this class, or if it's inherited from a class that's *not* on
            // sourcepath (i.e., its SourcePosition is null).
            //
View Full Code Here


        //
        MethodDeclaration[] methods = CompilerUtils.getClassMethods( flowControllerClass, null );
       
        for ( int i = 0; i < methods.length; i++ )
        {
            MethodDeclaration method = methods[i];
            AnnotationInstance ann = CompilerUtils.getAnnotation( method, ACTION_TAG_NAME );
           
            if ( ann != null )
            {
                enableNavigateTo( CompilerUtils.getAnnotation( ann, VALIDATION_ERROR_FORWARD_ATTR, true ), fcInfo );
View Full Code Here

            // Check Forwards and Catches on action methods and exception-handler methods.
            //
            MethodDeclaration[] methods = decl.getMethods();
            for ( int i = 0; i < methods.length; i++ )
            {
                MethodDeclaration method = methods[i];
                AnnotationInstance ann = CompilerUtils.getAnnotation( method, ACTION_TAG_NAME);
                if ( ann == null ) ann = CompilerUtils.getAnnotation( method, EXCEPTION_HANDLER_TAG_NAME );
               
                if ( ann != null )
                {
                    List methodForwards = CompilerUtils.getAnnotationArray( ann, FORWARDS_ATTR, true );
                    String methodName = method.getSimpleName();
                   
                    if ( methodForwards != null )
                    {
                        for ( Iterator j = methodForwards.iterator(); j.hasNext(); )
                        {
View Full Code Here

            // check the methods for validatable property annotations that
            // would be processed elsewhere.
            //
            MethodDeclaration[] methods = CompilerUtils.getClassMethods(jclass, null);
            for (int i = 0; i < methods.length && noFormBeanAnnotation; i++) {
                MethodDeclaration method = methods[i];
                if (CompilerUtils.getAnnotation(method, VALIDATABLE_PROPERTY_TAG_NAME) != null) {
                    noFormBeanAnnotation = false;
                }
            }
        }
View Full Code Here

        }

        for ( Iterator ii = properties.iterator(); ii.hasNext(); )
        {
            CompilerUtils.BeanPropertyDeclaration property = ( CompilerUtils.BeanPropertyDeclaration ) ii.next();
            MethodDeclaration getter = property.getGetter();
            String propertyName = property.getPropertyName();

            if ( getter != null )
            {
                //
                // Parse validation annotations on each getter.
                //
                AnnotationInstance[] annotations = getter.getAnnotationInstances();

                if ( annotations != null )
                {
                    for ( Iterator j = formNames.iterator(); j.hasNext(); )
                    {
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 )
View Full Code Here

        // forwards, as appropriate.
        //
        if ( methodName != null )
        {
            setHandlerMethod( methodName );
            MethodDeclaration method = CompilerUtils.getClassMethod( jclass, methodName, EXCEPTION_HANDLER_TAG_NAME );
            AnnotationInstance exHandlerAnnotation = CompilerUtils.getAnnotation( method, EXCEPTION_HANDLER_TAG_NAME );
            GenForwardModel.addForwards( exHandlerAnnotation, forwardContainer, jclass, parentApp,
                                         " from exception-handler " + methodName )// @TODO I18N the comment
                   
            //
View Full Code Here

        MethodDeclaration[] methods = CompilerUtils.getClassMethods( outerType, null );
        String methodName = ( String ) value.getValue();
       
        for ( int i = 0; i < methods.length; i++ )
        {
            MethodDeclaration method = methods[i];
           
            if ( method.getSimpleName().equals( methodName ) )
            {
                if ( _requiredMethodAnnotation == null
                     || CompilerUtils.getAnnotation( method, _requiredMethodAnnotation ) != null )
                {
                    checkMethod( method, value, parentAnnotations, classMember );
View Full Code Here

    {
        MethodDeclaration[] methods = CompilerUtils.getClassMethods( outerType, null );
       
        for ( int i = 0; i < methods.length; i++ )
        {
            MethodDeclaration method = methods[i];
           
            if ( method.getSimpleName().equals( methodName ) )
            {
                if ( _requiredMethodAnnotation == null
                     || CompilerUtils.getAnnotation( method, _requiredMethodAnnotation ) != null )
                {
                    return method;
View Full Code Here

     * @return a result (any Object) that will be passed back to the parent checker.  May be null</code>.
     */
    protected Object onEndCheck( AnnotationInstance annotation, AnnotationInstance[] parentAnnotations,
                                 MemberDeclaration classMember, Map checkResults )
    {
        MethodDeclaration handlerMethod = ( MethodDeclaration ) checkResults.get( METHOD_ATTR );
        DeclaredType exceptionType = ( DeclaredType ) checkResults.get( TYPE_ATTR );
       
        //
        // If either of these are null, then there was another already-reported error (e.g., type was unresolved).
        //
        if ( handlerMethod == null || exceptionType == null )
        {
            return null;
        }
       
        //
        // Make sure the given handler method can catch the right kind of exception.
        //
        ParameterDeclaration[] parameters = handlerMethod.getParameters();
               
        //
        // If the method's arguments are wrong in any way, don't worry about it -- the exception-handler checker will
        // report an error.
        //
        if ( parameters.length > 0 )
        {
            TypeInstance handledExceptionType = parameters[0].getType();
           
            if ( ! CompilerUtils.isAssignableFrom( handledExceptionType, CompilerUtils.getDeclaration( exceptionType ) ) )
            {
                addError( annotation, "error.incompatible-exception-handler", handlerMethod.getSimpleName(),
                          CompilerUtils.getDeclaration( exceptionType ).getQualifiedName() );
            }
        }

        return null;
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.compiler.typesystem.declaration.MethodDeclaration

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.