Package ghidra.xml
Class NonThreadedXmlPullParserImpl
java.lang.Object
ghidra.xml.AbstractXmlPullParser
ghidra.xml.NonThreadedXmlPullParserImpl
- All Implemented Interfaces:
XmlPullParser
-
Constructor Summary
ConstructorDescriptionNonThreadedXmlPullParserImpl
(File file, ErrorHandler errHandler, boolean validate) NonThreadedXmlPullParserImpl
(InputStream input, String inputName, ErrorHandler errHandler, boolean validate) NonThreadedXmlPullParserImpl
(String input, String inputName, ErrorHandler errHandler, boolean validate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes all resources of the parser.getName()
Returns the name of this parser.getProcessingInstruction
(String piName, String attribute) Returns the value of the attribute of the processing instruction.boolean
hasNext()
Returns whether there is a next element.boolean
Returns whether the parser will return content elements as well as start and end elements (they're always accumulated and provided in the appropriate end element).next()
Returns the next element, removing it from the queue (assuming there is such a next element).peek()
Returns the next element, without removing it from the queue (assuming there is such a next element).void
setPullingContent
(boolean pullingContent) Set whether the parser will return content elements.Methods inherited from class ghidra.xml.AbstractXmlPullParser
discardSubTree, discardSubTree, discardSubTree, end, end, getColumnNumber, getCurrentLevel, getLineNumber, softStart, start
-
Constructor Details
-
NonThreadedXmlPullParserImpl
public NonThreadedXmlPullParserImpl(File file, ErrorHandler errHandler, boolean validate) throws SAXException, IOException - Throws:
SAXException
IOException
-
NonThreadedXmlPullParserImpl
public NonThreadedXmlPullParserImpl(String input, String inputName, ErrorHandler errHandler, boolean validate) throws SAXException - Throws:
SAXException
-
NonThreadedXmlPullParserImpl
public NonThreadedXmlPullParserImpl(InputStream input, String inputName, ErrorHandler errHandler, boolean validate) throws SAXException, IOException - Throws:
SAXException
IOException
-
-
Method Details
-
dispose
public void dispose()Description copied from interface:XmlPullParser
Disposes all resources of the parser. It's important that this is called when a client is finished with the parser, because this allows files to be closed, threads to be stopped, etc. -
getName
Description copied from interface:XmlPullParser
Returns the name of this parser.- Returns:
- the name of this parser
-
getProcessingInstruction
Description copied from interface:XmlPullParser
Returns the value of the attribute of the processing instruction. For example,<?program_dtd version="1"?>
- Parameters:
piName
- the name of the processing instructionattribute
- the name of the attribute- Returns:
- the value of the attribute of the processing instruction
-
hasNext
public boolean hasNext()Description copied from interface:XmlPullParser
Returns whether there is a next element.- Returns:
- whether there is a next element
-
isPullingContent
public boolean isPullingContent()Description copied from interface:XmlPullParser
Returns whether the parser will return content elements as well as start and end elements (they're always accumulated and provided in the appropriate end element).- Returns:
- whether the parser will return content elements
-
next
Description copied from interface:XmlPullParser
Returns the next element, removing it from the queue (assuming there is such a next element). This method should be used RARELY. Typically, when you're reading XML, you almost always at least know that you're either starting or ending a subtree, so start() or end() should be used instead. The only time you really might need to use this is if you don't really know where you are and you need to pop elements off until you synchronize back into a sane state.- Returns:
- the next element, removing it
-
peek
Description copied from interface:XmlPullParser
Returns the next element, without removing it from the queue (assuming there is such a next element). This is very useful for examining the next item to decide who should handle the subtree, and then delegating to a subordinate with the parser state intact.- Returns:
- the next element, without removing it
-
setPullingContent
public void setPullingContent(boolean pullingContent) Description copied from interface:XmlPullParser
Set whether the parser will return content elements. Note that this method may throw an exception if the parser cannot comply with the setting (usually when setting to true).- Parameters:
pullingContent
- whether the parser will return content elements
-