public class DOMScanner extends Object implements LocatorEx, InfosetScanner
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.
LocatorEx.Snapshot
Constructor and Description |
---|
DOMScanner() |
Modifier and Type | Method and Description |
---|---|
int |
getColumnNumber() |
ContentHandler |
getContentHandler() |
Object |
getCurrentElement()
Gets the current element we are parsing.
|
Node |
getCurrentLocation()
The same as
getCurrentElement() but
better typed. |
int |
getLineNumber() |
ValidationEventLocator |
getLocation()
Gets the current location in a
ValidationEventLocator object. |
LocatorEx |
getLocator() |
String |
getPublicId() |
String |
getSystemId() |
void |
parse(Element e,
ContentHandler handler)
Deprecated.
in JAXB 2.0
Use
scan(Element) |
void |
parseWithContext(Element e,
ContentHandler handler)
Deprecated.
in JAXB 2.0
Use
scan(Element) |
void |
scan(Document doc) |
void |
scan(Element e) |
void |
scan(Object node)
Parses the given DOM-ish element/document and generates
SAX events.
|
void |
setContentHandler(ContentHandler handler)
Sets the
ContentHandler . |
void |
setLocator(Locator loc)
Configures the locator object that the SAX
ContentHandler will see. |
void |
visit(Element e)
Visits an element and its subtree.
|
public void setLocator(Locator loc)
ContentHandler
will see.public void scan(Object node) throws SAXException
InfosetScanner
scan
in interface InfosetScanner
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.)public void scan(Document doc) throws SAXException
SAXException
public void scan(Element e) throws SAXException
SAXException
public void parse(Element e, ContentHandler handler) throws SAXException
scan(Element)
SAXException
public void parseWithContext(Element e, ContentHandler handler) throws SAXException
scan(Element)
SAXException
public void visit(Element e) throws SAXException
SAXException
public Node getCurrentLocation()
getCurrentElement()
but
better typed.public Object getCurrentElement()
InfosetScanner
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.
getCurrentElement
in interface InfosetScanner
public LocatorEx getLocator()
getLocator
in interface InfosetScanner
public void setContentHandler(ContentHandler handler)
InfosetScanner
ContentHandler
.
This handler receives the SAX events.setContentHandler
in interface InfosetScanner
public ContentHandler getContentHandler()
getContentHandler
in interface InfosetScanner
public String getPublicId()
getPublicId
in interface Locator
public String getSystemId()
getSystemId
in interface Locator
public int getLineNumber()
getLineNumber
in interface Locator
public int getColumnNumber()
getColumnNumber
in interface Locator
public ValidationEventLocator getLocation()
LocatorEx
ValidationEventLocator
object.getLocation
in interface LocatorEx
Copyright © 2017 JBoss by Red Hat. All rights reserved.