View Javadoc

1   /**
2    * Logback: the generic, reliable, fast and flexible logging framework for Java.
3    * 
4    * Copyright (C) 2000-2006, QOS.ch
5    * 
6    * This library is free software, you can redistribute it and/or modify it under
7    * the terms of the GNU Lesser General Public License as published by the Free
8    * Software Foundation.
9    */
10  package ch.qos.logback.core.joran.event;
11  
12  import org.xml.sax.Locator;
13  
14  
15  public class BodyEvent extends SaxEvent {
16  
17    private String text;
18  
19    BodyEvent(String text, Locator locator) {
20      super(null, null, null, locator);
21      this.text = text;
22    }
23  
24    public String getText() {
25      return text;
26    }
27  
28    @Override
29    public String toString() {
30      return "BodyEvent(" + getText() + ")" + locator.getLineNumber() + ","
31          + locator.getColumnNumber();
32    }
33  
34    public void append(String str) {
35      text += str;
36    }
37  
38  }