Log4j 1.3alpha-8

org.apache.log4j.xml
Class XMLDecoder

java.lang.Object
  |
  +--org.apache.log4j.xml.XMLDecoder
All Implemented Interfaces:
Decoder

public class XMLDecoder
extends Object
implements Decoder

Decodes Logging Events in XML formated into elements that are used by Chainsaw. This decoder can process a collection of log4j:event nodes ONLY (no XML declaration nor eventSet node) NOTE: Only a single LoggingEvent is returned from the decode method even though the DTD supports multiple events nested in an eventSet.

Author:
Scott Deboy , Paul Smith

Constructor Summary
XMLDecoder()
           
XMLDecoder(Component owner)
           
 
Method Summary
 LoggingEvent decode(String data)
          Converts the string data into an XML Document, and then soaks out the relevant bits to form a new LoggingEvent instance which can be used by any Log4j element locally.
 Vector decode(URL url)
          Decodes a File into a Vector of LoggingEvents
 Vector decodeEvents(String document)
           
 void setAdditionalProperties(Map additionalProperties)
          Sets an additionalProperty map, where each Key/Value pair is automatically added to each LoggingEvent as it is decoded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDecoder

public XMLDecoder(Component owner)

XMLDecoder

public XMLDecoder()
Method Detail

setAdditionalProperties

public void setAdditionalProperties(Map additionalProperties)
Sets an additionalProperty map, where each Key/Value pair is automatically added to each LoggingEvent as it is decoded. This is useful, say, to include the source file name of the Logging events
Specified by:
setAdditionalProperties in interface Decoder
Parameters:
additionalProperties -  

decode

public Vector decode(URL url)
              throws IOException
Decodes a File into a Vector of LoggingEvents
Specified by:
decode in interface Decoder
Parameters:
url - the url of a file containing events to decode
Returns:
Vector of LoggingEvents
Throws:
IOException -  

decodeEvents

public Vector decodeEvents(String document)
Specified by:
decodeEvents in interface Decoder

decode

public LoggingEvent decode(String data)
Converts the string data into an XML Document, and then soaks out the relevant bits to form a new LoggingEvent instance which can be used by any Log4j element locally.
Specified by:
decode in interface Decoder
Parameters:
data -  
Returns:
a single LoggingEvent

Log4j 1.3alpha-8

Copyright © 2000-2006 Apache Software Foundation.
Licensed under the Apache License, Version 2.0.