private ColumnSpec[] parseColumnSpecs() { List encodedColumnSpecs = split(source, 0); int columnCount = encodedColumnSpecs.size(); ColumnSpec[] columnSpecs = new ColumnSpec[columnCount]; for (int i = 0; i < columnCount; i++) { String encodedSpec = (String) encodedColumnSpecs.get(i); columnSpecs[i] = ColumnSpec.decodeExpanded(encodedSpec); } return columnSpecs; }
private ColumnSpec[] parseColumnSpecs() { List encodedColumnSpecs = split(source, 0); int columnCount = encodedColumnSpecs.size(); ColumnSpec[] columnSpecs = new ColumnSpec[columnCount]; for (int i = 0; i < columnCount; i++) { String encodedSpec = (String) encodedColumnSpecs.get(i); columnSpecs[i] = ColumnSpec.decodeExpanded(encodedSpec); } return columnSpecs; }
/** * Parses the encoded column specifications and returns a ColumnSpec object * that represents the string. Variables are expanded using the given * LayoutMap. * * @param encodedColumnSpec the encoded column specification * @param layoutMap expands layout column variables * * @return a ColumnSpec instance for the given specification * @throws NullPointerException if {@code encodedColumnSpec} or * {@code layoutMap} is {@code null} * * @see #decodeSpecs(String, LayoutMap) * * @since 1.2 */ public static ColumnSpec decode(String encodedColumnSpec, LayoutMap layoutMap) { FormUtils.assertNotBlank(encodedColumnSpec, "encoded column specification"); FormUtils.assertNotNull(layoutMap, "LayoutMap"); String trimmed = encodedColumnSpec.trim(); String lower = trimmed.toLowerCase(Locale.ENGLISH); return decodeExpanded(layoutMap.expand(lower, true)); }
/** * Parses the encoded column specifications and returns a ColumnSpec object * that represents the string. Variables are expanded using the given * LayoutMap. * * @param encodedColumnSpec the encoded column specification * @param layoutMap expands layout column variables * * @return a ColumnSpec instance for the given specification * @throws NullPointerException if {@code encodedColumnSpec} or * {@code layoutMap} is {@code null} * @throws IllegalArgumentException if {@code encodedColumnSpec} is empty * or whitespace * * @see #decodeSpecs(String, LayoutMap) * * @since 1.2 */ public static ColumnSpec decode(String encodedColumnSpec, LayoutMap layoutMap) { checkNotBlank(encodedColumnSpec, "The encoded column specification must not be null, empty or whitespace."); checkNotNull(layoutMap, "The LayoutMap must not be null."); String trimmed = encodedColumnSpec.trim(); String lower = trimmed.toLowerCase(Locale.ENGLISH); return decodeExpanded(layoutMap.expand(lower, true)); }