Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.logging.log4j.core.pattern
Class PatternParser

    java.lang.Object
      org.apache.logging.log4j.core.pattern.PatternParser

    public final class PatternParser

extends Object

Most of the work of the `PatternLayout` class is delegated to the PatternParser class.

It is this class that parses conversion patterns and creates a chained list of `PatternConverters`.

Constructor Summary
`PatternParser(Configuration config, String converterKey, Class<?> expected)` Constructor.
`PatternParser(Configuration config, String converterKey, Class<?> expectedClass, Class<?> filterClass)` Constructor.
`PatternParser(String converterKey)` Constructor.

Method Summary
`List<PatternFormatter>` | `parse(String pattern)`
`List<PatternFormatter>` | `parse(String pattern, boolean alwaysWriteExceptions, boolean noConsoleNoAnsi)`
`void` | `parse(String pattern, List<PatternConverter> patternConverters, List<FormattingInfo> formattingInfos, boolean noConsoleNoAnsi, boolean convertBackslashes)` Parse a format specifier.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PatternParser

    public PatternParser(String converterKey)

  Constructor.

  Parameters:
    `converterKey` - The type of converters that will be used.

### PatternParser

    public PatternParser(Configuration config,
                         String converterKey,
                         Class<?> expected)

  Constructor.

  Parameters:
    `config` - The current Configuration.
    `converterKey` - The key to lookup the converters.
    `expected` - The expected base Class of each Converter.

### PatternParser

    public PatternParser(Configuration config,
                         String converterKey,
                         Class<?> expectedClass,
                         Class<?> filterClass)

  Constructor.

  Parameters:
    `config` - The current Configuration.
    `converterKey` - The key to lookup the converters.
    `expectedClass` - The expected base Class of each Converter.
    `filterClass` - Filter the returned plugins after calling the plugin manager.

Method Detail

### parse

    public List<PatternFormatter> parse(String pattern)

### parse

    public List<PatternFormatter> parse(String pattern,
                                        boolean alwaysWriteExceptions,
                                        boolean noConsoleNoAnsi)

### parse

    public void parse(String pattern,
                      List<PatternConverter> patternConverters,
                      List<FormattingInfo> formattingInfos,
                      boolean noConsoleNoAnsi,
                      boolean convertBackslashes)

  Parse a format specifier.

  Parameters:
    `pattern` - pattern to parse.
    `patternConverters` - list to receive pattern converters.
    `formattingInfos` - list to receive field specifiers corresponding to pattern converters.
    `noConsoleNoAnsi` - TODO
    `convertBackslashes` - if `true`, backslash characters are treated as escape characters and character sequences like "\" followed by "t" (backslash+t) are converted to special characters like '\t' (tab).

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.