public static ColorConverter newInstance ( Configuration config , String [ ] options ) { if ( options . length < 1 ) { LOGGER . error ( "Incorrect number of options on style. " + "Expected at least 1, received {}" , options . length ) ; return null ; } if ( options [ 0 ] == null ) { LOGGER . error ( "No pattern supplied on style" ) ; return null ; } PatternParser parser = PatternLayout . createPatternParser ( config ) ; List < PatternFormatter > formatters = parser . parse ( options [ 0 ] ) ; AnsiElement element = ( options . length != 1 ) ? ELEMENTS . get ( options [ 1 ] ) : null ; return new ColorConverter ( formatters , element ) ; }
Creates a new instance of the class . Required by Log4J2 .