当前页面:
在线文档首页 >
JBoss RULES 3.0.6 API 英文版文档
DefaultExpander - JBoss RULES 3.0.6 API 英文版文档
org.drools.lang.dsl
Class DefaultExpander
java.lang.Object
org.drools.lang.dsl.DefaultExpander
- All Implemented Interfaces:
- Expander
public class DefaultExpander
- extends java.lang.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(java.io.Reader reader)
Use {0} style notation to place "holes" where data will be parsed from the natural text input. |
Method Summary |
java.lang.String |
expand(java.lang.String scope,
java.lang.String pattern)
The parser should call this on an expression/line that potentially needs expanding
BEFORE it parses that line (as the line may change radically as the result of expansion). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultExpander
public DefaultExpander(java.io.Reader reader)
- Use {0} style notation to place "holes" where data will be parsed from the natural text input.
- See Also:
for details.
expand
public java.lang.String expand(java.lang.String scope,
java.lang.String pattern)
- Description copied from interface:
Expander
- The parser should call this on an expression/line that potentially needs expanding
BEFORE it parses that line (as the line may change radically as the result of expansion).
Expands the expression Just-In-Time for the parser.
If the expression is not meant to be expanded, or if no
appropriate expander is found, it will echo back the same
expression.
- Specified by:
expand
in interface Expander
- Parameters:
scope
- The current scope of the expansion (eg "when" for LHS)
- Returns:
- A correct expression for the parser to reparse.