Skip to content

Commit

Permalink
HV-1463 Some more polishing on the JavaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Oct 18, 2017
1 parent 7c5477d commit 2df487d
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 35 deletions.
Expand Up @@ -76,10 +76,10 @@ public interface HibernateValidatorConfiguration extends Configuration<Hibernate
String ENABLE_TRAVERSABLE_RESOLVER_RESULT_CACHE = "hibernate.validator.enable_traversable_resolver_result_cache";

/**
* Property for configuring script evaluator factory, allowing to set up which factory will be used to create
* {@link ScriptEvaluator} for evaluation of script expressions in
* Property for configuring the script evaluator factory, allowing to set up which factory will be used to create
* {@link ScriptEvaluator}s for evaluation of script expressions in
* {@link ScriptAssert} and {@link ParameterScriptAssert}
* constraints. A fully qualified name of a class implementing {@link ScriptEvaluatorFactory} is expected as a value.
* constraints. A fully qualified name of a class implementing {@link ScriptEvaluatorFactory} is expected as a value.
*
* @since 6.0.3
*/
Expand Down Expand Up @@ -253,10 +253,10 @@ public interface HibernateValidatorConfiguration extends Configuration<Hibernate
HibernateValidatorConfiguration enableTraversableResolverResultCache(boolean enabled);

/**
* Allows to specify custom {@link ScriptEvaluatorFactory} which is used to create {@link ScriptEvaluator}s
* Allows to specify a custom {@link ScriptEvaluatorFactory} responsible for creating {@link ScriptEvaluator}s
* used to evaluate script expressions for {@link ScriptAssert} and {@link ParameterScriptAssert} constraints.
*
* @param scriptEvaluatorFactory The {@link ScriptEvaluatorFactory} to be used by validator
* @param scriptEvaluatorFactory the {@link ScriptEvaluatorFactory} to be used
*
* @return {@code this} following the chaining method pattern
*
Expand Down
Expand Up @@ -23,10 +23,11 @@
public interface HibernateValidatorFactory extends ValidatorFactory {

/**
* Returns a factory which is used to create {@link ScriptEvaluator}s for
* evaluating script expressions of {@link ScriptAssert} and {@link ParameterScriptAssert}.
* Returns the factory responsible for creating {@link ScriptEvaluator}s used to
* evaluate script expressions of {@link ScriptAssert} and {@link ParameterScriptAssert}
* constraints.
*
* @return A {@link ScriptEvaluatorFactory} instance
* @return a {@link ScriptEvaluatorFactory} instance
*
* @since 6.0.3
*/
Expand Down
Expand Up @@ -113,15 +113,15 @@ public interface HibernateConstraintValidatorContext extends ConstraintValidator
HibernateConstraintValidatorContext withDynamicPayload(Object payload);

/**
* Returns a {@link ScriptEvaluator} created based on {@link ScriptEvaluatorFactory}
* Returns a {@link ScriptEvaluator} created based on the {@link ScriptEvaluatorFactory}
* passed at bootstrap.
*
* @param languageName The name of a scripting language
* @param languageName the name of the scripting language
*
* @return A script executor for the given language. Never null.
* @return a script executor for the given language. Never null.
*
* @throws ScriptEvaluatorNotFoundException in case when no {@link ScriptEvaluator} was
* found for a given {@code languageName}.
* @throws ScriptEvaluatorNotFoundException in case no {@link ScriptEvaluator} was
* found for a given {@code languageName}
*
* @since 6.0.3
*/
Expand Down
Expand Up @@ -93,7 +93,8 @@ public class ValidatorFactoryImpl implements HibernateValidatorFactory {
private final ClockProvider clockProvider;

/**
* Used to get {@code ScriptEvaluatorFactory} when validating {@code @ScriptAssert} and {@code @ParameterScriptAssert}.
* Used to get the {@code ScriptEvaluatorFactory} when validating {@code @ScriptAssert} and
* {@code @ParameterScriptAssert} constraints.
*/
private final ScriptEvaluatorFactory scriptEvaluatorFactory;

Expand Down
Expand Up @@ -134,7 +134,8 @@ public class ValidatorImpl implements Validator, ExecutableValidator {
private final ClockProvider clockProvider;

/**
* Used to get {@code ScriptEvaluatorFactory} when validating {@code @ScriptAssert} and {@code @ParameterScriptAssert}.
* Used to get the {@code ScriptEvaluatorFactory} when validating {@code @ScriptAssert} and
* {@code @ParameterScriptAssert} constraints.
*/
private final ScriptEvaluatorFactory scriptEvaluatorFactory;

Expand Down
Expand Up @@ -31,10 +31,10 @@ public abstract class AbstractCachingScriptEvaluatorFactory implements ScriptEva
/**
* Retrieves a script executor for the given language.
*
* @param languageName The name of a scripting language.
* @return A script executor for the given language. Never null.
* @param languageName the name of a scripting language
* @return a script executor for the given language. Never null.
*
* @throws ScriptEvaluatorNotFoundException In case no compatible evaluator for the given language could be found.
* @throws ScriptEvaluatorNotFoundException in case no compatible evaluator for the given language has been found
*/
@Override
public ScriptEvaluator getScriptEvaluatorByLanguageName(String languageName) {
Expand All @@ -49,10 +49,10 @@ public void clear() {
/**
* Creates a new script evaluator for the given language.
*
* @param languageName A language name.
* @return A newly created script evaluator for the given language.
* @param languageName the name of a scripting language
* @return a newly created script evaluator for the given language
*
* @throws ScriptEvaluatorNotFoundException In case no compatible engine for the given language could be found.
* @throws ScriptEvaluatorNotFoundException in case no compatible engine for the given language has been found
*/
protected abstract ScriptEvaluator createNewScriptEvaluator(String languageName) throws ScriptEvaluatorNotFoundException;
}
Expand Up @@ -32,7 +32,7 @@ public class ScriptEngineScriptEvaluator implements ScriptEvaluator {
/**
* Creates a new script executor.
*
* @param engine The engine to be wrapped.
* @param engine the engine to be wrapped
*/
public ScriptEngineScriptEvaluator(ScriptEngine engine) {
this.engine = engine;
Expand All @@ -42,12 +42,12 @@ public ScriptEngineScriptEvaluator(ScriptEngine engine) {
* Executes the given script, using the given variable bindings. The execution of the script happens either synchronized or
* unsynchronized, depending on the engine's threading abilities.
*
* @param script The script to be executed.
* @param bindings The bindings to be used.
* @param script the script to be executed
* @param bindings the bindings to be used
*
* @return The script's result.
* @return the script's result
*
* @throws ScriptEvaluationException In case of any errors during script execution.
* @throws ScriptEvaluationException in case an error occurred during the script evaluation
*/
@Override
public Object evaluate(String script, Map<String, Object> bindings) throws ScriptEvaluationException {
Expand All @@ -71,9 +71,9 @@ private Object doEvaluate(String script, Map<String, Object> bindings) throws Sc
}

/**
* Checks, whether the given engine is thread-safe or not.
* Checks whether the given engine is thread-safe or not.
*
* @return True, if the given engine is thread-safe, false otherwise.
* @return true if the given engine is thread-safe, false otherwise.
*/
private boolean engineAllowsParallelAccessFromMultipleThreads() {
String threadingType = (String) engine.getFactory().getParameter( "THREADING" );
Expand Down
Expand Up @@ -30,10 +30,10 @@ public interface ScriptEvaluator {
/**
* Evaluates a {@code script} expression and returns the result of this evaluation.
*
* @param script A script to evaluate
* @param bindings The bindings to be used
* @param script a script to evaluate
* @param bindings the bindings to be used
*
* @return The result of script evaluation
* @return the result of script evaluation
*
* @throws ScriptEvaluationException in case an error occurred during the script evaluation
*/
Expand Down
Expand Up @@ -25,11 +25,11 @@ public interface ScriptEvaluatorFactory {
/**
* Retrieves a script evaluator {@link ScriptEvaluator} for the given language.
*
* @param languageName The name of a scripting language.
* @param languageName the name of a scripting language
*
* @return A script executor for the given language. Never null.
* @return a script executor for the given language. Never null.
*
* @throws ScriptEvaluatorNotFoundException in case when no {@link ScriptEvaluator} was
* @throws ScriptEvaluatorNotFoundException in case no {@link ScriptEvaluator} was
* found for a given {@code languageName}.
*/
ScriptEvaluator getScriptEvaluatorByLanguageName(String languageName);
Expand Down
Expand Up @@ -6,7 +6,7 @@
*/

/**
* <p>This package provides support for customization of script evaluation in {@code ScriptAssert}
* <p>This package provides support for customization of the script evaluation for {@code ScriptAssert}
* and {@code ParameterScriptAssert} constraints.</p>
* <p>This package is part of the public Hibernate Validator SPI.</p>
*
Expand Down

0 comments on commit 2df487d

Please sign in to comment.