Spring Framework DefaultParameterNameDiscoverer - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework DefaultParameterNameDiscoverer class.

This code example shows how to use the following methods:
		this.paramAnnotatedValue = new MethodParameter(method, 1);
		this.paramNotAnnotated = new MethodParameter(method, 2);
 
		this.paramAnnotated.initParameterNameDiscovery(new DefaultParameterNameDiscoverer());
		GenericTypeResolver.resolveParameterType(this.paramAnnotated, DestinationVariableMethodArgumentResolver.class);
		this.paramAnnotatedValue.initParameterNameDiscovery(new DefaultParameterNameDiscoverer());
		GenericTypeResolver.resolveParameterType(this.paramAnnotatedValue, DestinationVariableMethodArgumentResolver.class);
	} 
 
	@Test
	public void supportsParameter() { 
		assertTrue(resolver.supportsParameter(paramAnnotated));
		assertTrue(resolver.supportsParameter(paramAnnotatedValue));
		assertFalse(resolver.supportsParameter(paramNotAnnotated));
	} 
 
	@Test
	public void resolveArgument() throws Exception {
 
		Map<String, Object> vars = new HashMap<String, Object>();
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		this.paramNamedDefaultValueStringHeader = new MethodParameter(method, 1);
		this.paramSystemProperty = new MethodParameter(method, 2);
		this.paramNotAnnotated = new MethodParameter(method, 3);
		this.paramNativeHeader = new MethodParameter(method, 4);
 
		this.paramRequired.initParameterNameDiscovery(new DefaultParameterNameDiscoverer());
		GenericTypeResolver.resolveParameterType(this.paramRequired, HeaderMethodArgumentResolver.class);
	} 
 
	@Test
	public void supportsParameter() { 
		assertTrue(resolver.supportsParameter(paramNamedDefaultValueStringHeader));
		assertFalse(resolver.supportsParameter(paramNotAnnotated));
	} 
 
	@Test
	public void resolveArgument() throws Exception {
		Message<byte[]> message = MessageBuilder.withPayload(new byte[0]).setHeader("param1", "foo").build();
		Object result = this.resolver.resolveArgument(this.paramRequired, message);
 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
 
	private final SpelExpressionParser parser = new SpelExpressionParser(); 
 
	// shared param discoverer since it caches data internally 
	private final ParameterNameDiscoverer paramNameDiscoverer = new DefaultParameterNameDiscoverer(); 
 
	private final Map<ExpressionKey, Expression> keyCache = new ConcurrentHashMap<ExpressionKey, Expression>(64); 
 
	private final Map<ExpressionKey, Expression> conditionCache = new ConcurrentHashMap<ExpressionKey, Expression>(64); 
 
	private final Map<ExpressionKey, Expression> unlessCache = new ConcurrentHashMap<ExpressionKey, Expression>(64); 
 
	private final Map<MethodCacheKey, Method> targetMethodCache = new ConcurrentHashMap<MethodCacheKey, Method>(64); 
 
 
	/** 
	 * Create an {@link EvaluationContext} without a return value. 
	 * @see #createEvaluationContext(Collection, Method, Object[], Object, Class, Object) 
	 */ 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 *  
 * @author Oliver Gierke 
 */ 
public class PreferredConstructorDiscoverer<T, P extends PersistentProperty<P>> { 
 
	private static final ParameterNameDiscoverer PARAMETER_DISCOVERER = new DefaultParameterNameDiscoverer();
 
	private PreferredConstructor<T, P> constructor;
 
	/** 
	 * Creates a new {@link PreferredConstructorDiscoverer} for the given type. 
	 *  
	 * @param type must not be {@literal null}. 
	 */ 
	public PreferredConstructorDiscoverer(Class<T> type) {
		this(ClassTypeInformation.from(type), null);
	} 
 
	/** 
	 * Creates a new {@link PreferredConstructorDiscoverer} for the given {@link PersistentEntity}. 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 * Object holds information about a parameter. i.e. the name, type and the attributes of a 
 * RequestParam annotation. 
 */ 
public final class ParameterInfo { 
 
	private static final DefaultParameterNameDiscoverer discoverer = new DefaultParameterNameDiscoverer();
 
	private String name;
 
	private final TypeDescriptor typeDescriptor;
 
	private final boolean supportedParameter;
 
	private boolean hasRequestParamAnnotation;
 
	private boolean hasRequestHeaderAnnotation;
 
	private boolean hasCookieValueAnnotation;
 
	private boolean hasMetadataParamAnnotation;
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	private static final String PARAM_ON_SPECIAL = format("You must not user @%s on a parameter typed %s or %s",
			Param.class.getSimpleName(), Pageable.class.getSimpleName(), Sort.class.getSimpleName());
	private static final String ALL_OR_NOTHING = String.format("Either use @%s "
			+ "on all parameters except %s and %s typed once, or none at all!", Param.class.getSimpleName(),
			Pageable.class.getSimpleName(), Sort.class.getSimpleName());
	private static final ParameterNameDiscoverer PARAMETER_DISCOVERER = new DefaultParameterNameDiscoverer();
 
	private final int pageableIndex;
	private final int sortIndex;
	private final List<T> parameters;
 
	/** 
	 * Creates a new instance of {@link Parameters}. 
	 *  
	 * @param method 
	 */ 
	public Parameters(Method method) {
 
		Assert.notNull(method);
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java