public static VariableDecorator createDecoratorForVariableType(
			Object variable, int maximum) {

		VariableDecorator decorator = null;

		if (variable == null) {

			decorator = new SimpleVariableDecorator();

		} else if (variable instanceof Object[]) {

			decorator = new ArrayVariableDecorator();

		} else if (variable instanceof byte[]) {

			decorator = new ByteArrayVariableDecorator();

		} else if (variable instanceof short[]) {

			decorator = new ShortIntegerArrayVariableDecorator();

		} else if (variable instanceof int[]) {

			decorator = new IntegerArrayVariableDecorator();

		} else if (variable instanceof long[]) {

			decorator = new LongIntegerArrayVariableDecorator();

		} else if (variable instanceof float[]) {

			decorator = new FloatArrayVariableDecorator();

		} else if (variable instanceof double[]) {

			decorator = new DoubleIntegerArrayVariableDecorator();

		} else if (variable instanceof boolean[]) {

			decorator = new BooleanArrayVariableDecorator();

		} else if (variable instanceof char[]) {

			decorator = new CharacterArrayVariableDecorator();

		} else if (variable instanceof Collection) {

			decorator = new CollectionVariableDecorator();

		} else if (variable instanceof Map) {

			decorator = new MapVariableDecorator();

		} else {

			decorator = new SimpleVariableDecorator();

		}

		decorator.setVariable(variable);
		decorator.setMaximum(maximum);

		return decorator;

	}