|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Expander
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.
Method Summary | |
---|---|
void |
addDSLMapping(DSLMapping mapping)
Add the new mapping to this expander. |
String |
expand(Reader drl)
Expands (process) the expression Just-In-Time for the parser. |
String |
expand(String source)
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 |
Method Detail |
---|
String expand(Reader drl) throws IOException
drl
- the source code to be pre-processed
IOException
String expand(String source)
source
- the source code to be expanded
void addDSLMapping(DSLMapping mapping)
mapping
- List getErrors()
ExpanderException
boolean hasErrors()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |