Package com.epam.xml.reader
Class DOMReader
java.lang.Object
com.epam.xml.reader.AbstractDocumentReader
com.epam.xml.reader.DOMReader
- All Implemented Interfaces:
DocumentReader
The reader based on DOM parser.
-
Field Summary
Fields inherited from class com.epam.xml.reader.AbstractDocumentReader
current -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUnmarshalerListener(UnmarshalerListener listener) Assign unmarshaler listener to the document reader.static DocumentReadercreateReader(InputStream xml) voidexecute()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.intNumber of attributes in current node.getAttributeName(int index) Name of attribute in current node.protected Elementprotected IntegerGet the name of the current node.protected ElementgetValue()Get the value (text content) of the current node.protected voidreassignCurrentElement(Element current) Methods inherited from class com.epam.xml.reader.AbstractDocumentReader
close, hasMoreChildren, isEndOfDocument, moveDown, moveUp
-
Method Details
-
createReader
-
getChild
- Specified by:
getChildin classAbstractDocumentReader
-
reassignCurrentElement
- Specified by:
reassignCurrentElementin classAbstractDocumentReader
-
getAttribute
Description copied from interface:DocumentReaderGet the value of an attribute of the current node.- Parameters:
name- Name of attribute.
-
getAttribute
Description copied from interface:DocumentReaderGet the value of an attribute of the current node, by index.- Parameters:
index- Index of attribute.
-
getAttributeCount
public int getAttributeCount()Description copied from interface:DocumentReaderNumber of attributes in current node. -
getAttributeName
Description copied from interface:DocumentReaderName of attribute in current node. -
getNodeName
Description copied from interface:DocumentReaderGet the name of the current node. -
getValue
Description copied from interface:DocumentReaderGet the value (text content) of the current node. -
getChildCount
- Specified by:
getChildCountin classAbstractDocumentReader
-
getParent
- Specified by:
getParentin classAbstractDocumentReader
-
addUnmarshalerListener
Description copied from interface:DocumentReaderAssign unmarshaler listener to the document reader. -
execute
public void execute()
-