java.lang.Object
pro.verron.officestamper.preset.Resolvers
This class provides static methods to create different types of
ObjectResolver
.- Since:
- 1.6.7
- Version:
- ${version}
- Author:
- Joseph Verron
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectResolver
fallback()
Returns an instance ofObjectResolver
that can act as a fallback resolver.static ObjectResolver
image()
Returns an instance ofObjectResolver
that resolvesImage
to an actual image in the resulting .docx document.static ObjectResolver
isoDate()
Returns an instance ofObjectResolver
that resolvesLocalDate
values to a formatted string using theDateTimeFormatter.ISO_LOCAL_DATE
pattern.static ObjectResolver
isoDate
(DateTimeFormatter formatter) Returns an instance ofObjectResolver
that resolvesLocalDate
values to a formatted string using the givenDateTimeFormatter
pattern.static ObjectResolver
Returns an instance ofObjectResolver
that resolvesLocalDateTime
values to a formatted string using theDateTimeFormatter.ISO_LOCAL_DATE_TIME
pattern.static ObjectResolver
isoDateTime
(DateTimeFormatter formatter) Returns an instance ofObjectResolver
that resolvesLocalDateTime
values to a formatted string using the givenDateTimeFormatter
pattern.static ObjectResolver
isoTime()
Returns an instance ofObjectResolver
that resolvesLocalTime
values to a formatted string using theDateTimeFormatter.ISO_LOCAL_TIME
pattern.static ObjectResolver
isoTime
(DateTimeFormatter formatter) Returns an instance ofObjectResolver
that resolvesLocalTime
values to a formatted string using the givenDateTimeFormatter
pattern.static ObjectResolver
Returns an instance ofObjectResolver
that resolvesDate
values to a formatted string using the "dd.MM.yyyy" pattern.static ObjectResolver
legacyDate
(DateTimeFormatter formatter) Returns an instance ofObjectResolver
that resolvesDate
values to a formatted string using the givenDateTimeFormatter
pattern.static ObjectResolver
nullToDefault
(String value) Returns an instance ofObjectResolver
that resolves null objects by creating a run with a default text value.static ObjectResolver
Returns an instance ofObjectResolver
that replaces null values with an empty string.static ObjectResolver
Returns an instance ofObjectResolver
that resolves null objects by not replacing their expression.
-
Method Details
-
fallback
Returns an instance ofObjectResolver
that can act as a fallback resolver. Will call theObject.toString()
method on every type of objects.- Returns:
- An instance of
ObjectResolver
-
nullToEmpty
Returns an instance ofObjectResolver
that replaces null values with an empty string.- Returns:
- An instance of
ObjectResolver
-
nullToDefault
Returns an instance ofObjectResolver
that resolves null objects by creating a run with a default text value.- Parameters:
value
- The default value for null objects.- Returns:
- An instance of
ObjectResolver
-
nullToPlaceholder
Returns an instance ofObjectResolver
that resolves null objects by not replacing their expression.- Returns:
- An instance of
ObjectResolver
-
isoDateTime
Returns an instance ofObjectResolver
that resolvesLocalDateTime
values to a formatted string using theDateTimeFormatter.ISO_LOCAL_DATE_TIME
pattern.- Returns:
- An instance of
ObjectResolver
-
isoTime
Returns an instance ofObjectResolver
that resolvesLocalTime
values to a formatted string using theDateTimeFormatter.ISO_LOCAL_TIME
pattern.- Returns:
- An instance of
ObjectResolver
-
isoDate
Returns an instance ofObjectResolver
that resolvesLocalDate
values to a formatted string using theDateTimeFormatter.ISO_LOCAL_DATE
pattern.- Returns:
- An instance of
ObjectResolver
-
isoTime
Returns an instance ofObjectResolver
that resolvesLocalTime
values to a formatted string using the givenDateTimeFormatter
pattern.- Parameters:
formatter
- theDateTimeFormatter
pattern to use- Returns:
- An instance of
ObjectResolver
-
isoDate
Returns an instance ofObjectResolver
that resolvesLocalDate
values to a formatted string using the givenDateTimeFormatter
pattern.- Parameters:
formatter
- theDateTimeFormatter
pattern to use- Returns:
- An instance of
ObjectResolver
-
isoDateTime
Returns an instance ofObjectResolver
that resolvesLocalDateTime
values to a formatted string using the givenDateTimeFormatter
pattern.- Parameters:
formatter
- theDateTimeFormatter
pattern to use- Returns:
- An instance of
ObjectResolver
-
legacyDate
Returns an instance ofObjectResolver
that resolvesDate
values to a formatted string using the "dd.MM.yyyy" pattern.- Returns:
- An instance of
ObjectResolver
-
legacyDate
Returns an instance ofObjectResolver
that resolvesDate
values to a formatted string using the givenDateTimeFormatter
pattern.- Parameters:
formatter
- theDateTimeFormatter
pattern to use- Returns:
- An instance of
ObjectResolver
-
image
Returns an instance ofObjectResolver
that resolvesImage
to an actual image in the resulting .docx document. The image will be put as an inline into the surrounding paragraph of text.- Returns:
- An instance of
ObjectResolver
-