public static class PatternLayout.Builder extends java.lang.Object implements Builder<PatternLayout>
builder factory method
to create this.Modifier and Type | Field and Description |
---|---|
private boolean |
alwaysWriteExceptions |
private java.nio.charset.Charset |
charset |
private Configuration |
configuration |
private boolean |
disableAnsi |
private java.lang.String |
footer |
private java.lang.String |
header |
private boolean |
noConsoleNoAnsi |
private java.lang.String |
pattern |
private PatternSelector |
patternSelector |
private RegexReplacement |
regexReplacement |
Modifier | Constructor and Description |
---|---|
private |
Builder() |
Modifier and Type | Method and Description |
---|---|
PatternLayout |
build()
Builds the object after all configuration has been set.
|
PatternLayout.Builder |
withAlwaysWriteExceptions(boolean alwaysWriteExceptions) |
PatternLayout.Builder |
withCharset(java.nio.charset.Charset charset) |
PatternLayout.Builder |
withConfiguration(Configuration configuration) |
PatternLayout.Builder |
withDisableAnsi(boolean disableAnsi) |
PatternLayout.Builder |
withFooter(java.lang.String footer) |
PatternLayout.Builder |
withHeader(java.lang.String header) |
PatternLayout.Builder |
withNoConsoleNoAnsi(boolean noConsoleNoAnsi) |
PatternLayout.Builder |
withPattern(java.lang.String pattern) |
PatternLayout.Builder |
withPatternSelector(PatternSelector patternSelector) |
PatternLayout.Builder |
withRegexReplacement(RegexReplacement regexReplacement) |
@PluginBuilderAttribute private java.lang.String pattern
@PluginElement(value="PatternSelector") private PatternSelector patternSelector
@PluginConfiguration private Configuration configuration
@PluginElement(value="Replace") private RegexReplacement regexReplacement
@PluginBuilderAttribute private java.nio.charset.Charset charset
@PluginBuilderAttribute private boolean alwaysWriteExceptions
@PluginBuilderAttribute private boolean disableAnsi
@PluginBuilderAttribute private boolean noConsoleNoAnsi
@PluginBuilderAttribute private java.lang.String header
@PluginBuilderAttribute private java.lang.String footer
public PatternLayout.Builder withPattern(java.lang.String pattern)
pattern
- The pattern. If not specified, defaults to DEFAULT_CONVERSION_PATTERN.public PatternLayout.Builder withPatternSelector(PatternSelector patternSelector)
patternSelector
- Allows different patterns to be used based on some selection criteria.public PatternLayout.Builder withConfiguration(Configuration configuration)
configuration
- The Configuration. Some Converters require access to the Interpolator.public PatternLayout.Builder withRegexReplacement(RegexReplacement regexReplacement)
regexReplacement
- A Regex replacementpublic PatternLayout.Builder withCharset(java.nio.charset.Charset charset)
charset
- The character set. The platform default is used if not specified.public PatternLayout.Builder withAlwaysWriteExceptions(boolean alwaysWriteExceptions)
alwaysWriteExceptions
- If "true"
(default) exceptions are always written even if the pattern contains no exception tokens.public PatternLayout.Builder withDisableAnsi(boolean disableAnsi)
disableAnsi
- If "true"
(default is false), do not output ANSI escape codespublic PatternLayout.Builder withNoConsoleNoAnsi(boolean noConsoleNoAnsi)
noConsoleNoAnsi
- If "true"
(default is false) and System.console()
is null, do not output ANSI escape codespublic PatternLayout.Builder withHeader(java.lang.String header)
header
- The footer to place at the top of the document, once.public PatternLayout.Builder withFooter(java.lang.String footer)
footer
- The footer to place at the bottom of the document, once.public PatternLayout build()
Builder
build
in interface Builder<PatternLayout>