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  
11  package ch.qos.logback.core.joran.event;
12  
13  import org.xml.sax.Attributes;
14  import org.xml.sax.Locator;
15  import org.xml.sax.helpers.AttributesImpl;
16  
17  import ch.qos.logback.core.joran.spi.Pattern;
18  
19  public class StartEvent extends SaxEvent {
20  
21    final public Attributes attributes;
22    final public Pattern pattern;
23    
24    StartEvent(Pattern pattern, String namespaceURI, String localName, String qName,
25        Attributes attributes, Locator locator) {
26      super(namespaceURI, localName, qName, locator);
27      // locator impl is used to take a snapshot!
28      this.attributes = new AttributesImpl(attributes);
29      this.pattern = pattern;
30    }
31  
32    public Attributes getAttributes() {
33      return attributes;
34    }
35  
36    
37    @Override
38    public String toString() {
39      return "StartEvent("+getQName()+")  ["+locator.getLineNumber()+","+locator.getColumnNumber()+"]";
40    }
41  
42  }