@Status(stage=DEVELOPMENT, unitTests=ABSENT) public final class FormatWithSeparators extends Object
Modifier and Type | Method and Description |
---|---|
static String |
formatBean(String formatString,
Object bean)
Formats the supplied bean, using the supplied formatString, assuming
that accolades "{}" are used for property expressions and guillemets
"«»" for separator expressions.
|
static String |
formatBean(String formatString,
String propertyExpressionSeparators,
String separatorExpressionSeparators,
Object bean)
Formats the supplied bean, using the supplied formatString that in turn
uses the supplied separators for property expressions and separator
expressions.
|
static String |
replaceSeparatorExpressionsWithSeparators(String formatString,
String separatorExpressionSeparators)
Replaces all separator expressions in the supplied formatString with the
actual separator characters that occur within the separator expression,
provided that there is text, both left and right of the separator
expression.
|
public static String formatBean(String formatString, Object bean)
formatString
- The format string used to format the supplied bean.bean
- The bean to format.IllegalArgumentException
- When the supplied formatString is
empty.NullPointerException
- When either the supplied formatString or
bean is null.public static String formatBean(String formatString, String propertyExpressionSeparators, String separatorExpressionSeparators, Object bean)
formatString
- The format string used to format the supplied bean.propertyExpressionSeparators
- The two (opening and closing)
characters for property expressions.separatorExpressionSeparators
- The two (opening and closing)
characters for separator expressions.bean
- The bean to format.IllegalArgumentException
- When either the supplied formatString
is empty or propertyExpressionSeparators does not contain 2 chars or
separatorExpressionSeparators does not contain 2 chars.NullPointerException
- When either the supplied formatString,
propertyExpressionSeparators or separatorExpressionSeparators or bean
is null.public static String replaceSeparatorExpressionsWithSeparators(String formatString, String separatorExpressionSeparators)
formatString
- The format string, possibly containing separator
expressions.separatorExpressionSeparators
- The two (opening and closing)
characters for separator expressions.IllegalArgumentException
- When either the supplied formatString
is empty or contains illegally formed separator expressions or when
the supplied separatorExpressionSeparators does not contain exactly 2
separator characters.NullPointerException
- When either the supplied formatString or
separatorExpressionSeparators is null.Copyright © 2008–2018. All rights reserved.