Package org.drools.template.model
Class SnippetBuilder
java.lang.Object
org.drools.template.model.SnippetBuilder
This utility class exists to convert rule script snippets to actual code. The
snippets contain place holders for values to be substituted into. See the
test case for how it really works !
Snippet template example: "something.getBlah($param)" $param is the "place
holder". This will get replaced with the "cellValue" that is passed in.
12-Oct-2005 change: moved from regex to using simple character based interpolation.
Regex was overkill and couldn't not quite get it right.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSnippetBuilder(String snippetTemplate) SnippetBuilder(String snippetTemplate, boolean trim) -
Method Summary
-
Field Details
-
PARAM_PREFIX
- See Also:
-
PARAM_SUFFIX
- See Also:
-
PARAM_STRING
- See Also:
-
PARAM_FORALL_STRING
- See Also:
-
PARAM_FORALL_PATTERN
-
-
Constructor Details
-
SnippetBuilder
- Parameters:
snippetTemplate- The snippet including the "place holder" for a parameter. If no "place holder" is present,
-
SnippetBuilder
-
-
Method Details
-
getType
-
build
- Parameters:
cellValue- The value from the cell to populate the snippet with. If no place holder exists, will just return the snippet.- Returns:
- The final snippet.
-