Package org.drools.workbench.models.datamodel.oracle

Examples of org.drools.workbench.models.datamodel.oracle.MethodInfo


    private String getDataType( String param,
                                int index ) {
        String dataType;

        MethodInfo methodInfo = getMethodInfo();

        if ( methodInfo != null ) {
            dataType = methodInfo.getParams().get( index++ );
        } else {
            dataType = boundParams.get( param );
        }
        if ( dataType == null ) {
            dataType = inferDataType( param,
View Full Code Here


public class ExpressionPartHelper {

    public static ExpressionPart getExpressionPartForMethod( PackageDataModelOracle sce,
                                                             String factName,
                                                             String methodName ) {
        MethodInfo mi = sce.getMethodInfo( factName, methodName );
        if ( DataType.TYPE_COLLECTION.equals( mi.getGenericType() ) ) {
            return new ExpressionCollection( methodName, mi.getReturnClassType(),
                                             mi.getGenericType(), mi.getParametricReturnType() );
        }
        return new ExpressionMethod( mi.getName(), mi.getReturnClassType(), mi.getGenericType() );
    }
View Full Code Here

                    ModelField currentField = findField( typeFields,
                                                         expressionPart );
                    if ( currentField != null ) {
                        currentClassName = currentField.getClassName();
                    }
                    MethodInfo currentMethodInfo = findMethodInfo( methodInfos,
                                                                   expressionPart );
                    if ( currentMethodInfo != null ) {
                        currentClassName = currentMethodInfo.getReturnClassType();
                    }

                    processExpressionPart( m,
                                           factType,
                                           currentField,
                                           currentMethodInfo,
                                           expression,
                                           expressionPart );

                    //Refresh field and method information based on current expression part
                    typeFields = findFields( m,
                                             dmo,
                                             currentClassName );
                    methodInfos = getMethodInfosForType( m,
                                                         dmo,
                                                         currentClassName );
                }
            }

            //Handle last expression part
            String expressionPart = splits[ splits.length - 1 ];
            ModelField currentField = findField( typeFields,
                                                 expressionPart );
            MethodInfo currentMethodInfo = findMethodInfo( methodInfos,
                                                           expressionPart );

            processExpressionPart( m,
                                   factType,
                                   currentField,
View Full Code Here

                    ModelField currentField = findField( typeFields,
                                                         expressionPart );
                    if ( currentField != null ) {
                        currentClassName = currentField.getClassName();
                    }
                    MethodInfo currentMethodInfo = findMethodInfo( methodInfos,
                                                                   expressionPart );
                    if ( currentMethodInfo != null ) {
                        currentClassName = currentMethodInfo.getReturnClassType();
                    }

                    processExpressionPart( m,
                                           factType,
                                           currentField,
                                           currentMethodInfo,
                                           expression,
                                           expressionPart );

                    //Refresh field and method information based
                    typeFields = findFields( m,
                                             dmo,
                                             currentClassName );
                    methodInfos = getMethodInfosForType( m,
                                                         dmo,
                                                         currentClassName );
                }
            }

            //Handle last expression part
            String expressionPart = normalizeExpressionPart( splits[ splits.length - 1 ] );
            ModelField currentField = findField( typeFields,
                                                 expressionPart );
            MethodInfo currentMethodInfo = findMethodInfo( methodInfos,
                                                           expressionPart );

            processExpressionPart( m,
                                   factType,
                                   currentField,
View Full Code Here

                                       final String name,
                                       final List<String> params,
                                       final String returnType,
                                       final String parametricReturnType,
                                       final String genericType ) {
        MethodInfo mi = new MethodInfo( name,
                                        params,
                                        returnType,
                                        parametricReturnType,
                                        genericType );
View Full Code Here

                "    m.put(\"key\", a );\n" +
                "end\n";

        Map<String, List<MethodInfo>> methodInformation = new HashMap<String, List<MethodInfo>>();
        List<MethodInfo> mapMethodInformation = new ArrayList<MethodInfo>();
        mapMethodInformation.add( new MethodInfo( "put",
                                                  Arrays.asList( new String[]{ "java.lang.Object", "java.lang.Object" } ),
                                                  "void",
                                                  "void",
                                                  "java.util.Map" ) );
View Full Code Here

                "    t.doSomething( 1 * 2 );\n" +
                "end\n";

        Map<String, List<MethodInfo>> methodInformation = new HashMap<String, List<MethodInfo>>();
        List<MethodInfo> mapMethodInformation = new ArrayList<MethodInfo>();
        mapMethodInformation.add( new MethodInfo( "doSomething",
                                                  Arrays.asList( new String[]{ DataType.TYPE_NUMERIC_INTEGER } ),
                                                  "void",
                                                  "void",
                                                  "org.mortgages.MyType" ) );

View Full Code Here

                "    t.doSomething( i );\n" +
                "end\n";

        Map<String, List<MethodInfo>> methodInformation = new HashMap<String, List<MethodInfo>>();
        List<MethodInfo> mapMethodInformation = new ArrayList<MethodInfo>();
        mapMethodInformation.add( new MethodInfo( "doSomething",
                                                  Arrays.asList( new String[]{ DataType.TYPE_NUMERIC_INTEGER } ),
                                                  "void",
                                                  "void",
                                                  "org.mortgages.MyType" ) );
View Full Code Here

                        + "  s.indexOf( 0 );\n"
                        + "end\n";

        Map<String, List<MethodInfo>> methodInformation = new HashMap<String, List<MethodInfo>>();
        List<MethodInfo> mapMethodInformation = new ArrayList<MethodInfo>();
        mapMethodInformation.add( new MethodInfo( "indexOf",
                                                  Arrays.asList( new String[]{ "String" } ),
                                                  "int",
                                                  null,
                                                  "String" ) );
        mapMethodInformation.add( new MethodInfo( "indexOf",
                                                  Arrays.asList( new String[]{ "Integer" } ),
                                                  "int",
                                                  null,
                                                  "String" ) );
View Full Code Here

        HashMap<String, List<MethodInfo>> map = new HashMap<String, List<MethodInfo>>();
        ArrayList<MethodInfo> methodInfos = new ArrayList<MethodInfo>();
        ArrayList<String> params = new ArrayList<String>();
        params.add( "Integer" );
        params.add( "Integer" );
        methodInfos.add( new MethodInfo( "sum", params, "java.lang.Integer", null, "Summer" ) );
        map.put( "Calculator", methodInfos );

        when(
                dmo.getProjectMethodInformation()
            ).thenReturn(
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.datamodel.oracle.MethodInfo

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.