All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.beanvalidation.tck.tests.xmlconfiguration.CustomParameterNameProvider Maven / Gradle / Ivy

There is a newer version: 3.0.1
Show newest version
/**
 * Jakarta Bean Validation TCK
 *
 * License: Apache License, Version 2.0
 * See the license.txt file in the root directory or .
 */
package org.hibernate.beanvalidation.tck.tests.xmlconfiguration;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

import jakarta.validation.ParameterNameProvider;

/**
 * @author Gunnar Morling
 */
public class CustomParameterNameProvider implements ParameterNameProvider {

	@Override
	public List getParameterNames(Constructor constructor) {
		List names = new ArrayList();

		for ( int i = 0; i < constructor.getParameterTypes().length; i++ ) {
			names.add( "param" + i );
		}

		return names;
	}

	@Override
	public List getParameterNames(Method method) {
		List names = new ArrayList();

		for ( int i = 0; i < method.getParameterTypes().length; i++ ) {
			names.add( "param" + i );
		}

		return names;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy