|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.xml.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller
final class ValidatingUnmarshaller
XmlVisitor decorator that validates the events by using JAXP validation API.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.sun.xml.bind.v2.runtime.unmarshaller.XmlVisitor |
|---|
XmlVisitor.TextPredictor |
| Constructor Summary | |
|---|---|
ValidatingUnmarshaller(javax.xml.validation.Schema schema,
XmlVisitor next)
Creates a new instance of ValidatingUnmarshaller. |
|
| Method Summary | |
|---|---|
void |
endDocument()
|
void |
endElement(TagName tagName)
|
void |
endPrefixMapping(java.lang.String prefix)
Called after XmlVisitor.endElement(com.sun.xml.bind.v2.runtime.unmarshaller.TagName) event to notify the end of a binding. |
boolean |
expectText()
Deprecated. |
UnmarshallingContext |
getContext()
Returns the UnmarshallingContext at the end of the chain. |
XmlVisitor.TextPredictor |
getPredictor()
Gets the predictor that can be used for the caller to avoid calling XmlVisitor.text(CharSequence) unnecessarily. |
void |
startDocument(LocatorEx locator,
javax.xml.namespace.NamespaceContext nsContext)
Notifies a start of the document. |
void |
startElement(TagName tagName)
Notifies a start tag of a new element. |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String nsUri)
Called before XmlVisitor.startElement(com.sun.xml.bind.v2.runtime.unmarshaller.TagName) event to notify a new namespace binding. |
void |
text(java.lang.CharSequence pcdata)
Text events. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ValidatingUnmarshaller(javax.xml.validation.Schema schema,
XmlVisitor next)
| Method Detail |
|---|
public void startDocument(LocatorEx locator,
javax.xml.namespace.NamespaceContext nsContext)
throws org.xml.sax.SAXException
XmlVisitor
startDocument in interface XmlVisitorlocator - This live object returns the location information as the parsing progresses.
must not be null.nsContext - Some broken XML APIs can't iterate all the in-scope namespace bindings,
which makes it impossible to emulate XmlVisitor.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.)
org.xml.sax.SAXException
public void endDocument()
throws org.xml.sax.SAXException
endDocument in interface XmlVisitororg.xml.sax.SAXException
public void startElement(TagName tagName)
throws org.xml.sax.SAXException
XmlVisitor
startElement in interface XmlVisitororg.xml.sax.SAXException
public void endElement(TagName tagName)
throws org.xml.sax.SAXException
endElement in interface XmlVisitororg.xml.sax.SAXException
public void startPrefixMapping(java.lang.String prefix,
java.lang.String nsUri)
throws org.xml.sax.SAXException
XmlVisitorXmlVisitor.startElement(com.sun.xml.bind.v2.runtime.unmarshaller.TagName) event to notify a new namespace binding.
startPrefixMapping in interface XmlVisitororg.xml.sax.SAXException
public void endPrefixMapping(java.lang.String prefix)
throws org.xml.sax.SAXException
XmlVisitorXmlVisitor.endElement(com.sun.xml.bind.v2.runtime.unmarshaller.TagName) event to notify the end of a binding.
endPrefixMapping in interface XmlVisitororg.xml.sax.SAXException
public void text(java.lang.CharSequence pcdata)
throws org.xml.sax.SAXException
XmlVisitor
The caller should consult XmlVisitor.TextPredictor to see
if the unmarshaller is expecting any PCDATA. If the above is returning
false, the caller is OK to skip any text in XML. The net effect is
that we can ignore whitespaces quickly.
text in interface XmlVisitorpcdata - represents character data. This object can be mutable
(such as StringBuilder); it only needs to be fixed
while this method is executing.
org.xml.sax.SAXExceptionpublic UnmarshallingContext getContext()
XmlVisitorUnmarshallingContext at the end of the chain.
getContext in interface XmlVisitorpublic XmlVisitor.TextPredictor getPredictor()
XmlVisitorXmlVisitor.text(CharSequence) unnecessarily.
getPredictor in interface XmlVisitor@Deprecated public boolean expectText()
XmlVisitor.TextPredictorThis 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 XmlVisitor.text(java.lang.CharSequence) event. Furthermore,
if the element has no children (like <foo/>), then it has to be reported
an empty XmlVisitor.text(java.lang.CharSequence) event.
expectText in interface XmlVisitor.TextPredictor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||