Skip to content

Commit

Permalink
HV-912 Reducing accessibility of some classes and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarmorling committed Jul 23, 2014
1 parent c489416 commit fd4eaed
Show file tree
Hide file tree
Showing 28 changed files with 58 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.hibernate.validator.cfg.context.Cascadable;
import org.hibernate.validator.cfg.context.GroupConversionTargetContext;
import org.hibernate.validator.cfg.context.Unwrapable;
import org.hibernate.validator.internal.cfg.DefaultConstraintMapping;

import static org.hibernate.validator.internal.util.CollectionHelper.newHashMap;

Expand All @@ -30,14 +29,14 @@
*
* @author Gunnar Morling
*/
public abstract class CascadableConstraintMappingContextImplBase<C extends Cascadable<C> & Unwrapable<C>>
abstract class CascadableConstraintMappingContextImplBase<C extends Cascadable<C> & Unwrapable<C>>
extends ConstraintMappingContextImplBase implements Cascadable<C>, Unwrapable<C> {

protected boolean isCascading;
protected Map<Class<?>, Class<?>> groupConversions = newHashMap();
private boolean unwrapValidatedValue;

public CascadableConstraintMappingContextImplBase(DefaultConstraintMapping mapping) {
CascadableConstraintMappingContextImplBase(DefaultConstraintMapping mapping) {
super( mapping );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* @author Gunnar Morling
*/
public class ConfiguredConstraint<A extends Annotation> {
class ConfiguredConstraint<A extends Annotation> {

private static final Log log = LoggerFactory.make();

Expand All @@ -51,11 +51,11 @@ private ConfiguredConstraint(ConstraintDef<?, A> constraint, ConstraintLocation
this.elementType = elementType;
}

public static <A extends Annotation> ConfiguredConstraint<A> forType(ConstraintDef<?, A> constraint, Class<?> beanType) {
static <A extends Annotation> ConfiguredConstraint<A> forType(ConstraintDef<?, A> constraint, Class<?> beanType) {
return new ConfiguredConstraint<A>( constraint, ConstraintLocation.forClass( beanType ), ElementType.TYPE );
}

public static <A extends Annotation> ConfiguredConstraint<A> forProperty(ConstraintDef<?, A> constraint, Member member) {
static <A extends Annotation> ConfiguredConstraint<A> forProperty(ConstraintDef<?, A> constraint, Member member) {
return new ConfiguredConstraint<A>(
constraint,
ConstraintLocation.forProperty( member ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.Set;

import org.hibernate.validator.cfg.context.TypeConstraintMappingContext;
import org.hibernate.validator.internal.cfg.DefaultConstraintMapping;
import org.hibernate.validator.internal.metadata.core.ConstraintHelper;
import org.hibernate.validator.internal.metadata.core.MetaConstraint;
import org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl;
Expand All @@ -34,12 +33,12 @@
*
* @author Gunnar Morling
*/
public abstract class ConstraintMappingContextImplBase {
abstract class ConstraintMappingContextImplBase {

protected final DefaultConstraintMapping mapping;
private final Set<ConfiguredConstraint<?>> constraints;

public ConstraintMappingContextImplBase(DefaultConstraintMapping mapping) {
ConstraintMappingContextImplBase(DefaultConstraintMapping mapping) {
this.mapping = mapping;
this.constraints = newHashSet();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
*
* @author Gunnar Morling
*/
public final class CrossParameterConstraintMappingContextImpl
final class CrossParameterConstraintMappingContextImpl
extends ConstraintMappingContextImplBase
implements CrossParameterConstraintMappingContext {

private final ExecutableConstraintMappingContextImpl executableContext;

public CrossParameterConstraintMappingContextImpl(ExecutableConstraintMappingContextImpl executableContext) {
CrossParameterConstraintMappingContextImpl(ExecutableConstraintMappingContextImpl executableContext) {
super( executableContext.getTypeContext().getConstraintMapping() );
this.executableContext = executableContext;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.validator.internal.cfg;
package org.hibernate.validator.internal.cfg.context;

import java.util.Set;

import javax.validation.ParameterNameProvider;

import org.hibernate.validator.cfg.ConstraintMapping;
import org.hibernate.validator.cfg.context.TypeConstraintMappingContext;
import org.hibernate.validator.internal.cfg.context.TypeConstraintMappingContextImpl;
import org.hibernate.validator.internal.metadata.core.AnnotationProcessingOptionsImpl;
import org.hibernate.validator.internal.metadata.core.ConstraintHelper;
import org.hibernate.validator.internal.metadata.raw.BeanConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
* @author Kevin Pollet &lt;[email protected]&gt; (C) 2011 SERLI
* @author Gunnar Morling
*/
public class ExecutableConstraintMappingContextImpl
class ExecutableConstraintMappingContextImpl
implements ConstructorConstraintMappingContext, MethodConstraintMappingContext {

private static final Log log = LoggerFactory.make();
Expand All @@ -60,11 +60,11 @@ public class ExecutableConstraintMappingContextImpl
private ReturnValueConstraintMappingContextImpl returnValueContext;
private CrossParameterConstraintMappingContextImpl crossParameterContext;

public ExecutableConstraintMappingContextImpl(TypeConstraintMappingContextImpl<?> typeContext, Constructor<?> constructor) {
ExecutableConstraintMappingContextImpl(TypeConstraintMappingContextImpl<?> typeContext, Constructor<?> constructor) {
this( typeContext, ExecutableElement.forConstructor( constructor ) );
}

public ExecutableConstraintMappingContextImpl(TypeConstraintMappingContextImpl<?> typeContext, Method method) {
ExecutableConstraintMappingContextImpl(TypeConstraintMappingContextImpl<?> typeContext, Method method) {
this( typeContext, ExecutableElement.forMethod( method ) );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
*
* @author Gunnar Morling
*/
public class GroupConversionTargetContextImpl<C> implements GroupConversionTargetContext<C> {
class GroupConversionTargetContextImpl<C> implements GroupConversionTargetContext<C> {

private final C cascadableContext;
private final Class<?> from;
private final CascadableConstraintMappingContextImplBase<?> target;

public GroupConversionTargetContextImpl(Class<?> from, C cascadableContext, CascadableConstraintMappingContextImplBase<?> target) {
GroupConversionTargetContextImpl(Class<?> from, C cascadableContext, CascadableConstraintMappingContextImplBase<?> target) {
this.from = from;
this.cascadableContext = cascadableContext;
this.target = target;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
* @author Gunnar Morling
* @author Kevin Pollet &lt;[email protected]&gt; (C) 2011 SERLI
*/
public final class ParameterConstraintMappingContextImpl
final class ParameterConstraintMappingContextImpl
extends CascadableConstraintMappingContextImplBase<ParameterConstraintMappingContext>
implements ParameterConstraintMappingContext {

private final ExecutableConstraintMappingContextImpl executableContext;
private final int parameterIndex;

public ParameterConstraintMappingContextImpl(ExecutableConstraintMappingContextImpl executableContext, int parameterIndex) {
ParameterConstraintMappingContextImpl(ExecutableConstraintMappingContextImpl executableContext, int parameterIndex) {
super( executableContext.getTypeContext().getConstraintMapping() );

this.executableContext = executableContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
* @author Gunnar Morling
* @author Kevin Pollet &lt;[email protected]&gt; (C) 2011 SERLI
*/
public final class PropertyConstraintMappingContextImpl
final class PropertyConstraintMappingContextImpl
extends CascadableConstraintMappingContextImplBase<PropertyConstraintMappingContext>
implements PropertyConstraintMappingContext {

private final TypeConstraintMappingContextImpl<?> typeContext;
private final Member member;

public PropertyConstraintMappingContextImpl(TypeConstraintMappingContextImpl<?> typeContext, Member member) {
PropertyConstraintMappingContextImpl(TypeConstraintMappingContextImpl<?> typeContext, Member member) {
super( typeContext.getConstraintMapping() );
this.typeContext = typeContext;
this.member = member;
Expand Down Expand Up @@ -99,7 +99,7 @@ public MethodConstraintMappingContext method(String name, Class<?>... parameterT
return typeContext.method( name, parameterTypes );
}

public ConstrainedElement build(ConstraintHelper constraintHelper) {
ConstrainedElement build(ConstraintHelper constraintHelper) {
if ( member instanceof Field ) {
return new ConstrainedField(
ConfigurationSource.API,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
* @author Gunnar Morling
* @author Kevin Pollet &lt;[email protected]&gt; (C) 2011 SERLI
*/
public final class ReturnValueConstraintMappingContextImpl
final class ReturnValueConstraintMappingContextImpl
extends CascadableConstraintMappingContextImplBase<ReturnValueConstraintMappingContext>
implements ReturnValueConstraintMappingContext {

private final ExecutableConstraintMappingContextImpl executableContext;

public ReturnValueConstraintMappingContextImpl(ExecutableConstraintMappingContextImpl executableContext) {
ReturnValueConstraintMappingContextImpl(ExecutableConstraintMappingContextImpl executableContext) {
super( executableContext.getTypeContext().getConstraintMapping() );
this.executableContext = executableContext;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.hibernate.validator.cfg.context.MethodConstraintMappingContext;
import org.hibernate.validator.cfg.context.PropertyConstraintMappingContext;
import org.hibernate.validator.cfg.context.TypeConstraintMappingContext;
import org.hibernate.validator.internal.cfg.DefaultConstraintMapping;
import org.hibernate.validator.internal.metadata.core.ConstraintHelper;
import org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl.ConstraintType;
import org.hibernate.validator.internal.metadata.location.ConstraintLocation;
Expand Down Expand Up @@ -80,7 +79,7 @@ public final class TypeConstraintMappingContextImpl<C> extends ConstraintMapping
private List<Class<?>> defaultGroupSequence;
private Class<? extends DefaultGroupSequenceProvider<? super C>> defaultGroupSequenceProviderClass;

public TypeConstraintMappingContextImpl(DefaultConstraintMapping mapping, Class<C> beanClass) {
TypeConstraintMappingContextImpl(DefaultConstraintMapping mapping, Class<C> beanClass) {
super( mapping );
this.beanClass = beanClass;
mapping.getAnnotationProcessingOptions().ignoreAnnotationConstraintForClass( beanClass, Boolean.FALSE );
Expand Down Expand Up @@ -199,7 +198,7 @@ public ConstructorConstraintMappingContext constructor(Class<?>... parameterType
return context;
}

public BeanConfiguration<C> build(ConstraintHelper constraintHelper, ParameterNameProvider parameterNameProvider) {
BeanConfiguration<C> build(ConstraintHelper constraintHelper, ParameterNameProvider parameterNameProvider) {
return new BeanConfiguration<C>(
ConfigurationSource.API,
beanClass,
Expand Down Expand Up @@ -243,7 +242,7 @@ private DefaultGroupSequenceProvider<? super C> getDefaultGroupSequenceProvider(
) : null;
}

public Class<?> getBeanClass() {
Class<?> getBeanClass() {
return beanClass;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

import org.hibernate.validator.HibernateValidatorConfiguration;
import org.hibernate.validator.cfg.ConstraintMapping;
import org.hibernate.validator.internal.cfg.DefaultConstraintMapping;
import org.hibernate.validator.internal.cfg.context.DefaultConstraintMapping;
import org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorFactoryImpl;
import org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver;
import org.hibernate.validator.internal.engine.valuehandling.JavaFXPropertyValueUnwrapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.hibernate.validator.HibernateValidatorConfiguration;
import org.hibernate.validator.HibernateValidatorContext;
import org.hibernate.validator.HibernateValidatorFactory;
import org.hibernate.validator.internal.cfg.DefaultConstraintMapping;
import org.hibernate.validator.internal.cfg.context.DefaultConstraintMapping;
import org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager;
import org.hibernate.validator.internal.metadata.BeanMetaDataManager;
import org.hibernate.validator.internal.metadata.core.ConstraintHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
package org.hibernate.validator.internal.metadata.provider;

import java.util.Set;

import javax.validation.ParameterNameProvider;

import org.hibernate.validator.internal.cfg.DefaultConstraintMapping;
import org.hibernate.validator.internal.cfg.context.DefaultConstraintMapping;
import org.hibernate.validator.internal.metadata.core.AnnotationProcessingOptions;
import org.hibernate.validator.internal.metadata.core.AnnotationProcessingOptionsImpl;
import org.hibernate.validator.internal.metadata.core.ConstraintHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
* @author Gunnar Morling
* @see java.lang.annotation.Annotation
*/
public class AnnotationProxy implements Annotation, InvocationHandler, Serializable {
class AnnotationProxy implements Annotation, InvocationHandler, Serializable {

private static final long serialVersionUID = 6907601010599429454L;
private static final Log log = LoggerFactory.make();
Expand All @@ -65,7 +65,7 @@ public class AnnotationProxy implements Annotation, InvocationHandler, Serializa
private final Map<String, Object> values;
private final int hashCode;

public AnnotationProxy(AnnotationDescriptor<?> descriptor) {
AnnotationProxy(AnnotationDescriptor<?> descriptor) {
this.annotationType = descriptor.type();
values = Collections.unmodifiableMap( getAnnotationValues( descriptor ) );
this.hashCode = calculateHashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
*
* @author Hardy Ferentschik
*/
public class ConstrainedExecutableBuilder {
class ConstrainedExecutableBuilder {

private static final Log log = LoggerFactory.make();

private ConstrainedExecutableBuilder() {
}

public static Set<ConstrainedExecutable> buildMethodConstrainedExecutable(List<MethodType> methods,
static Set<ConstrainedExecutable> buildMethodConstrainedExecutable(List<MethodType> methods,
Class<?> beanClass,
String defaultPackage,
ParameterNameProvider parameterNameProvider,
Expand Down Expand Up @@ -125,7 +125,7 @@ public static Set<ConstrainedExecutable> buildMethodConstrainedExecutable(List<M
return constrainedExecutables;
}

public static Set<ConstrainedExecutable> buildConstructorConstrainedExecutable(List<ConstructorType> constructors,
static Set<ConstrainedExecutable> buildConstructorConstrainedExecutable(List<ConstructorType> constructors,
Class<?> beanClass,
String defaultPackage,
ParameterNameProvider parameterNameProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
*
* @author Hardy Ferentschik
*/
public class ConstrainedFieldBuilder {
class ConstrainedFieldBuilder {
private static final Log log = LoggerFactory.make();

private ConstrainedFieldBuilder() {
}

public static Set<ConstrainedField> buildConstrainedFields(List<FieldType> fields,
static Set<ConstrainedField> buildConstrainedFields(List<FieldType> fields,
Class<?> beanClass,
String defaultPackage,
ConstraintHelper constraintHelper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
*
* @author Hardy Ferentschik
*/
public class ConstrainedGetterBuilder {
class ConstrainedGetterBuilder {
private static final Log log = LoggerFactory.make();

private ConstrainedGetterBuilder() {
}

public static Set<ConstrainedExecutable> buildConstrainedGetters(List<GetterType> getterList,
static Set<ConstrainedExecutable> buildConstrainedGetters(List<GetterType> getterList,
Class<?> beanClass,
String defaultPackage,
ConstraintHelper constraintHelper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
*
* @author Hardy Ferentschik
*/
public class ConstrainedParameterBuilder {
class ConstrainedParameterBuilder {

private ConstrainedParameterBuilder() {
}

public static List<ConstrainedParameter> buildConstrainedParameters(List<ParameterType> parameterList,
static List<ConstrainedParameter> buildConstrainedParameters(List<ParameterType> parameterList,
ExecutableElement executableElement,
String defaultPackage,
ConstraintHelper constraintHelper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
*
* @author Hardy Ferentschik
*/
public class ConstrainedTypeBuilder {
class ConstrainedTypeBuilder {

private ConstrainedTypeBuilder() {
}

public static ConstrainedType buildConstrainedType(ClassType classType,
static ConstrainedType buildConstrainedType(ClassType classType,
Class<?> beanClass,
String defaultPackage,
ConstraintHelper constraintHelper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
*
* @author Hardy Ferentschik
*/
public class GroupConversionBuilder {
class GroupConversionBuilder {

private GroupConversionBuilder() {
}

public static Map<Class<?>, Class<?>> buildGroupConversionMap(List<GroupConversionType> groupConversionTypes,
static Map<Class<?>, Class<?>> buildGroupConversionMap(List<GroupConversionType> groupConversionTypes,
String defaultPackage) {
Map<Class<?>, Class<?>> groupConversionMap = newHashMap();
for ( GroupConversionType groupConversionType : groupConversionTypes ) {
Expand Down
Loading

0 comments on commit fd4eaed

Please sign in to comment.