| org.drools.lang.Expander
All known Subclasses: org.drools.lang.MockExpander, org.drools.lang.dsl.DefaultExpander,
Expander | public interface Expander (Code) | | Expanders are extension points for expanding
expressions in DRL at parse time.
This is just-in-time translation, or macro expansion, or
whatever you want.
The important thing is that it happens at the last possible moment,
so any errors in expansion are included in the parsers errors.
Just-in-time expansions may include complex pre-compilers,
or just macros, and everything in between.
Expanders should ideally not make presumptions on any embedded semantic
language. For instance, java aware pre processing should be done in
drools-java semantic module, not in the parser itself. Expanders should
be reusable across semantic languages.
author: Michael Neale |
addDSLMapping | public void addDSLMapping(DSLMapping mapping)(Code) | | Add the new mapping to this expander.
Parameters: mapping - |
expand | public String expand(Reader drl) throws IOException(Code) | | 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.
Parameters: drl - the source code to be pre-processed source code after running pre-processors |
expand | public String expand(String source)(Code) | | 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.
Parameters: source - the source code to be expanded source code after running pre-processors |
getErrors | public List getErrors()(Code) | | Returns the list of errors from the last expansion made
A list of ExpanderException |
hasErrors | public boolean hasErrors()(Code) | | Returns true in case the last expansion had any errors
|
|
|