Skip to content

Commit

Permalink
HV-638 Aligning names of model types. Actual model elements end with …
Browse files Browse the repository at this point in the history
…*MetaData and implement one or more of the facet interfaces.
  • Loading branch information
gunnarmorling committed Nov 27, 2012
1 parent a303b69 commit b48ab92
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
Expand Up @@ -977,7 +977,7 @@ private <T> int validateParametersForGroup(MethodValidationContext<T> validation
// 3. validate cascaded parameter if required
ValueContext<Object[], ?> cascadingValueContext = ValueContext.getLocalExecutionContext(
parameterValues,
methodMetaData.getValidatableParameters(),
methodMetaData.getParameterListMetaData(),
PathImpl.createPathForExecutable( executable )
);
cascadingValueContext.setCurrentGroup( oneGroup );
Expand Down Expand Up @@ -1108,7 +1108,7 @@ private <T, V> int validateReturnValueForGroup(MethodValidationContext<T> valida

ValueContext<V, Object> cascadingvalueContext = ValueContext.getLocalExecutionContext(
value,
executableMetaData.getReturnValueValidatable(),
executableMetaData.getReturnValueMetaData(),
PathImpl.createPathForExecutable( executable )
);
cascadingvalueContext.setCurrentGroup( oneGroup );
Expand Down
Expand Up @@ -387,7 +387,7 @@ public Iterable<MetaConstraint<?>> getCrossParameterConstraints() {
return crossParameterConstraints;
}

public Validatable getValidatableParameters() {
public ParameterListMetaData getParameterListMetaData() {

Set<ParameterMetaData> cascadedParameters = newHashSet();

Expand All @@ -397,11 +397,11 @@ public Validatable getValidatableParameters() {
}
}

return new ValidatableParameters( cascadedParameters );
return new ParameterListMetaData( cascadedParameters );
}

public ValidatableReturnValue getReturnValueValidatable() {
return new ValidatableReturnValue( returnValueGroupConversions );
public ReturnValueMetaData getReturnValueMetaData() {
return new ReturnValueMetaData( returnValueGroupConversions );
}

@Override
Expand Down
Expand Up @@ -19,15 +19,16 @@
import static org.hibernate.validator.internal.util.CollectionHelper.newHashSet;

/**
* A {@link Validatable} representing the arguments of a method or constructor.
* Represents the constraint related meta data of the arguments of a method or
* constructor.
*
* @author Gunnar Morling
*/
public class ValidatableParameters implements Validatable {
public class ParameterListMetaData implements Validatable {

private final Iterable<Cascadable> cascadables;

public ValidatableParameters(Iterable<? extends Cascadable> cascadables) {
public ParameterListMetaData(Iterable<? extends Cascadable> cascadables) {
this.cascadables = newHashSet( cascadables );
}

Expand Down
Expand Up @@ -21,12 +21,12 @@
import java.util.Map;

/**
* A {@link Validatable} representing the return value of a method or
* constructor.
* Represents the constraint related meta data of the return value of a method
* or constructor.
*
* @author Gunnar Morling
*/
public class ValidatableReturnValue implements Validatable {
public class ReturnValueMetaData implements Validatable {

//TODO HV-571: The spec currently says "In the return value case, the name of the node is null".
//But maybe a reserved name like this is actually better. Need to discuss with EG.
Expand All @@ -35,7 +35,7 @@ public class ValidatableReturnValue implements Validatable {

private final Map<Class<?>, Class<?>> groupConversions;

public ValidatableReturnValue(Map<Class<?>, Class<?>> groupConversions) {
public ReturnValueMetaData(Map<Class<?>, Class<?>> groupConversions) {
this.groupConversions = groupConversions;
}

Expand Down
Expand Up @@ -188,7 +188,7 @@ public void locallyDefinedGroupConversion() throws Exception {
ExecutableMetaData methodMetaData = beanMetaData.getMetaDataFor( ExecutableElement.forMethod( method ) );

assertThat(
methodMetaData.getReturnValueValidatable()
methodMetaData.getReturnValueMetaData()
.getCascadables()
.iterator()
.next()
Expand Down

0 comments on commit b48ab92

Please sign in to comment.