|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| LoggingXMLStreamWriter.java | - | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
/**
|
|
| 2 |
*
|
|
| 3 |
* Copyright 2004 Protique Ltd
|
|
| 4 |
*
|
|
| 5 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
| 6 |
* you may not use this file except in compliance with the License.
|
|
| 7 |
* You may obtain a copy of the License at
|
|
| 8 |
*
|
|
| 9 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
| 10 |
*
|
|
| 11 |
* Unless required by applicable law or agreed to in writing, software
|
|
| 12 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
| 13 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
| 14 |
* See the License for the specific language governing permissions and
|
|
| 15 |
* limitations under the License.
|
|
| 16 |
*
|
|
| 17 |
**/
|
|
| 18 |
package org.codehaus.activesoap.util;
|
|
| 19 |
|
|
| 20 |
import org.apache.commons.logging.Log;
|
|
| 21 |
import org.apache.commons.logging.LogFactory;
|
|
| 22 |
|
|
| 23 |
import javax.xml.stream.XMLStreamException;
|
|
| 24 |
import javax.xml.stream.XMLStreamWriter;
|
|
| 25 |
|
|
| 26 |
/**
|
|
| 27 |
* An implementation of {@link XMLStreamWriter} which will log
|
|
| 28 |
* calls to start/end element which can be very useful for debugging StAX related issues.
|
|
| 29 |
*
|
|
| 30 |
* @version $Revision: 1.2 $
|
|
| 31 |
*/
|
|
| 32 |
public class LoggingXMLStreamWriter extends DelegateXMLStreamWriter { |
|
| 33 |
private transient Log log; |
|
| 34 |
|
|
| 35 | 0 |
public LoggingXMLStreamWriter(XMLStreamWriter delegate) {
|
| 36 | 0 |
this(delegate, LogFactory.getLog(LoggingXMLStreamWriter.class)); |
| 37 |
} |
|
| 38 |
|
|
| 39 | 0 |
public LoggingXMLStreamWriter(XMLStreamWriter delegate, Log log) {
|
| 40 | 0 |
super(delegate);
|
| 41 | 0 |
this.log = log;
|
| 42 |
} |
|
| 43 |
|
|
| 44 | 0 |
public void writeStartDocument() throws XMLStreamException { |
| 45 | 0 |
log.debug("writeStartDocument()");
|
| 46 | 0 |
super.writeStartDocument();
|
| 47 |
} |
|
| 48 |
|
|
| 49 | 0 |
public void writeStartDocument(String s) throws XMLStreamException { |
| 50 | 0 |
log.debug("writeStartDocument(" + s + ")"); |
| 51 | 0 |
super.writeStartDocument(s);
|
| 52 |
} |
|
| 53 |
|
|
| 54 | 0 |
public void writeStartDocument(String s, String s1) throws XMLStreamException { |
| 55 | 0 |
log.debug("writeStartDocument(" + s + ", " + s1 + ")"); |
| 56 | 0 |
super.writeStartDocument(s, s1);
|
| 57 |
} |
|
| 58 |
|
|
| 59 | 0 |
public void writeStartElement(String s) throws XMLStreamException { |
| 60 | 0 |
log.debug("writeStartElement(" + s + ")"); |
| 61 | 0 |
super.writeStartElement(s);
|
| 62 |
} |
|
| 63 |
|
|
| 64 | 0 |
public void writeStartElement(String s, String s1) throws XMLStreamException { |
| 65 | 0 |
log.debug("writeStartElement(" + s + ", " + s1 + ")"); |
| 66 | 0 |
super.writeStartElement(s, s1);
|
| 67 |
} |
|
| 68 |
|
|
| 69 | 0 |
public void writeStartElement(String s, String s1, String s2) throws XMLStreamException { |
| 70 | 0 |
log.debug("writeStartElement(" + s + ", " + s1 + ", " + s2 + ")"); |
| 71 | 0 |
super.writeStartElement(s, s1, s2);
|
| 72 |
} |
|
| 73 |
|
|
| 74 | 0 |
public void writeEndElement() throws XMLStreamException { |
| 75 | 0 |
log.debug("writeEndElement()");
|
| 76 | 0 |
super.writeEndElement();
|
| 77 |
} |
|
| 78 |
|
|
| 79 | 0 |
public void writeEndDocument() throws XMLStreamException { |
| 80 | 0 |
log.debug("writeEndDocument()");
|
| 81 | 0 |
super.writeEndDocument();
|
| 82 |
} |
|
| 83 |
} |
|
| 84 |
|
|
||||||||||