com.epam.xml.reader
Class SAXReader

java.lang.Object
  extended by com.epam.xml.reader.SAXReader
All Implemented Interfaces:
DocumentReader

public class SAXReader
extends Object
implements DocumentReader

The reader based on SAX parser.


Constructor Summary
SAXReader(InputSource source, XMLReader parser)
           
 
Method Summary
 void addUnmarshalerListener(UnmarshalerListener listener)
          (non-Javadoc)
 void close()
          Close the reader, if necessary.
static DocumentReader createReader(File xml, UnmarshalerListener listener)
           
static DocumentReader createReader(InputStream xml, UnmarshalerListener listener)
           
 void execute()
          (non-Javadoc)
 String getAttribute(int index)
          Get the value of an attribute of the current node, by index.
 String getAttribute(String name)
          Get the value of an attribute of the current node.
 int getAttributeCount()
          Number of attributes in current node.
 String getAttributeName(int index)
          Name of attribute in current node.
 String getNodeName()
          Get the name of the current node.
 String getValue()
          Get the value (text content) of the current node.
 boolean hasMoreChildren()
          Does the node have any more children remaining that have not yet been read?
 boolean isEndOfDocument()
          Checks of end of xml document.
 void moveDown()
          Select the current child as current node.
 void moveUp()
          Select the parent node as current node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXReader

public SAXReader(InputSource source,
                 XMLReader parser)
Method Detail

close

public void close()
Description copied from interface: DocumentReader
Close the reader, if necessary.

Specified by:
close in interface DocumentReader

getAttribute

public String getAttribute(String name)
Description copied from interface: DocumentReader
Get the value of an attribute of the current node.

Specified by:
getAttribute in interface DocumentReader
Parameters:
name - Name of attribute.

getAttribute

public String getAttribute(int index)
Description copied from interface: DocumentReader
Get the value of an attribute of the current node, by index.

Specified by:
getAttribute in interface DocumentReader
Parameters:
index - Index of attribute.

getAttributeCount

public int getAttributeCount()
Description copied from interface: DocumentReader
Number of attributes in current node.

Specified by:
getAttributeCount in interface DocumentReader

getAttributeName

public String getAttributeName(int index)
Description copied from interface: DocumentReader
Name of attribute in current node.

Specified by:
getAttributeName in interface DocumentReader

getNodeName

public String getNodeName()
Description copied from interface: DocumentReader
Get the name of the current node.

Specified by:
getNodeName in interface DocumentReader

getValue

public String getValue()
Description copied from interface: DocumentReader
Get the value (text content) of the current node.

Specified by:
getValue in interface DocumentReader

hasMoreChildren

public boolean hasMoreChildren()
Description copied from interface: DocumentReader
Does the node have any more children remaining that have not yet been read?

Specified by:
hasMoreChildren in interface DocumentReader
Returns:
True if element has the children nodes.

isEndOfDocument

public boolean isEndOfDocument()
Description copied from interface: DocumentReader
Checks of end of xml document.

Specified by:
isEndOfDocument in interface DocumentReader
Returns:
True if end of document.

moveDown

public void moveDown()
Description copied from interface: DocumentReader
Select the current child as current node. A call to this function must be balanced with a call to DocumentReader.moveUp().

Specified by:
moveDown in interface DocumentReader

moveUp

public void moveUp()
Description copied from interface: DocumentReader
Select the parent node as current node.

Specified by:
moveUp in interface DocumentReader

createReader

public static DocumentReader createReader(InputStream xml,
                                          UnmarshalerListener listener)

createReader

public static DocumentReader createReader(File xml,
                                          UnmarshalerListener listener)

addUnmarshalerListener

public void addUnmarshalerListener(UnmarshalerListener listener)
(non-Javadoc)

Specified by:
addUnmarshalerListener in interface DocumentReader
See Also:
DocumentReader.addUnmarshalerListener(com.epam.xml.engine.UnmarshalerListener)

execute

public void execute()
(non-Javadoc)

Specified by:
execute in interface DocumentReader
See Also:
()


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.