Lines Matching refs:columns
41 Object[] columns = null;
43 columns = Utils.splitAtCommaOrPipe(params);
44 columns = castParamsUsingConverters(columns);
50 return columns;
94 private Object[] castParamsUsingConverters(Object[] columns) throws ConversionFailedException {
97 if (testMethodParamsHasVarargs(columns, expectedParameterTypes)) {
98 columns = columnsWithVarargs(columns, expectedParameterTypes);
102 verifySameSizeOfArrays(columns, expectedParameterTypes);
103 columns = castAllParametersToProperTypes(columns, expectedParameterTypes, parameterAnnotations);
104 return columns;
107 private Object[] columnsWithVarargs(Object[] columns, Class<?>[] expectedParameterTypes) {
108 Object[] allParameters = standardParameters(columns, expectedParameterTypes);
109 allParameters[allParameters.length - 1] = varargsParameters(columns, expectedParameterTypes);
113 private Object[] varargsParameters(Object[] columns, Class<?>[] expectedParameterTypes) {
115 Object[] varArgsParameters = (Object[]) Array.newInstance(varArgType, columns.length - expectedParameterTypes.length + 1);
117 varArgsParameters[i] = columns[i + expectedParameterTypes.length - 1];
122 private Object[] standardParameters(Object[] columns, Class<?>[] expectedParameterTypes) {
125 standardParameters[i] = columns[i];
130 private boolean testMethodParamsHasVarargs(Object[] columns, Class<?>[] expectedParameterTypes) {
132 if (columns[last] == null) {
135 return expectedParameterTypes.length <= columns.length
137 && expectedParameterTypes[last].getComponentType().equals(columns[last].getClass());
140 private Object[] castAllParametersToProperTypes(Object[] columns, Class<?>[] expectedParameterTypes,
142 Object[] result = new Object[columns.length];
144 for (int i = 0; i < columns.length; i++) {
146 result[i] = castParameterDirectly(columns[i], expectedParameterTypes[i]);
148 result[i] = castParameterUsingConverter(columns[i], parameterAnnotations[i]);
210 private void verifySameSizeOfArrays(Object[] columns, Class<?>[] parameterTypes) {
211 if (parameterTypes.length != columns.length)
214 + columns.length + " parameters in annotation, while there's " + parameterTypes.length + " parameters in the "