Class DOMScanner
java.lang.Object
org.glassfish.jaxb.core.unmarshaller.DOMScanner
- All Implemented Interfaces:
InfosetScanner<Node>,LocatorEx,Locator
Visits a W3C DOM tree and generates SAX2 events from it.
This class is just intended to be used by AbstractUnmarshallerImpl.
The jakarta.xml.bind.helpers package is generally a wrong place to put
classes like this.
- Since:
- JAXB 1.0
- Author:
- Kohsuke Kawaguchi, Sun Microsystems, Inc.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.glassfish.jaxb.core.v2.runtime.unmarshaller.LocatorEx
LocatorEx.Snapshot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the current element we are parsing.The same asgetCurrentElement()but better typed.intGets the current location in aValidationEventLocatorobject.voidparse(Element e, ContentHandler handler) Deprecated, for removal: This API element is subject to removal in a future version.voidparseWithContext(Element e, ContentHandler handler) Deprecated, for removal: This API element is subject to removal in a future version.in JAXB 2.0 Usescan(Element)voidvoidvoidParses the given DOM-ish element/document and generates SAX events.voidsetContentHandler(ContentHandler handler) Sets theContentHandler.voidsetLocator(Locator loc) Configures the locator object that the SAXContentHandlerwill see.voidVisits an element and its subtree.
-
Constructor Details
-
DOMScanner
public DOMScanner()
-
-
Method Details
-
setLocator
Configures the locator object that the SAXContentHandlerwill see. -
scan
Description copied from interface:InfosetScannerParses the given DOM-ish element/document and generates SAX events.- Specified by:
scanin interfaceInfosetScanner<Node>- Throws:
SAXException- If theContentHandlerthrows aSAXException. Do not throw an exception just because the scanner failed (if that can happen we need to change the API.)
-
scan
- Throws:
SAXException
-
scan
- Throws:
SAXException
-
parse
@Deprecated(since="2.0", forRemoval=true) public void parse(Element e, ContentHandler handler) throws SAXException Deprecated, for removal: This API element is subject to removal in a future version.in JAXB 2.0 Usescan(Element)Parses a subtree starting from the element e and reports SAX2 events to the specified handler.- Throws:
SAXException
-
parseWithContext
@Deprecated(since="2.0", forRemoval=true) public void parseWithContext(Element e, ContentHandler handler) throws SAXException Deprecated, for removal: This API element is subject to removal in a future version.in JAXB 2.0 Usescan(Element)Similar to the parse method but it visits the ancestor nodes and properly emulate the all in-scope namespace declarations.- Throws:
SAXException
-
visit
Visits an element and its subtree.- Throws:
SAXException
-
getCurrentLocation
The same asgetCurrentElement()but better typed. -
getCurrentElement
Description copied from interface:InfosetScannerGets 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.
- Specified by:
getCurrentElementin interfaceInfosetScanner<Node>- Returns:
- never return null.
-
getLocator
- Specified by:
getLocatorin interfaceInfosetScanner<Node>
-
setContentHandler
Description copied from interface:InfosetScannerSets theContentHandler. This handler receives the SAX events.- Specified by:
setContentHandlerin interfaceInfosetScanner<Node>
-
getContentHandler
- Specified by:
getContentHandlerin interfaceInfosetScanner<Node>
-
getPublicId
- Specified by:
getPublicIdin interfaceLocator
-
getSystemId
- Specified by:
getSystemIdin interfaceLocator
-
getLineNumber
public int getLineNumber()- Specified by:
getLineNumberin interfaceLocator
-
getColumnNumber
public int getColumnNumber()- Specified by:
getColumnNumberin interfaceLocator
-
getLocation
Description copied from interface:LocatorExGets the current location in aValidationEventLocatorobject.- Specified by:
getLocationin interfaceLocatorEx
-
scan(Element)