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

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


org.drools.lang.dsl
Class DefaultExpander

java.lang.Object
  extended by org.drools.lang.dsl.DefaultExpander
All Implemented Interfaces:
Expander

public class DefaultExpander
extends Object
implements Expander

The default expander uses String templates to provide pseudo natural language, as well as general DSLs. For most people, this should do the job just fine.


Constructor Summary
DefaultExpander()
          Creates a new DefaultExpander
 
Method Summary
 void addDSLMapping(DSLMapping mapping)
          Add the new mapping to this expander.
 String expand(Reader drlReader)
          Expands (process) the expression Just-In-Time for the parser.
 String expand(String drl)
          Expands (process) the expression Just-In-Time for the parser.
 List getErrors()
          Returns the list of errors from the last expansion made
 boolean hasErrors()
          Returns true in case the last expansion had any errors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultExpander

public DefaultExpander()
Creates a new DefaultExpander

Method Detail

addDSLMapping

public void addDSLMapping(DSLMapping mapping)
Add the new mapping to this expander.

Specified by:
addDSLMapping in interface Expander
Parameters:
mapping -

expand

public String expand(Reader drlReader)
              throws IOException
Description copied from interface: Expander
Expands (process) the expression Just-In-Time for the parser. If the source is not meant to be expanded, or if no appropriate match was found for expansion, it will echo back the same expression.

Specified by:
expand in interface Expander
Parameters:
drlReader - the source code to be pre-processed
Returns:
source code after running pre-processors
Throws:
IOException

expand

public String expand(String drl)
Description copied from interface: Expander
Expands (process) the expression Just-In-Time for the parser. If the source is not meant to be expanded, or if no appropriate match was found for expansion, it will echo back the same expression.

Specified by:
expand in interface Expander
Parameters:
drl - the source code to be expanded
Returns:
source code after running pre-processors
Throws:
IOException

getErrors

public List getErrors()
Description copied from interface: Expander
Returns the list of errors from the last expansion made

Specified by:
getErrors in interface Expander
Returns:
A list of ExpanderException

hasErrors

public boolean hasErrors()
Description copied from interface: Expander
Returns true in case the last expansion had any errors

Specified by:
hasErrors in interface Expander
Returns:


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