站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

DefaultExpanderResolver (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.lang.dsl
Class DefaultExpanderResolver

java.lang.Object
  extended by org.drools.lang.dsl.DefaultExpanderResolver
All Implemented Interfaces:
ExpanderResolver

public class DefaultExpanderResolver
extends Object
implements ExpanderResolver

The default expander resolver will provide instances of the DefaultExpander. The DefaultExpander uses templates to provide DSL and pseudo natural language support.

Author:
Michael Neale

Constructor Summary
DefaultExpanderResolver()
          Create an empty resolver, which you will then call addExpander multiple times, to map a specific expander with a name that will be found in the drl after the expander keyword.
DefaultExpanderResolver(Reader reader)
          This will load up a DSL from the reader specified.
 
Method Summary
 void addExpander(String name, Expander expander)
          Add an expander with the given name, which will be used by looking for the "expander" keyword in the DRL.
 Expander get(String name, String config)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultExpanderResolver

public DefaultExpanderResolver()
Create an empty resolver, which you will then call addExpander multiple times, to map a specific expander with a name that will be found in the drl after the expander keyword.


DefaultExpanderResolver

public DefaultExpanderResolver(Reader reader)
                        throws IOException
This will load up a DSL from the reader specified. This will make the expander available to any parser regardless of name. The DSL expander will be the default expander. This is the constructor most people should use.

Throws:
IOException
Method Detail

addExpander

public void addExpander(String name,
                        Expander expander)
Add an expander with the given name, which will be used by looking for the "expander" keyword in the DRL. If a default expander is installed, it will always be returned if none matching the given name can be found. You don't need to use this unless you have multiple expanders/DSLs involved when compiling multiple rule packages at the same time. If you don't know what that sentence means, you probably don't need to use this method.


get

public Expander get(String name,
                    String config)
Specified by:
get in interface ExpanderResolver


Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.