public class ScriptRepository extends Object
Constructor | Description |
---|---|
ScriptRepository(boolean skipOverrideRules) |
Modifier and Type | Method | Description |
---|---|---|
RuleScript |
addScript(RuleScript script) |
add a rule script to the repository returning any existing script with the same name or null
if no such script can be found.
|
boolean |
checkInterfaces() |
see if we need to do any transformation of interfaces
|
List<RuleScript> |
currentRules() |
return a list containing all the currently installed rule scripts.
|
boolean |
matchClass(Class<?> clazz) |
return true if there is a rule which applies to the supplied class otherwise false
|
List<RuleScript> |
processScripts(String scriptText,
String scriptFile) |
Split the text of a script file into a list of individual rule scripts
|
RuleScript |
removeScript(String name) |
remove a rule script from the repository by name returning the script if it is found or null
if is not found.
|
RuleScript |
removeScript(RuleScript script) |
remove a rule script from the repository returning the script if it is found or null
if is not found.
|
RuleScript |
scriptForRuleName(String name) |
locate a rule script with a given name
|
List<RuleScript> |
scriptsForClassName(String name) |
return a list of all class scripts indexed using the supplied name.
|
List<RuleScript> |
scriptsForInterfaceName(String name) |
return a list of all interface scripts indexed using the supplied name.
|
boolean |
skipOverrideRules() |
check whether any overriding rules are currently loaded
|
public List<RuleScript> processScripts(String scriptText, String scriptFile) throws Exception
scriptText
- the text obtained from a script filescriptFile
- teh name of the file containing teh textException
- if there is an error in the format of the script file tesxtpublic RuleScript addScript(RuleScript script)
script
- the script to be added to the repositorypublic RuleScript removeScript(RuleScript script)
script
- the script to be removed from the repository.public RuleScript removeScript(String name)
name
- the name of the script to be removed from the repositorypublic RuleScript scriptForRuleName(String name)
name
- the name of the rule scriptpublic List<RuleScript> scriptsForClassName(String name)
name
- the name of the class for which scripts should be listedpublic List<RuleScript> scriptsForInterfaceName(String name)
name
- the name of the interface for which scripts should be listedpublic boolean matchClass(Class<?> clazz) throws Exception
clazz
- the name of the class for which rules are being soughtException
- if an error occurs during class lookuppublic List<RuleScript> currentRules()
public boolean checkInterfaces()
public boolean skipOverrideRules()
Copyright © 2018. All rights reserved.