Package org.drools.drl.parser.lang.dsl
Class DefaultExpander
java.lang.Object
org.drools.drl.parser.lang.dsl.DefaultExpander
- All Implemented Interfaces:
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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDSLMapping(DSLMapping mapping) Add the new mapping to this expander.Expands (process) the expression Just-In-Time for the parser.Expands (process) the expression Just-In-Time for the parser.Returns the list of errors from the last expansion madebooleanReturns true in case the last expansion had any errors
-
Field Details
-
logger
protected static final transient org.slf4j.Logger logger
-
-
Constructor Details
-
DefaultExpander
public DefaultExpander()Creates a new DefaultExpander
-
-
Method Details
-
addDSLMapping
Add the new mapping to this expander.- Specified by:
addDSLMappingin interfaceExpander- Parameters:
mapping-
-
expand
Description copied from interface:ExpanderExpands (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:
expandin interfaceExpander- Parameters:
drlReader- the source code to be pre-processed- Returns:
- source code after running pre-processors
- Throws:
IOException
-
expand
Description copied from interface:ExpanderExpands (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. -
getErrors
Description copied from interface:ExpanderReturns the list of errors from the last expansion made -
hasErrors
public boolean hasErrors()Description copied from interface:ExpanderReturns true in case the last expansion had any errors
-