Package org.drools.lang.dsl

Examples of org.drools.lang.dsl.DefaultExpander.expand()


        source = getDRL( source,
                         asset.metaData.name,
                         null );

        DefaultExpander expander = builder.getDSLExpander();
        buf.append( expander.expand( source ) );
    }

    public void assembleDRL(BRMSPackageBuilder builder,
                            AssetItem asset,
                            StringBuffer buf) {
View Full Code Here


                            StringBuffer buf) {
        //add the rule keyword if its 'stand alone'
        String source = getRawDRL( asset );

        DefaultExpander expander = builder.getDSLExpander();
        buf.append( expander.expand( source ) );

    }

    private String wrapRule(String assetName,
                            String parentName,
View Full Code Here

                logger);

        String source = getRawDRL(asset);

        //expand and check for errors
        String drl = expander.expand(source);

        if (expander.hasErrors()) {
            List<ExpanderException> exErrs = expander.getErrors();
            for (ExpanderException ex : exErrs) {
                logger.logError(new ContentAssemblyError(
View Full Code Here

        source = getDRL(source,
                asset.getName(),
                null);

        DefaultExpander expander = builder.getDSLExpander();
        stringBuilder.append(expander.expand(source));
    }

    public void assembleDRL(BRMSPackageBuilder builder,
                            AssetItem asset,
                            StringBuilder stringBuilder) {
View Full Code Here

                            StringBuilder stringBuilder) {
        //add the rule keyword if its 'stand alone'
        String source = getRawDRL(asset);

        DefaultExpander expander = builder.getDSLExpander();
        stringBuilder.append(expander.expand(source));

    }

    private String wrapRule(String assetName,
                            String parentName,
View Full Code Here

  public void testExpanderErrorsAfterExpansion() throws Exception {

    final String name = "expander_post_errors.dslr";
    final Expander expander = new DefaultExpander();
    final String expanded = expander.expand(this.getReader(name));

    final DRLParser parser = parse(name, expanded);
    parser.compilation_unit();
    assertTrue(parser.hasErrors());
    System.out.println(this.getName());
View Full Code Here

        try {
            if ( expander == null ) {
                expander = new DefaultExpander();
            }
            String str = expander.expand( resource.getReader() );
            if ( expander.hasErrors() ) {
                this.results.addAll( expander.getErrors() );
            }

            final PackageDescr pkg = parser.parse( str );
View Full Code Here

      DrlParser parser = new DrlParser();
          DefaultExpander expander = getDslExpander();

          if (null != expander) {
            knowledge = new StringReader(expander.expand(knowledge));
            if (expander.hasErrors())
              this.results.addAll(expander.getErrors());
          }

          PackageDescr pkg = parser.parse(knowledge);
View Full Code Here

        try {
            if ( expander == null ) {
                expander = new DefaultExpander();
            }
            String str = expander.expand( resource.getReader() );
            if ( expander.hasErrors() ) {
                this.results.addAll( expander.getErrors() );
            }

            final PackageDescr pkg = parser.parse( str );
View Full Code Here

            if ( provider.hasDSLSentences() ) {
                DefaultExpander expander = getDslExpander();

                if ( null != expander ) {
                    knowledge = new StringReader( expander.expand( knowledge ) );
                    if ( expander.hasErrors() ) this.results.addAll( expander.getErrors() );
                }
            }

            PackageDescr pkg = parser.parse( knowledge );
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.