Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Logback: the reliable, generic, fast and flexible logging framework. Copyright (C) 1999-2011, QOS.ch. All rights reserved. This program and the accompanying materials are dual-licensed under either the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation or (per the licensee's choosing) under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.
package ch.qos.logback.core.pattern;
public class ConverterUtil {

  
Start converters in the chain of converters.

Parameters:
head
  public static void startConverters(Converter head) {
    Converter c = head;
    while (c != null) {
      // CompositeConverter is a subclass of  DynamicConverter
      if (c instanceof CompositeConverter) {
        CompositeConverter cc = (CompositeConverterc;
        Converter childConverter = cc.childConverter;
        startConverters(childConverter);
        cc.start();
      } else if (c instanceof DynamicConverter) {
        DynamicConverter dc = (DynamicConverterc;
        dc.start();
      }
      c = c.getNext();
    }
  }
  public static <E> Converter<E> findTail(Converter<E> head) {
    Converter<E> p = head;
    while (p != null) {
      Converter<E> next = p.getNext();
      if (next == null) {
        break;
      } else {
        p = next;
      }
    }
    return p;
  }
  public static <E> void setContextForConverters(Context contextConverter<E> head) {
    Converter c = head;
    while (c != null) {
      if (c instanceof ContextAware) {
        ((ContextAwarec).setContext(context);
      }
      c = c.getNext();
    }
  }
New to GrepCode? Check out our FAQ X