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 TypeMethodDescriptionvoid
addUnmarshalerListener
(UnmarshalerListener listener) Assign unmarshaler listener to the document reader.static DocumentReader
createReader
(InputStream xml) 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.protected Element
protected Integer
Get the name of the current node.protected Element
getValue()
Get the value (text content) of the current node.protected void
reassignCurrentElement
(Element current) Methods inherited from class com.epam.xml.reader.AbstractDocumentReader
close, hasMoreChildren, isEndOfDocument, moveDown, moveUp
-
Method Details
-
createReader
-
getChild
- Specified by:
getChild
in classAbstractDocumentReader
-
reassignCurrentElement
- Specified by:
reassignCurrentElement
in classAbstractDocumentReader
-
getAttribute
Description copied from interface:DocumentReader
Get the value of an attribute of the current node.- Parameters:
name
- Name of attribute.
-
getAttribute
Description copied from interface:DocumentReader
Get the value of an attribute of the current node, by index.- Parameters:
index
- Index of attribute.
-
getAttributeCount
public int getAttributeCount()Description copied from interface:DocumentReader
Number of attributes in current node. -
getAttributeName
Description copied from interface:DocumentReader
Name of attribute in current node. -
getNodeName
Description copied from interface:DocumentReader
Get the name of the current node. -
getValue
Description copied from interface:DocumentReader
Get the value (text content) of the current node. -
getChildCount
- Specified by:
getChildCount
in classAbstractDocumentReader
-
getParent
- Specified by:
getParent
in classAbstractDocumentReader
-
addUnmarshalerListener
Description copied from interface:DocumentReader
Assign unmarshaler listener to the document reader. -
execute
public void execute()
-