View Javadoc

1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2011, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.core.joran.event;
15  
16  import org.xml.sax.Attributes;
17  import org.xml.sax.Locator;
18  import org.xml.sax.helpers.AttributesImpl;
19  
20  import ch.qos.logback.core.joran.spi.Pattern;
21  
22  public class StartEvent extends SaxEvent {
23  
24    final public Attributes attributes;
25    final public Pattern pattern;
26    
27    StartEvent(Pattern pattern, String namespaceURI, String localName, String qName,
28        Attributes attributes, Locator locator) {
29      super(namespaceURI, localName, qName, locator);
30      // locator impl is used to take a snapshot!
31      this.attributes = new AttributesImpl(attributes);
32      this.pattern = pattern;
33    }
34  
35    public Attributes getAttributes() {
36      return attributes;
37    }
38  
39    
40    @Override
41    public String toString() {
42      return "StartEvent("+getQName()+")  ["+locator.getLineNumber()+","+locator.getColumnNumber()+"]";
43    }
44  
45  }