class ColumnFactory {

    public Column getColumn(String value) {
        Matcher m = PATTERN.matcher(value);
        if (!m.matches()) {
            throw new IllegalArgumentException("value " + value + " is not a valid column definition");
        }

        String name = m.group(1);
        String type = m.group(6);
        type = type == null ? "String" : type;
        boolean array = (m.group(4) != null) || (m.group(7) != null);
        if (array) {
            return new ArrayColumn(name,
                                   createColumn(name,
                                                type));
        }
        return createColumn(name,
                            type);
    }

}