XmlVisitor expects the event callbacks in the following order:
CALL SEQUENCE := startDocument ELEMENT endDocument
ELEMENT := startPrefixMapping ELEMENT endPrefixMapping
| startElement BODY endElement
BODY := text? (ELEMENT text?)*
Note in particular that text events may not be called in a row;
consecutive characters (even those separated by PIs and comments)
must be reported as one event, unlike SAX.
All namespace URIs, local names, and prefixes of element and attribute names must be interned. qnames need not be interned.
CharSequence implementations
that can be used as a parameter to the text(CharSequence) method.
For example, see Base64Data.
SAXException to abort the unmarshalling process
in the middle.
| Modifier and Type | Class and Description |
|---|---|
| public static interface |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public UnmarshallingContext | Returns: always return the same object, so caching the result is recommended.Returns the |
| public XmlVisitor. | getPredictor()
Gets the predictor that can be used for the caller to avoid
calling |
| public void | startDocument(LocatorEx
This live object returns the location information as the parsing progresses.
must not be null. locator, NamespaceContext Some broken XML APIs can't iterate all the in-scope namespace bindings,
which makes it impossible to emulate nsContext)startPrefixMapping(String, String) correctly
when unmarshalling a subtree. Connectors that use such an API can
pass in additional NamespaceContext object that knows about the
in-scope namespace bindings. Otherwise (and normally) it is null.
Ideally this object should be immutable and only represent the namespace URI bindings in the context (those done above the element that JAXB started unmarshalling), but it can also work even if it changes as the parsing progress (to include namespaces declared on the current element being parsed.) Notifies a start of the document. |
| public void | |
| public void | startPrefixMapping(String prefix, String nsUri)
Called before |
| public void | text(CharSequence
represents character data. This object can be mutable
(such as pcdata)StringBuilder); it only needs to be fixed
while this method is executing.Text events. |
| endDocument | back to summary |
|---|---|
| public void endDocument() throws SAXException | |
| endElement | back to summary |
|---|---|
| public void endElement(TagName tagName) throws SAXException | |
| endPrefixMapping | back to summary |
|---|---|
| public void endPrefixMapping(String prefix) throws SAXException Called after | |
| getContext | back to summary |
|---|---|
| public UnmarshallingContext getContext() Returns the
| |
| getPredictor | back to summary |
|---|---|
| public XmlVisitor. Gets the predictor that can be used for the caller to avoid
calling | |
| startDocument | back to summary |
|---|---|
| public void startDocument(LocatorEx locator, NamespaceContext nsContext) throws SAXException Notifies a start of the document.
| |
| startElement | back to summary |
|---|---|
| public void startElement(TagName tagName) throws SAXException Notifies a start tag of a new element. namespace URIs and local names must be interned. | |
| startPrefixMapping | back to summary |
|---|---|
| public void startPrefixMapping(String prefix, String nsUri) throws SAXException Called before | |
| text | back to summary |
|---|---|
| public void text(CharSequence pcdata) throws SAXException Text events.
The caller should consult
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean |
| expectText | back to summary |
|---|---|
| public boolean expectText() Returns true if the visitor is expecting a text event as the next event. This is primarily intended to be used for optimization to avoid buffering characters unnecessarily. If this method returns false and the connector sees whitespace it can safely skip it.
If this method returns true, all the whitespaces are considered significant
and thus need to be reported as a | |