src/de/plpt/ArgumentParser/ArgumentParser.java
/**
	 * Process array parameters of Method definition.
	 * Preturn strongly typed primitive wrapper Object array
	 *
	 * @param matcher    Matcher to match given regex groups
	 * @param i          Index of Matcher group
	 * @param type       Type of array
	 * @param annotation Parameter Annotation for additional array information
	 * @return strongly typed pared object array
	 * @throws ArgumentParserException    is thrown when there is an error parsing values
	 * @throws IntervalViolationException is thrown when a given number is not in defined interval
	 */
Process array parameters of Method definition.
Preturn strongly typed primitive wrapper Object array


Process array parameters of Method definition . Preturn strongly typed primitive wrapper Object array
private Object[] processArrayParameter(Matcher matcher, int i, Class<?> type, Annotation annotation)
			throws ArgumentParserException, IntervalViolationException {
		ParameterInfo parameterInfo = (ParameterInfo) annotation;
		Class<?> arrayType = type.getComponentType();
		if (arrayType.isPrimitive()) {
			throw new ArgumentParserException(
					String.format("Array type '%s' is primitive. Please use object wrapper class instead."
							, arrayType.getName()));
		}
		Object[] array = (Object[]) Array.newInstance(arrayType, parameterInfo.arrayLenght());
		for (int j = 0; j < array.length; j++) {
			String paramString = matcher.group(i + j + 1);
			try {
				Object parsedValue = parseValue(paramString, arrayType);
				validateParameter(i, parameterInfo, parsedValue);
				array[j] = parsedValue;
			} catch (NumberFormatException nfe) {
				createSpecificNumberFormatException(i, type, paramString, nfe);
			}
		}
		return array;
	}
private Object [ ] processArrayParameter ( Matcher matcher , int i , Class < ? > type , Annotation annotation ) throws ArgumentParserException , IntervalViolationException { ParameterInfo parameterInfo = ( ParameterInfo ) annotation ; Class < ? > arrayType = type . getComponentType ( ) ; if ( arrayType . isPrimitive ( ) ) { throw new ArgumentParserException ( String . format ( "Array type '%s' is primitive. Please use object wrapper class instead." , arrayType . getName ( ) ) ) ; } Object [ ] array = ( Object [ ] ) Array . newInstance ( arrayType , parameterInfo . arrayLenght ( ) ) ; for ( int j = 0 ; j < array . length ; j ++ ) { String paramString = matcher . group ( i + j + 1 ) ; try { Object parsedValue = parseValue ( paramString , arrayType ) ; validateParameter ( i , parameterInfo , parsedValue ) ; array [ j ] = parsedValue ; } catch ( NumberFormatException nfe ) { createSpecificNumberFormatException ( i , type , paramString , nfe ) ; } } return array ; }
Process array parameters of Method definition.
Process array parameters of Method definition .