View Javadoc

1   /**
2    * LOGBack: the reliable, fast and flexible logging library for Java.
3    *
4    * Copyright (C) 1999-2006, QOS.ch
5    *
6    * This library is free software, you can redistribute it and/or
7    * modify it under the terms of the GNU Lesser General Public License as
8    * published by the Free Software Foundation.
9    */
10  package ch.qos.logback.core;
11  
12  import ch.qos.logback.core.spi.ContextAwareBase;
13  
14  abstract public class LayoutBase<E> extends ContextAwareBase implements Layout<E>  {
15  
16    protected boolean started;
17    
18    String fileHeader;
19    String fileFooter;
20    String presentationHeader;
21    String presentationFooter;
22    
23    public void setContext(Context context) {
24      this.context = context;
25    }
26  
27    public Context getContext() {
28      return this.context;
29    }
30  
31    public void start() {
32      started = true;
33    }
34  
35    public void stop() {
36      started = false;
37    }
38    
39    public boolean isStarted() {
40      return started;
41    }
42    
43    public String getFileHeader() {
44      return fileHeader;
45    }
46    
47    public String getPresentationHeader() {
48      return presentationHeader;
49    }
50    
51    public String getPresentationFooter() {
52      return presentationFooter;
53    }
54    
55    public String getFileFooter() {
56      return fileFooter;
57    }
58  
59    public String getContentType() {
60      return "text/plain";
61    }
62    
63    public void setFileHeader(String header) {
64      this.fileHeader = header;
65    }
66  
67    public void setFileFooter(String footer) {
68      this.fileFooter = footer;
69    }
70    
71    public void setPresentationHeader(String header) {
72      this.presentationHeader = header;
73    }
74  
75    public void setPresentationFooter(String footer) {
76      this.presentationFooter = footer;
77    }
78  }