Package ghidra.xml
Class NonThreadedXmlPullParserImpl
- java.lang.Object
-
- ghidra.xml.AbstractXmlPullParser
-
- ghidra.xml.NonThreadedXmlPullParserImpl
-
- All Implemented Interfaces:
XmlPullParser
public class NonThreadedXmlPullParserImpl extends AbstractXmlPullParser
-
-
Constructor Summary
Constructors Constructor Description NonThreadedXmlPullParserImpl(java.io.File file, org.xml.sax.ErrorHandler errHandler, boolean validate)
NonThreadedXmlPullParserImpl(java.io.InputStream input, java.lang.String inputName, org.xml.sax.ErrorHandler errHandler, boolean validate)
NonThreadedXmlPullParserImpl(java.lang.String input, java.lang.String inputName, org.xml.sax.ErrorHandler errHandler, boolean validate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Disposes all resources of the parser.java.lang.String
getName()
Returns the name of this parser.java.lang.String
getProcessingInstruction(java.lang.String piName, java.lang.String attribute)
Returns the value of the attribute of the processing instruction.boolean
hasNext()
Returns whether there is a next element.boolean
isPullingContent()
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).XmlElement
next()
Returns the next element, removing it from the queue (assuming there is such a next element).XmlElement
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 Detail
-
NonThreadedXmlPullParserImpl
public NonThreadedXmlPullParserImpl(java.io.File file, org.xml.sax.ErrorHandler errHandler, boolean validate) throws org.xml.sax.SAXException, java.io.IOException
- Throws:
org.xml.sax.SAXException
java.io.IOException
-
NonThreadedXmlPullParserImpl
public NonThreadedXmlPullParserImpl(java.lang.String input, java.lang.String inputName, org.xml.sax.ErrorHandler errHandler, boolean validate) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
NonThreadedXmlPullParserImpl
public NonThreadedXmlPullParserImpl(java.io.InputStream input, java.lang.String inputName, org.xml.sax.ErrorHandler errHandler, boolean validate) throws org.xml.sax.SAXException, java.io.IOException
- Throws:
org.xml.sax.SAXException
java.io.IOException
-
-
Method Detail
-
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
public java.lang.String getName()
Description copied from interface:XmlPullParser
Returns the name of this parser.- Returns:
- the name of this parser
-
getProcessingInstruction
public java.lang.String getProcessingInstruction(java.lang.String piName, java.lang.String attribute)
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
public XmlElement 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
public XmlElement 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
-
-