@@ -0,0 +1,2437 @@
+/*%0A * Copyright (C) 2015 Pedro Vicente Gomez Sanchez.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.github.pedrovgs.lynx.renderer;%0A%0Aimport com.github.pedrovgs.lynx.model.Trace;%0Aimport com.github.pedrovgs.lynx.model.TraceLevel;%0Aimport com.pedrogomez.renderers.Renderer;%0Aimport com.pedrogomez.renderers.RendererBuilder;%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0A%0A/**%0A * Renderer builder implementation created to return Renderer%3CTrace%3E instances based on the trace%0A * level. This builder will use six different Renderer%3CTrace%3E implementations, one for each%0A * TraceLevel type.%0A *%0A * To learn more about Renderers library take a look to the repository:%0A * https://github.com/pedrovgs/Renderers%0A *%0A * @author Pedro Vicente G%C3%B3mez S%C3%A1nchez.%0A */%0Aclass TraceRendererBuilder extends RendererBuilder%3CTrace%3E %7B%0A%0A  public TraceRendererBuilder() %7B%0A    List%3CRenderer%3CTrace%3E%3E prototypes = new LinkedList%3CRenderer%3CTrace%3E%3E();%0A    prototypes.add(new TraceRenderer());%0A    prototypes.add(new AssertTraceRenderer());%0A    prototypes.add(new DebugTraceRenderer());%0A    prototypes.add(new InfoTraceRenderer());%0A    prototypes.add(new WarningTraceRenderer());%0A    prototypes.add(new ErrorTraceRenderer());%0A    setPrototypes(prototypes);%0A  %7D%0A%0A  @Override protected Class getPrototypeClass(Trace content) %7B%0A    Class rendererClass = null;%0A    TraceLevel traceLevel = content.getLevel();%0A    switch (traceLevel) %7B%0A      case ASSERT:%0A        rendererClass = AssertTraceRenderer.class;%0A        break;%0A      case DEBUG:%0A        rendererClass = DebugTraceRenderer.class;%0A        break;%0A      case INFO:%0A        rendererClass = InfoTraceRenderer.class;%0A        break;%0A      case WARNING:%0A        rendererClass = WarningTraceRenderer.class;%0A        break;%0A      case ERROR:%0A        rendererClass = ErrorTraceRenderer.class;%0A        break;%0A      default:%0A        rendererClass = TraceRenderer.class;%0A    %7D%0A    return rendererClass;%0A  %7D%0A%7D%0A

Create and implement TraceRendererBuilder using TraceRenderer classes