Interface TemplateResolver<V>

All Known Subinterfaces:
EventResolver, StackTraceResolver
All Known Implementing Classes:
CaseConverterResolver, CounterResolver, EndOfBatchResolver, ExceptionResolver, ExceptionRootCauseResolver, LevelResolver, LoggerResolver, MainMapResolver, MapResolver, MarkerResolver, MessageParameterResolver, MessageResolver, PatternResolver, ReadOnlyStringMapResolver, SourceResolver, StackTraceElementResolver, StackTraceObjectResolver, StackTraceStringResolver, TemplateResolvers.UnresolvableTemplateResolver, ThreadContextDataResolver, ThreadContextStackResolver, ThreadResolver, TimestampResolver, TimestampResolver.EpochResolver, TimestampResolver.PatternResolver
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TemplateResolver<V>
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Indicates if the resolution should be appended to the parent JSON object.
    default boolean
    Indicates if the resolver if applicable at all.
    default boolean
    isResolvable(V value)
    Indicates if the resolver if applicable for the given value.
    void
    resolve(V value, JsonWriter jsonWriter)
    Resolves the given value using the provided JsonWriter.
    default void
    resolve(V value, JsonWriter jsonWriter, boolean succeedingEntry)
    Resolves the given value using the provided JsonWriter.
  • Method Details

    • isFlattening

      default boolean isFlattening()
      Indicates if the resolution should be appended to the parent JSON object.

      For instance, ThreadContextDataResolver, i.e., MDC resolver, uses this flag to indicate whether the contents should be appended to the parent JSON object or not.

    • isResolvable

      default boolean isResolvable()
      Indicates if the resolver if applicable at all.

      For instance, the source line resolver can be short-circuited using this check if the location information is disabled in the layout configuration.

    • isResolvable

      default boolean isResolvable(V value)
      Indicates if the resolver if applicable for the given value.

      For instance, the stack trace resolver can be short-circuited using this check if the stack traces are disabled in the layout configuration.

    • resolve

      void resolve(V value, JsonWriter jsonWriter)
      Resolves the given value using the provided JsonWriter.
    • resolve

      default void resolve(V value, JsonWriter jsonWriter, boolean succeedingEntry)
      Resolves the given value using the provided JsonWriter.
      Parameters:
      succeedingEntry - false, if this is the first element in a collection; true, otherwise