unmarshaller.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 1,146 行 · 第 1/5 页
HTML
1,146 行
content tree. <p> Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>url</CODE> - the url to unmarshal XML data from<DT><B>Returns:</B><DD>the newly created root object of the java content tree<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></CODE> - If any unexpected errors occur while unmarshalling<DD><CODE><A HREF="../../../javax/xml/bind/UnmarshalException.html" title="class in javax.xml.bind">UnmarshalException</A></CODE> - If the <A HREF="../../../javax/xml/bind/ValidationEventHandler.html" title="interface in javax.xml.bind"><CODE>ValidationEventHandler</CODE></A> returns false from its <tt>handleEvent</tt> method or the <tt>Unmarshaller</tt> is unable to perform the XML to Java binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - If the URL parameter is null</DL></DD></DL><HR><A NAME="unmarshal(org.xml.sax.InputSource)"><!-- --></A><H3>unmarshal</H3><PRE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>unmarshal</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/org/xml/sax/InputSource.html" title="class or interface in org.xml.sax">InputSource</A> source) throws <A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD>Unmarshal XML data from the specified SAX InputSource and return the resulting content tree. <p> Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>source</CODE> - the input source to unmarshal XML data from<DT><B>Returns:</B><DD>the newly created root object of the java content tree<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></CODE> - If any unexpected errors occur while unmarshalling<DD><CODE><A HREF="../../../javax/xml/bind/UnmarshalException.html" title="class in javax.xml.bind">UnmarshalException</A></CODE> - If the <A HREF="../../../javax/xml/bind/ValidationEventHandler.html" title="interface in javax.xml.bind"><CODE>ValidationEventHandler</CODE></A> returns false from its <tt>handleEvent</tt> method or the <tt>Unmarshaller</tt> is unable to perform the XML to Java binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - If the InputSource parameter is null</DL></DD></DL><HR><A NAME="unmarshal(org.w3c.dom.Node)"><!-- --></A><H3>unmarshal</H3><PRE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>unmarshal</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/org/w3c/dom/Node.html" title="class or interface in org.w3c.dom">Node</A> node) throws <A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD>Unmarshal global XML data from the specified DOM tree and return the resulting content tree. <p> Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>node</CODE> - the document/element to unmarshal XML data from. The caller must support at least Document and Element.<DT><B>Returns:</B><DD>the newly created root object of the java content tree<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></CODE> - If any unexpected errors occur while unmarshalling<DD><CODE><A HREF="../../../javax/xml/bind/UnmarshalException.html" title="class in javax.xml.bind">UnmarshalException</A></CODE> - If the <A HREF="../../../javax/xml/bind/ValidationEventHandler.html" title="interface in javax.xml.bind"><CODE>ValidationEventHandler</CODE></A> returns false from its <tt>handleEvent</tt> method or the <tt>Unmarshaller</tt> is unable to perform the XML to Java binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - If the Node parameter is null<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/bind/Unmarshaller.html#unmarshal(org.w3c.dom.Node, java.lang.Class)"><CODE>unmarshal(org.w3c.dom.Node, Class)</CODE></A></DL></DD></DL><HR><A NAME="unmarshal(org.w3c.dom.Node, java.lang.Class)"><!-- --></A><H3>unmarshal</H3><PRE><T> <A HREF="../../../javax/xml/bind/JAXBElement.html" title="class in javax.xml.bind">JAXBElement</A><T> <B>unmarshal</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/org/w3c/dom/Node.html" title="class or interface in org.w3c.dom">Node</A> node, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A><T> declaredType) throws <A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD>Unmarshal XML data by JAXB mapped <tt>declaredType</tt> and return the resulting content tree. <p> Implements <a href="#unmarshalByDeclaredType">Unmarshal by Declared Type</a><P><DD><DL><DT><B>Parameters:</B><DD><CODE>node</CODE> - the document/element to unmarshal XML data from. The caller must support at least Document and Element.<DD><CODE>declaredType</CODE> - appropriate JAXB mapped class to hold <tt>node</tt>'s XML data.<DT><B>Returns:</B><DD><a href="#unmarshalDeclaredTypeReturn">JAXB Element</a> representation of <tt>node</tt><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></CODE> - If any unexpected errors occur while unmarshalling<DD><CODE><A HREF="../../../javax/xml/bind/UnmarshalException.html" title="class in javax.xml.bind">UnmarshalException</A></CODE> - If the <A HREF="../../../javax/xml/bind/ValidationEventHandler.html" title="interface in javax.xml.bind"><CODE>ValidationEventHandler</CODE></A> returns false from its <tt>handleEvent</tt> method or the <tt>Unmarshaller</tt> is unable to perform the XML to Java binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - If any parameter is null<DT><B>Since:</B></DT> <DD>JAXB2.0</DD></DL></DD></DL><HR><A NAME="unmarshal(javax.xml.transform.Source)"><!-- --></A><H3>unmarshal</H3><PRE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>unmarshal</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/javax/xml/transform/Source.html" title="class or interface in javax.xml.transform">Source</A> source) throws <A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD>Unmarshal XML data from the specified XML Source and return the resulting content tree. <p> Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>. <p> <a name="saxParserPlugable"></a> <b>SAX 2.0 Parser Pluggability</b> <p> A client application can choose not to use the default parser mechanism supplied with their JAXB provider. Any SAX 2.0 compliant parser can be substituted for the JAXB provider's default mechanism. To do so, the client application must properly configure a <tt>SAXSource</tt> containing an <tt>XMLReader</tt> implemented by the SAX 2.0 parser provider. If the <tt>XMLReader</tt> has an <tt>org.xml.sax.ErrorHandler</tt> registered on it, it will be replaced by the JAXB Provider so that validation errors can be reported via the <tt>ValidationEventHandler</tt> mechanism of JAXB. If the <tt>SAXSource</tt> does not contain an <tt>XMLReader</tt>, then the JAXB provider's default parser mechanism will be used. <p> This parser replacement mechanism can also be used to replace the JAXB provider's unmarshal-time validation engine. The client application must properly configure their SAX 2.0 compliant parser to perform validation (as shown in the example above). Any <tt>SAXParserExceptions </tt> encountered by the parser during the unmarshal operation will be processed by the JAXB provider and converted into JAXB <tt>ValidationEvent</tt> objects which will be reported back to the client via the <tt>ValidationEventHandler</tt> registered with the <tt>Unmarshaller</tt>. <i>Note:</i> specifying a substitute validating SAX 2.0 parser for unmarshalling does not necessarily replace the validation engine used by the JAXB provider for performing on-demand validation. <p> The only way for a client application to specify an alternate parser mechanism to be used during unmarshal is via the <tt>unmarshal(SAXSource)</tt> API. All other forms of the unmarshal method (File, URL, Node, etc) will use the JAXB provider's default parser and validator mechanisms.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>source</CODE> - the XML Source to unmarshal XML data from (providers are only required to support SAXSource, DOMSource, and StreamSource)<DT><B>Returns:</B><DD>the newly created root object of the java content tree<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></CODE> - If any unexpected errors occur while unmarshalling<DD><CODE><A HREF="../../../javax/xml/bind/UnmarshalException.html" title="class in javax.xml.bind">UnmarshalException</A></CODE> - If the <A HREF="../../../javax/xml/bind/ValidationEventHandler.html" title="interface in javax.xml.bind"><CODE>ValidationEventHandler</CODE></A> returns false from its <tt>handleEvent</tt> method or the <tt>Unmarshaller</tt> is unable to perform the XML to Java binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - If the Source parameter is null<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/bind/Unmarshaller.html#unmarshal(javax.xml.transform.Source, java.lang.Class)"><CODE>unmarshal(javax.xml.transform.Source, Class)</CODE></A></DL></DD></DL><HR><A NAME="unmarshal(javax.xml.transform.Source, java.lang.Class)"><!-- --></A><H3>unmarshal</H3><PRE><T> <A HREF="../../../javax/xml/bind/JAXBElement.html" title="class in javax.xml.bind">JAXBElement</A><T> <B>unmarshal</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/javax/xml/transform/Source.html" title="class or interface in javax.xml.transform">Source</A> source, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A><T> declaredType) throws <A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD>Unmarshal XML data from the specified XML Source by <tt>declaredType</tt> and return the resulting content tree. <p> Implements <a href="#unmarshalByDeclaredType">Unmarshal by Declared Type</a> <p> See <a href="#saxParserPlugable">SAX 2.0 Parser Pluggability</a><P><DD><DL><DT><B>Parameters:</B><DD><CODE>source</CODE> - the XML Source to unmarshal XML data from (providers are only required to support SAXSource, DOMSource, and StreamSource)<DD><CODE>declaredType</CODE> - appropriate JAXB mapped class to hold <tt>source</tt>'s xml root element<DT><B>Returns:</B><DD>Java content rooted by <a href="#unmarshalDeclaredTypeReturn">JAXB Element</a><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></CODE> - If any unexpected errors occur while unmarshalling<DD><CODE><A HREF="../../../javax/xml/bind/UnmarshalException.html" title="class in javax.xml.bind">UnmarshalException</A></CODE> - If the <A HREF="../../../javax/xml/bind/ValidationEventHandler.html" title="interface in javax.xml.bind"><CODE>ValidationEventHandler</CODE></A> returns false from its <tt>handleEvent</tt> method or the <tt>Unmarshaller</tt> is unable to perform the XML to Java binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - If any parameter is null<DT><B>Since:</B></DT> <DD>JAXB2.0</DD></DL></DD></DL><HR><A NAME="unmarshal(javax.xml.stream.XMLStreamReader)"><!-- --></A><H3>unmarshal</H3><PRE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>unmarshal</B>(<A HREF="../../../javax/xml/stream/XMLStreamReader.html" title="interface in javax.xml.stream">XMLStreamReader</A> reader) throws <A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD>Unmarshal XML data from the specified pull parser and return the resulting content tree. <p> Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>. <p> This method assumes that the parser is on a START_DOCUMENT or START_ELEMENT event. Unmarshalling will be done from this start event to the corresponding end event. If this method returns successfully, the <tt>reader</tt> will be pointing at the token right after the end event.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>reader</CODE> - The parser to be read.<DT><B>Returns:</B><DD>the newly created root object of the java content tree.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></CODE> - If any unexpected errors occur while unmarshalling<DD><CODE><A HREF="../../../javax/xml/bind/UnmarshalException.html" title="class in javax.xml.bind">UnmarshalException</A></CODE> - If the <A HREF="../../../javax/xml/bind/ValidationEventHandler.html" title="interface in javax.xml.bind"><CODE>ValidationEventHandler</CODE></A> returns false from its <tt>handleEvent</tt> method or the <tt>Unmarshaller</tt> is unable to perform the XML to Java binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - If the <tt>reader</tt> parameter is null<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalStateException.html" title="class or inter
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?