Package org.nmap4j.parser
Class OnePassParser
java.lang.Object
org.nmap4j.parser.OnePassParser
- All Implemented Interfaces:
NMap4JParserEventListener
The OnePassParser takes a document and parsers it all the way through and
returns a tree of Objects that represent the XML that was just parsed.
This type of parsing is best for smaller documents where the time to parse it is small and the amount of data is less. If you have a large XML document, you may want to consider using the NotifyingParser which issues an event listener model, allowing you to listen in for host objects as they are parsed.
To use this class, pass in a either a File object or an InputStream and call the parse() method. You will receive a tree of objects that contain the contents of the XML.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(NMap4JParserEventListener aListener) void
void
removeListener
(NMap4JParserEventListener aListener)
-
Field Details
-
STRING_INPUT
public static final int STRING_INPUT- See Also:
-
FILE_NAME_INPUT
public static final int FILE_NAME_INPUT- See Also:
-
-
Constructor Details
-
OnePassParser
public OnePassParser()
-
-
Method Details
-
parse
-
parseEventNotification
- Specified by:
parseEventNotification
in interfaceNMap4JParserEventListener
-
addListener
-
removeListener
-