Package org.drools.lang.descr

Examples of org.drools.lang.descr.FunctionDescr.addParameter()


            final String type = ((Element)parameters.item( i )).getAttribute( "type" );
           
            emptyAttributeCheck("parameter", "identifier", identifier, parser);
            emptyAttributeCheck("parameter", "type", type, parser);
           
            functionDescr.addParameter( type,
                                        identifier );
        }

        // we allow empty, "", bodies - but make sure that we atleast have a body element
             
View Full Code Here


    }

    private static void addFunctions(PackageDescr packageDescr) {
        FunctionDescr functionDescr = new FunctionDescr( "foo",
                                                         "void" );
        functionDescr.addParameter( "String",
                                    "arg1" );
        String body = "Set myHashSet = new HashSet();" + "myHashSet.add(arg1);" + "List myArrayList = new ArrayList();" + "myArrayList.add(arg1);" + "List myLinkedList = new LinkedList();" + "myLinkedList.add(arg1);"
                      + "Set myTreeSet = new TreeSet();" + "myTreeSet.add(arg1);";
        functionDescr.setText( body );
        packageDescr.addFunction( functionDescr );
View Full Code Here

    }

    private static void addFunctions(PackageDescr packageDescr) {
        FunctionDescr functionDescr = new FunctionDescr( "foo",
                                                         "void" );
        functionDescr.addParameter( "String",
                                    "arg1" );
        String body = "Set myHashSet = new HashSet();" + "myHashSet.add(arg1);" + "List myArrayList = new ArrayList();" + "myArrayList.add(arg1);" + "List myLinkedList = new LinkedList();" + "myLinkedList.add(arg1);"
                      + "Set myTreeSet = new TreeSet();" + "myTreeSet.add(arg1);";
        functionDescr.setText( body );
        packageDescr.addFunction( functionDescr );
View Full Code Here

            if ( type == null || type.trim().equals( "" ) ) {
                throw new SAXParseException( "function's <parameter> requires an 'type' attribute",
                                             this.xmlPackageReader.getLocator() );
            }

            functionDescr.addParameter( type,
                                        identifier );
        }

        // we allow empty, "", bodies - but make sure that we atleast have a body element
        final Configuration body = config.getChild( "body" );
View Full Code Here

            if ( type == null || type.trim().equals( "" ) ) {
                throw new SAXParseException( "function's <parameter> must specify a 'type'",
                                             this.xmlPackageReader.getLocator() );
            }

            functionDescr.addParameter( type,
                                        identifier );
        }

        // we allow empty, "", bodies - but make sure that we atleast have a body element
        final Configuration body = config.getChild( "body" );
View Full Code Here

            }
           
            if ( param.charAt( param.length()-1 ) == '"' ) {
                param = param.substring( 0, param.length()-1 );
            }
            descr.addParameter"Object",  param );
        }
       
        descr.setContent( content );
       
        return descr;
View Full Code Here

    }

    private static void addFunctions(PackageDescr packageDescr) {
        FunctionDescr functionDescr = new FunctionDescr( "foo",
                                                         "void" );
        functionDescr.addParameter( "String",
                                    "arg1" );
        String body = "Set myHashSet = new HashSet();" + "myHashSet.add(arg1);" + "List myArrayList = new ArrayList();" + "myArrayList.add(arg1);" + "List myLinkedList = new LinkedList();" + "myLinkedList.add(arg1);"
                      + "Set myTreeSet = new TreeSet();" + "myTreeSet.add(arg1);";
        functionDescr.setText( body );
        packageDescr.addFunction( functionDescr );
View Full Code Here

    }

    private static void addFunctions(PackageDescr packageDescr) {
        FunctionDescr functionDescr = new FunctionDescr( "foo",
                                                         "void" );
        functionDescr.addParameter( "String",
                                    "arg1" );
        String body = "Set myHashSet = new HashSet();" + "myHashSet.add(arg1);" + "List myArrayList = new ArrayList();" + "myArrayList.add(arg1);" + "List myLinkedList = new LinkedList();" + "myLinkedList.add(arg1);"
                      + "Set myTreeSet = new TreeSet();" + "myTreeSet.add(arg1);";
        functionDescr.setText( body );
        packageDescr.addFunction( functionDescr );
View Full Code Here

            final String type = ((Element)parameters.item( i )).getAttribute( "type" );
           
            emptyAttributeCheck("parameter", "identifier", identifier, parser);
            emptyAttributeCheck("parameter", "type", type, parser);
           
            functionDescr.addParameter( type,
                                        identifier );
        }

        // we allow empty, "", bodies - but make sure that we atleast have a body element
             
View Full Code Here

            final String type = ((Element)parameters.item( i )).getAttribute( "type" );
           
            emptyAttributeCheck("parameter", "identifier", identifier, parser);                 
            emptyAttributeCheck("parameter", "type", type, parser);
           
            functionDescr.addParameter( type,
                                        identifier );
        }

        // we allow empty, "", bodies - but make sure that we atleast have a body element
             
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.