|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.bind.unmarshaller.DOMScanner
public class DOMScanner
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.sun.xml.bind.v2.runtime.unmarshaller.LocatorEx |
---|
LocatorEx.Snapshot |
Constructor Summary | |
---|---|
DOMScanner()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DOMScanner()
Method Detail |
---|
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |