Package org.drools.ide.common.server.util

Examples of org.drools.ide.common.server.util.ClassMethodInspector


        this.builder.addFieldsForType( shortTypeName,
                                       fields.toArray( new String[fields.size()] ) );

        //Methods for use in ActionCallMethod's
        ClassMethodInspector methodInspector = new ClassMethodInspector( clazz,
                                                                         this );

        List<MethodInfo> methodInfos = methodInspector.getMethodInfos();
        for ( MethodInfo mi : methodInfos ) {
            String genericType = mi.getParametricReturnType();
            if ( genericType != null ) {
                this.builder.putParametricFieldType( shortTypeName + "." + mi.getNameWithParameters(),
                                                     genericType );
View Full Code Here


public class ClassMethodInspectorTest {

    @Test
    public void testSimpleMethods() throws Exception {
        final ClassMethodInspector ext = new ClassMethodInspector( SimpleMethods.class, new Converter() );

        for ( String s : ext.getMethodNames() ) {
            assertFalse( "Method " + s + " is not allowed.",
                         allowedMethod( s ) );
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testMoreThanOneMethodWithTheSameName() throws Exception {
        final ClassMethodInspector ext = new ClassMethodInspector( MoreThanOneMethodWithTheSameName.class, new Converter() );

        for ( String s : ext.getMethodNames() ) {
            assertFalse( "Method " + s + " is not allowed.",
                         allowedMethod( s ) );
        }

    }
View Full Code Here

    }

    @Test
    public void testCollection() throws Exception {
        final ClassMethodInspector ext = new ClassMethodInspector( Collection.class, new Converter() );

        for ( String s : ext.getMethodNames() ) {
            assertFalse( "Method " + s + " is not allowed.",
                         allowedMethod( s ) );
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testArrayList() throws Exception {
        final ClassMethodInspector ext = new ClassMethodInspector( ArrayList.class, new Converter() );

        for ( String s : ext.getMethodNames() ) {
            assertFalse( "Method " + s + " is not allowed.",
                         allowedMethod( s ) );
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testList() throws Exception {
        final ClassMethodInspector ext = new ClassMethodInspector( List.class, new Converter() );

        for ( String s : ext.getMethodNames() ) {
            assertFalse( "Method " + s + " is not allowed.",
                         allowedMethod( s ) );
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testSet() throws Exception {
        final ClassMethodInspector ext = new ClassMethodInspector( Set.class, new Converter() );

        for ( String s : ext.getMethodNames() ) {
            assertFalse( "Method " + s + " is not allowed.",
                         allowedMethod( s ) );
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testMap() throws Exception {
        final ClassMethodInspector ext = new ClassMethodInspector( Map.class, new Converter() );

        for ( String s : ext.getMethodNames() ) {
            assertFalse( "Method " + s + " is not allowed.",
                         allowedMethod( s ) );
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testMyMap() throws Exception {
        final ClassMethodInspector ext = new ClassMethodInspector( MyMap.class, new Converter() );

        for ( String s : ext.getMethodNames() ) {
            assertFalse( "Method " + s + " is not allowed.",
                         allowedMethod( s ) );
        }
    }
View Full Code Here

            Field f = inspector.getFieldTypesField().get( field );
            this.builder.addFieldTypeField( shortTypeName + "." + field,
                                            f );
        }

        ClassMethodInspector methodInspector = new ClassMethodInspector( clazz,
                                                                         this );

        List<MethodInfo> methodInfos = methodInspector.getMethodInfos();
        for ( MethodInfo mi : methodInfos ) {
            String genericType = mi.getParametricReturnType();
            if ( genericType != null ) {
                this.builder.putParametricFieldType( shortTypeName + "." + mi.getNameWithParameters(),
                                                     genericType );
View Full Code Here

TOP

Related Classes of org.drools.ide.common.server.util.ClassMethodInspector

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.