Top Description Methods
org.glassfish.jaxb.core.unmarshaller

public Interface InfosetScanner<XmlNode>

Known Direct Implementers
org.glassfish.jaxb.core.unmarshaller.DOMScanner
Imports
jakarta.xml.bind.Binder, org.glassfish.jaxb.core.v2.runtime.unmarshaller.LocatorEx, org.xml.sax.Attributes, .ContentHandler, .SAXException

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.

Author
Kohsuke Kawaguchi ([email protected])
Since
2.0

Method Summary

Modifier and TypeMethod and Description
public ContentHandler
public XmlNode

Returns:

never return null.
getCurrentElement
()

Gets the current element we are parsing.

public LocatorEx
public void
scan(XmlNode node)

Parses the given DOM-ish element/document and generates SAX events.

public void

Method Detail

getContentHandlerback to summary
public ContentHandler getContentHandler()
getCurrentElementback to summary
public XmlNode getCurrentElement()

Gets the current element we are parsing.

This method could be called from the ContentHandler#startElement(String, String, String, Attributes) or ContentHandler#endElement(String, String, String).

Otherwise the behavior of this method is undefined.

Returns:XmlNode

never return null.

getLocatorback to summary
public LocatorEx getLocator()
scanback to summary
public void scan(XmlNode node) throws SAXException

Parses the given DOM-ish element/document and generates SAX events.

Exceptions
SAXException:
If the ContentHandler throws a SAXException. Do not throw an exception just because the scanner failed (if that can happen we need to change the API.)
ClassCastException:
If the type of the node is not known to this implementation.
setContentHandlerback to summary
public void setContentHandler(ContentHandler handler)

Sets the ContentHandler. This handler receives the SAX events.