lux.xml
Class XmlReader

java.lang.Object
  extended by lux.xml.XmlReader
Direct Known Subclasses:
XmlBuilder

public class XmlReader
extends Object

Reads XML and passes events to a brigade of StAXHandlers. Essentially turns StAX into push model parser a'la SAX.

Author:
sokolov

Constructor Summary
XmlReader()
           
 
Method Summary
 void addHandler(StAXHandler handler)
           
 List<StAXHandler> getHandlers()
           
 boolean isStripNamespaces()
          when true, all namespace information is stripped from the reported events.
 void read(InputStream in)
          Consume the byte stream, generating events for the handlers.
 void read(net.sf.saxon.om.NodeInfo node)
           
 void read(Reader reader)
          Consume the character stream, generating events for the handlers.
 void read(XMLStreamReader in)
          Consume the XML stream, generating events for the handlers.
 void reset()
           
 void setStripNamespaces(boolean stripNamespaces)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlReader

public XmlReader()
Method Detail

read

public void read(Reader reader)
          throws XMLStreamException
Consume the character stream, generating events for the handlers.

Parameters:
reader - source of xml StAX events
Throws:
XMLStreamException - if the reader does

read

public void read(InputStream in)
          throws XMLStreamException
Consume the byte stream, generating events for the handlers.

Parameters:
in - source of xml StAX events
Throws:
XMLStreamException - if the reader does

read

public void read(net.sf.saxon.om.NodeInfo node)
          throws XMLStreamException
Throws:
XMLStreamException

addHandler

public void addHandler(StAXHandler handler)

getHandlers

public List<StAXHandler> getHandlers()

read

public void read(XMLStreamReader in)
          throws XMLStreamException
Consume the XML stream, generating events for the handlers.

Parameters:
in - source of xml StAX events
Throws:
XMLStreamException - if the reader does

reset

public void reset()

isStripNamespaces

public boolean isStripNamespaces()
when true, all namespace information is stripped from the reported events. The result is as if all namespace declarations and prefixes were removed from the document.

Returns:
whether namespace information is stripped

setStripNamespaces

public void setStripNamespaces(boolean stripNamespaces)


Copyright © 2013. All Rights Reserved.