public class IlrRulesetArchiveParser
extends java.lang.Object
IlrRulesetArchiveBuilder,
IlrRulesetArchive| Constructor and Description |
|---|
IlrRulesetArchiveParser()
Parses a ruleset archive to provide an executable ruleset.
|
| Modifier and Type | Method and Description |
|---|---|
IlrRulesetFactory |
checkArchive(IlrRulesetArchive archive)
Checks the ruleset archive and builds a ruleset factory on this archive.
|
IlrRulesetFactory |
checkArchive(IlrRulesetArchiveLoader loader)
Checks the ruleset archive and builds a ruleset factory on this archive.
|
IlrRulesetFactory |
checkArchive(java.util.jar.JarInputStream stream)
Checks the ruleset archive and builds a ruleset factory on this archive.
|
void |
displayMessages(boolean error)
Displays the parsing error or warning messages.
|
IlrReflect |
getBusinessReflect()
Returns the business reflect.
|
java.lang.String[] |
getErrors()
Returns the errors found during the IRL parsing.
|
IlrReflect |
getExecutionReflect()
Returns the execution reflect.
|
IlrRuleset |
getRuleset()
Returns a ruleset issued from a ruleset archive parsing.
|
java.lang.String[] |
getWarnings()
Returns the warnings found during the IRL parsing.
|
boolean |
parseArchive(IlrRulesetArchive archive)
Parses the ruleset archive.
|
boolean |
parseArchive(IlrRulesetArchiveLoader loader)
Parses the ruleset archive.
|
boolean |
parseArchiveFactory()
Parses the ruleset factory built by the
checkArchive method in order to build a ruleset. |
void |
setBusinessReflect(IlrReflect reflect)
Sets the business reflect.
|
void |
setExecutionReflect(IlrReflect reflect)
Sets the execution reflect.
|
void |
setMessageWriter(java.io.PrintWriter writer)
Sets the error message writer of the ruleset archive parser.
|
void |
setRuleset(IlrRuleset ruleset)
Sets the ruleset to be filled with the archive contents.
|
public IlrRulesetArchiveParser()
public void setBusinessReflect(IlrReflect reflect)
reflect - The reflect used as a business reflect; it will load the business model.setExecutionReflect(ilog.rules.factory.IlrReflect)public IlrReflect getBusinessReflect()
getExecutionReflect()public void setExecutionReflect(IlrReflect reflect)
reflect - The reflect used as the execution reflect; it will load the execution model.setBusinessReflect(ilog.rules.factory.IlrReflect)public IlrReflect getExecutionReflect()
getBusinessReflect()public IlrRuleset getRuleset()
public void setRuleset(IlrRuleset ruleset)
ruleset - The ruleset to be filled.setExecutionReflect(ilog.rules.factory.IlrReflect)public java.lang.String[] getErrors()
public java.lang.String[] getWarnings()
public void setMessageWriter(java.io.PrintWriter writer)
Sets the error message writer of the ruleset archive parser.
writer - The new writer to which error messages are printed.public void displayMessages(boolean error)
error - Set to true to display the error messages; set to false to display the
warning messages.public IlrRulesetFactory checkArchive(java.util.jar.JarInputStream stream)
null. The archive in the given stream conforms to the Jar format. The extracted archive is
persisted in memory. If the archive is a business archive, the returned ruleset is also business; the translations
have not been applied.stream - The stream in Jar format that contains the archive.IlrRulesetFactory when the archive is correct, or else it returns null.public IlrRulesetFactory checkArchive(IlrRulesetArchiveLoader loader)
null. The archive is extracted through the archive loader. The extracted archive is
persisted in memory. If the archive is a business archive, the returned ruleset is also business; the translations
have not been applied.loader - The loader used to extract the archive.IlrRulesetFactory when the archive is correct, or else it returns null.public IlrRulesetFactory checkArchive(IlrRulesetArchive archive)
null. If the archive is a business archive, the returned ruleset is also business; the
translations have not been applied.archive - The ruleset archive.IlrRulesetFactory when the archive is correct, or else it returns null.public boolean parseArchiveFactory()
checkArchive method in order to build a ruleset. It returns a
boolean indicating whether the parsing has succeeded or not. In case of errors during the parsing, the ruleset (as
IlrRuleset) is null, and error messages are available. If the checkArchive
method returned null, the ruleset factory is null and the parsing returns
false.true if the parsing occurred without error. Otherwise, it returns false.getRuleset(),
displayMessages(boolean error),
getExecutionReflect(),
getBusinessReflect(),
checkArchive(ilog.rules.archive.IlrRulesetArchive),
checkArchive(java.util.jar.JarInputStream)public boolean parseArchive(IlrRulesetArchiveLoader loader)
null, and error messages are available. In the case of a business ruleset
archive, two reflects take part in the parsing. If the ruleset archive is not business, only one reflect is needed.
Both can be obtained after the parsing.loader - The loader in charge of archive loading.true if the parsing occurred without error. Otherwise, it returns false.getRuleset(),
displayMessages(boolean error),
getExecutionReflect(),
getBusinessReflect()public boolean parseArchive(IlrRulesetArchive archive)
null, and error messages are available. In the case of a business ruleset
archive, two reflects take part in the parsing. If the ruleset archive is not business, only one reflect is needed.
Both can be obtained after the parsing.archive - The archive to be parsed.true if the parsing occurred without error. Otherwise, it returns false.getRuleset(),
displayMessages(boolean error),
getExecutionReflect(),
getBusinessReflect()© Copyright IBM Corp. 1987, 2017