Package com.sun.xml.bind.unmarshaller
Class DOMScanner
java.lang.Object
com.sun.xml.bind.unmarshaller.DOMScanner
- All Implemented Interfaces:
InfosetScanner,LocatorEx,Locator
Visits a W3C DOM tree and generates SAX2 events from it.
This class is just intended to be used by AbstractUnmarshallerImpl.
The javax.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 com.sun.xml.bind.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.intjavax.xml.bind.ValidationEventLocatorGets the current location in aValidationEventLocatorobject.voidparse(Element e, ContentHandler handler) Deprecated.voidparseWithContext(Element e, ContentHandler handler) Deprecated.in JAXB 2.0 Usescan(Element)voidParses the given DOM-ish element/document and generates SAX events.voidvoidvoidsetContentHandler(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- 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.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.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- Returns:
- never return null.
-
getLocator
- Specified by:
getLocatorin interfaceInfosetScanner
-
setContentHandler
Description copied from interface:InfosetScannerSets theContentHandler. This handler receives the SAX events.- Specified by:
setContentHandlerin interfaceInfosetScanner
-
getContentHandler
- Specified by:
getContentHandlerin interfaceInfosetScanner
-
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
public javax.xml.bind.ValidationEventLocator getLocation()Description copied from interface:LocatorExGets the current location in aValidationEventLocatorobject.- Specified by:
getLocationin interfaceLocatorEx- Returns:
-
scan(Element)