Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HV-1463 Adding documentation section for ScriptEvaluatorFactory confi…
…guration
- Loading branch information
1 parent
dddcf7d
commit a376a01
Showing
5 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...t/java/org/hibernate/validator/referenceguide/chapter09/CustomScriptEvaluatorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.hibernate.validator.referenceguide.chapter09; | ||
|
||
import org.hibernate.validator.cfg.scriptengine.ScriptEvaluator; | ||
import org.hibernate.validator.cfg.scriptengine.ScriptEvaluatorFactory; | ||
|
||
/** | ||
* @author Marko Bekhta | ||
*/ | ||
public class CustomScriptEvaluatorFactory implements ScriptEvaluatorFactory { | ||
|
||
@Override | ||
public ScriptEvaluator getScriptEvaluatorByLanguageName(String languageName) { | ||
return (script, bindings) -> true; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
.../org/hibernate/validator/referenceguide/chapter09/script-evaluator-factory-validation.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<validation-config | ||
xmlns="http://xmlns.jcp.org/xml/ns/validation/configuration" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/validation/configuration | ||
http://xmlns.jcp.org/xml/ns/validation/configuration/validation-configuration-2.0.xsd" | ||
version="2.0"> | ||
|
||
<property name="hibernate.validator.script_evaluator_factory">org.hibernate.validator.referenceguide.chapter09.CustomScriptEvaluatorFactory</property> | ||
|
||
</validation-config> |