Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual contributors
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package org.hibernate.validator.internal.cfg.context;
 
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 
 import static org.hibernate.validator.internal.util.CollectionHelper.newHashMap;
 import static org.hibernate.validator.internal.util.CollectionHelper.newHashSet;

Context which collects constraints, cascades etc. configured via the programmatic API.

Author(s):
Hardy Ferentschik
Gunnar Morling
Kevin Pollet <kevin.pollet@serli.com> (C) 2011 SERLI
 
 @SuppressWarnings("deprecation")
 public class ConstraintMappingContext {
 	private final Map<Class<?>, Set<BeanConstraintLocation>> cascadeConfig;
 	private final Set<Class<?>> configuredClasses;
 	private final Map<Class<?>, List<Class<?>>> defaultGroupSequences;
 
 	}

Returns the constraint mapping context from the given constraint mapping.

Parameters:
mapping the programmatic constraint mapping
Returns:
returns the constraint mapping context from the given constraint mapping
 
 		return new ConstraintMappingContextAccessormapping ).getContext();
 	}

Returns all constraint definitions registered with this mapping.

Returns:
A map with this mapping's constraint definitions. Each key in this map represents a bean type, for which the constraint definitions in the associated map value are configured.
 
 		return ;
 	}
 
 	}
 
 	public final Map<Class<?>, Set<BeanConstraintLocation>> getCascadeConfig() {
 		return ;
 	}
 
 	}
 
 	public final Collection<Class<?>> getConfiguredClasses() {
	}
	public final List<Class<?>> getDefaultSequence(Class<?> beanType) {
		return .getbeanType );
	}
	}

Returns the class of the default group sequence provider defined for the given bean type.

Parameters:
beanType The bean type.
Returns:
The default group sequence provider defined class or null if none.
	public final <T> Class<? extends DefaultGroupSequenceProvider<? super T>> getDeprecatedDefaultGroupSequenceProvider(Class<T> beanType) {
		@SuppressWarnings("unchecked")
		Class<? extends DefaultGroupSequenceProvider<? super T>> providerClass = (Class<? extends DefaultGroupSequenceProvider<? super T>>) 
				.getbeanType );
		return providerClass;
	}

Returns the class of the default group sequence provider defined for the given bean type.

Parameters:
beanType The bean type.
Returns:
The default group sequence provider defined class or null if none.
	public final <T> Class<? extends org.hibernate.validator.spi.group.DefaultGroupSequenceProvider<? super T>> getDefaultGroupSequenceProvider(Class<T> beanType) {
		@SuppressWarnings("unchecked")
				.getbeanType );
		return providerClass;
	}
	public String toString() {
		final StringBuilder sb = new StringBuilder();
		sb.append"ConstraintMapping" );
		sb.append"{cascadeConfig=" ).append );
		sb.append", methodCascadeConfig=" ).append );
		sb.append", constraintConfig=" ).append );
		sb.append", configuredClasses=" ).append );
		sb.append", defaultGroupSequences=" ).append );
		sb.append'}' );
		return sb.toString();
	}
	public final void addCascadeConfig(BeanConstraintLocation cascade) {
		Class<?> beanClass = cascade.getBeanClass();
		.addbeanClass );
		if ( .containsKeybeanClass ) ) {
			.getbeanClass ).addcascade );
		}
		else {
			cascadeList.addcascade );
			.putbeanClasscascadeList );
		}
	}
	public final void addMethodCascadeConfig(MethodConstraintLocation cascade) {
		Class<?> beanClass = cascade.getBeanClass();
		.addbeanClass );
		if ( .containsKeybeanClass ) ) {
			.getbeanClass ).addcascade );
		}
		else {
			cascadeList.addcascade );
			.putbeanClasscascadeList );
		}
	}
	public final void addDefaultGroupSequence(Class<?> beanClassList<Class<?>> defaultGroupSequence) {
		.addbeanClass );
		.putbeanClassdefaultGroupSequence );
	}
	public final <T> void addDeprecatedDefaultGroupSequenceProvider(Class<T> beanClassClass<? extends DefaultGroupSequenceProvider<? super T>> defaultGroupSequenceProviderClass) {
		.addbeanClass );
		.putbeanClassdefaultGroupSequenceProviderClass );
	}
	public final <T> void addDefaultGroupSequenceProvider(Class<T> beanClassClass<? extends org.hibernate.validator.spi.group.DefaultGroupSequenceProvider<? super T>> defaultGroupSequenceProviderClass) {
		.addbeanClass );
		.putbeanClassdefaultGroupSequenceProviderClass );
	}
	public final void addConstraintConfig(ConfiguredConstraint<?, BeanConstraintLocationconstraint) {
		Class<?> beanClass = constraint.getLocation().getBeanClass();
		.addbeanClass );
		if ( .containsKeybeanClass ) ) {
			.getbeanClass ).addconstraint );
		}
		else {
			definitionList.addconstraint );
			.putbeanClassdefinitionList );
		}
	}
		Class<?> beanClass = constraint.getLocation().getBeanClass();
		.addbeanClass );
		if ( .containsKeybeanClass ) ) {
			.getbeanClass ).addconstraint );
		}
		else {
			definitionList.addconstraint );
			.putbeanClassdefinitionList );
		}
	}

Provides access to the members of a org.hibernate.validator.cfg.ConstraintMapping.
	private static class ConstraintMappingContextAccessor extends ConstraintMapping {
			superoriginal );
		}
			return ;
		}
	}
New to GrepCode? Check out our FAQ X