Package org.forgerock.openam.scripting
Class StandardScriptValidator
- java.lang.Object
-
- org.forgerock.openam.scripting.StandardScriptValidator
-
- All Implemented Interfaces:
ScriptValidator
public class StandardScriptValidator extends Object implements ScriptValidator
Validates scripts using the standard JSR 223 script engine framework. The validator will retrieve the appropriate javax.script.ScriptEngine and establish if it is an instance of javax.script.Compilable. The Compilable instance will then be used to compile the script and convert the compilation errors toScriptErrors.- Since:
- 12.0.0
-
-
Constructor Summary
Constructors Constructor Description StandardScriptValidator(StandardScriptEngineManager scriptEngineManager)Constructs the script validator using the given JSR 223 script engine manager instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ScriptError>validateScript(ScriptObject script)Validate the given script for the particular language rules and produces a list ofScriptErrorinstances if any validation errors occurred.
-
-
-
Constructor Detail
-
StandardScriptValidator
@Inject public StandardScriptValidator(StandardScriptEngineManager scriptEngineManager)
Constructs the script validator using the given JSR 223 script engine manager instance.- Parameters:
scriptEngineManager- the script engine manager to use for creating script engines.- Throws:
NullPointerException- if scriptEngineManager is not specified.
-
-
Method Detail
-
validateScript
public List<ScriptError> validateScript(ScriptObject script)
Validate the given script for the particular language rules and produces a list ofScriptErrorinstances if any validation errors occurred.- Specified by:
validateScriptin interfaceScriptValidator- Parameters:
script- the script that needs to be validated.- Returns:
- a list of validation errors if validation failed and an empty list if validation passed.
-
-