Package com.sun.xml.bind.unmarshaller
Interface InfosetScanner<XmlNode>
-
- All Known Implementing Classes:
DOMScanner
public interface InfosetScanner<XmlNode>
Visits a DOM-ish API and generates SAX events.This interface is not tied to any particular DOM API. Used by the
Binder
.Since we are parsing a DOM-ish tree, I don't think this scanner itself will ever find an error, so this class doesn't have its own error reporting scheme.
This interface MAY NOT be implemented by the generated runtime nor the generated code. We may add new methods on this interface later. This is to be implemented by the static runtime only.
- Since:
- 2.0
- Author:
- Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.xml.sax.ContentHandler
getContentHandler()
XmlNode
getCurrentElement()
Gets the current element we are parsing.LocatorEx
getLocator()
void
scan(XmlNode node)
Parses the given DOM-ish element/document and generates SAX events.void
setContentHandler(org.xml.sax.ContentHandler handler)
Sets theContentHandler
.
-
-
-
Method Detail
-
scan
void scan(XmlNode node) throws org.xml.sax.SAXException
Parses the given DOM-ish element/document and generates SAX events.- Throws:
java.lang.ClassCastException
- If the type of the node is not known to this implementation.org.xml.sax.SAXException
- If theContentHandler
throws aSAXException
. Do not throw an exception just because the scanner failed (if that can happen we need to change the API.)
-
setContentHandler
void setContentHandler(org.xml.sax.ContentHandler handler)
Sets theContentHandler
. This handler receives the SAX events.
-
getContentHandler
org.xml.sax.ContentHandler getContentHandler()
-
getCurrentElement
XmlNode getCurrentElement()
Gets the current element we are parsing.This method could be called from the
ContentHandler.startElement(String, String, String, Attributes)
orContentHandler.endElement(String, String, String)
.Otherwise the behavior of this method is undefined.
- Returns:
- never return null.
-
getLocator
LocatorEx getLocator()
-
-