return null; String expandedString = expand(value, true); columnMapCache.put(resolvedKey, expandedString); return expandedString;
return null; String expandedString = expand(value, true); columnMapCache.put(resolvedKey, expandedString); return expandedString;
return null; String expandedString = expand(value, false); rowMapCache.put(resolvedKey, expandedString); return expandedString;
return null; String expandedString = expand(value, false); rowMapCache.put(resolvedKey, expandedString); return expandedString;
/** * 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)); }
/** * 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)); }
/** * Constructs a parser for the given encoded column/row specification, * the given LayoutMap, and orientation. * * @param source the raw encoded column or row specification * as provided by the user * @param description describes the source, e.g. "column specification" * @param layoutMap maps layout variable names to ColumnSpec and * RowSpec objects * @param horizontal {@code true} for columns, {@code false} for rows * * @throws NullPointerException if {@code source} is {@code null} */ private FormSpecParser( String source, String description, LayoutMap layoutMap, boolean horizontal) { FormUtils.assertNotNull(source, description); FormUtils.assertNotNull(layoutMap, "LayoutMap"); this.layoutMap = layoutMap; this.source = this.layoutMap.expand(source, horizontal); }
/** * Constructs a parser for the given encoded column/row specification, * the given LayoutMap, and orientation. * * @param source the raw encoded column or row specification * as provided by the user * @param description describes the source, e.g. "column specification" * @param layoutMap maps layout variable names to ColumnSpec and * RowSpec objects * @param horizontal {@code true} for columns, {@code false} for rows * * @throws NullPointerException if {@code source} or {@code layoutMap} is {@code null} */ private FormSpecParser( String source, String description, LayoutMap layoutMap, boolean horizontal) { checkNotNull(source, "The %S must not be null.", description); checkNotNull(layoutMap, "The LayoutMap must not be null."); this.layoutMap = layoutMap; this.source = this.layoutMap.expand(source, horizontal); }
/** * Parses the encoded row specifications and returns a RowSpec object * that represents the string. Variables are expanded using the given * LayoutMap. * * @param encodedRowSpec the encoded column specification * @param layoutMap expands layout row variables * * @return a RowSpec instance for the given specification * @throws NullPointerException if {@code encodedRowSpec} or * {@code layoutMap} is {@code null} * * @see #decodeSpecs(String, LayoutMap) * * @since 1.2 */ public static RowSpec decode(String encodedRowSpec, LayoutMap layoutMap) { FormUtils.assertNotBlank(encodedRowSpec, "encoded row specification"); FormUtils.assertNotNull(layoutMap, "LayoutMap"); String trimmed = encodedRowSpec.trim(); String lower = trimmed.toLowerCase(Locale.ENGLISH); return decodeExpanded(layoutMap.expand(lower, false)); }
/** * Parses the encoded row specifications and returns a RowSpec object * that represents the string. Variables are expanded using the given * LayoutMap. * * @param encodedRowSpec the encoded column specification * @param layoutMap expands layout row variables * * @return a RowSpec instance for the given specification * @throws NullPointerException if {@code encodedRowSpec} or * {@code layoutMap} is {@code null} * * @see #decodeSpecs(String, LayoutMap) * * @since 1.2 */ public static RowSpec decode(String encodedRowSpec, LayoutMap layoutMap) { checkNotBlank(encodedRowSpec, "The encoded row specification must not be null, empty or whitespace."); checkNotNull(layoutMap, "The LayoutMap must not be null."); String trimmed = encodedRowSpec.trim(); String lower = trimmed.toLowerCase(Locale.ENGLISH); return decodeExpanded(layoutMap.expand(lower, false)); }