org.hibernate.validator.spi.scripting.ScriptEvaluatorFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bean-validator Show documentation
Show all versions of bean-validator Show documentation
JSR 380's RI, Hibernate Validator version ${hibernate-validator.version} and its dependencies repackaged as OSGi bundle
/*
* Hibernate Validator, declare and validate application constraints
*
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or .
*/
package org.hibernate.validator.spi.scripting;
import javax.validation.ValidatorFactory;
import org.hibernate.validator.Incubating;
import org.hibernate.validator.constraints.ParameterScriptAssert;
import org.hibernate.validator.constraints.ScriptAssert;
/**
* Factory used to initialize the {@link ScriptEvaluator}s required to evaluate script expressions defined in
* {@link ScriptAssert} and {@link ParameterScriptAssert} constraints.
*
* @author Marko Bekhta
* @since 6.0.3
*/
@Incubating
public interface ScriptEvaluatorFactory {
/**
* Retrieves a script evaluator {@link ScriptEvaluator} for the given language.
*
* @param languageName the name of a scripting language
*
* @return a script executor for the given language. Never null.
*
* @throws ScriptEvaluatorNotFoundException in case no {@link ScriptEvaluator} was
* found for a given {@code languageName}.
*/
ScriptEvaluator getScriptEvaluatorByLanguageName(String languageName);
/**
* Clear the state of the factory.
*
* Called when the {@link ValidatorFactory} is closed.
*/
void clear();
}