Class InstantPatternDynamicFormatter

java.lang.Object
org.apache.logging.log4j.core.util.internal.instant.InstantPatternDynamicFormatter
All Implemented Interfaces:
InstantFormatter, InstantPatternFormatter

final class InstantPatternDynamicFormatter extends Object implements InstantPatternFormatter
An InstantPatternFormatter that uses DateTimeFormatter under the hood. The pattern is analyzed and parts that require a precision lower than or equal to are precomputed, cached, and updated once every . The rest is computed dynamically.

For instance, given the pattern yyyy-MM-dd'T'HH:mm:ss.SSSX, the generated formatter will

  1. Sequence the pattern and assign a time precision to each part (e.g., MM is of month precision)
  2. Precompute and cache the output for parts that are of precision lower than or equal to (i.e., yyyy-MM-dd'T'HH:mm: and X) and cache it
  3. Upon a formatting request, combine the cached outputs with the dynamic parts (i.e., ss.SSS)
Since:
2.25.0