Package com.epam.xml.reader
Interface DocumentReader
- All Known Implementing Classes:
AbstractDocumentReader
,DOMReader
,SAXReader
public interface DocumentReader
Reads XML document.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addUnmarshalerListener
(UnmarshalerListener listener) Assign unmarshaler listener to the document reader.void
close()
Close the reader, if necessary.void
execute()
getAttribute
(int index) Get the value of an attribute of the current node, by index.getAttribute
(String name) Get the value of an attribute of the current node.int
Number of attributes in current node.getAttributeName
(int index) Name of attribute in current node.Get the name of the current node.getValue()
Get the value (text content) of the current node.boolean
Does the node have any more children remaining that have not yet been read?boolean
Checks of end of xml document.void
moveDown()
Select the current child as current node.void
moveUp()
Select the parent node as current node.
-
Method Details
-
hasMoreChildren
boolean hasMoreChildren()Does the node have any more children remaining that have not yet been read?- Returns:
- True if element has the children nodes.
-
moveDown
void moveDown()Select the current child as current node. A call to this function must be balanced with a call tomoveUp()
. -
moveUp
void moveUp()Select the parent node as current node. -
getNodeName
String getNodeName()Get the name of the current node. -
getValue
String getValue()Get the value (text content) of the current node. -
getAttribute
Get the value of an attribute of the current node.- Parameters:
name
- Name of attribute.
-
getAttribute
Get the value of an attribute of the current node, by index.- Parameters:
index
- Index of attribute.
-
getAttributeCount
int getAttributeCount()Number of attributes in current node. -
getAttributeName
Name of attribute in current node. -
close
void close()Close the reader, if necessary. -
isEndOfDocument
boolean isEndOfDocument()Checks of end of xml document.- Returns:
- True if end of document.
-
addUnmarshalerListener
Assign unmarshaler listener to the document reader.- Parameters:
listener
-
-
execute
void execute()
-