abstractunmarshallerimpl.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 1,095 行 · 第 1/5 页
HTML
1,095 行
<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html#setEventHandler(javax.xml.bind.ValidationEventHandler)">setEventHandler</A></CODE> in interface <CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html" title="interface in javax.xml.bind">Unmarshaller</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>handler</CODE> - the validation event handler<DT><B>Throws:</B><DD><CODE><A HREF="../../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></CODE> - if an error was encountered while setting the event handler</DL></DD></DL><HR><A NAME="setValidating(boolean)"><!-- --></A><H3>setValidating</H3><PRE>public void <B>setValidating</B>(boolean validating) throws <A HREF="../../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD>Specifies whether or not the Unmarshaller should validate during unmarshal operations. By default, the <tt>Unmarshaller</tt> does not validate. <p> This method may only be invoked before or after calling one of the unmarshal methods.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html#setValidating(boolean)">setValidating</A></CODE> in interface <CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html" title="interface in javax.xml.bind">Unmarshaller</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>validating</CODE> - true if the Unmarshaller should validate during unmarshal, false otherwise<DT><B>Throws:</B><DD><CODE><A HREF="../../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></CODE> - if an error occurred while enabling or disabling validation at unmarshal time</DL></DD></DL><HR><A NAME="getEventHandler()"><!-- --></A><H3>getEventHandler</H3><PRE>public <A HREF="../../../../javax/xml/bind/ValidationEventHandler.html" title="interface in javax.xml.bind">ValidationEventHandler</A> <B>getEventHandler</B>() throws <A HREF="../../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD>Return the current event handler or the default event handler if one hasn't been set.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html#getEventHandler()">getEventHandler</A></CODE> in interface <CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html" title="interface in javax.xml.bind">Unmarshaller</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the current ValidationEventHandler or the default event handler if it hasn't been set<DT><B>Throws:</B><DD><CODE><A HREF="../../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></CODE> - if an error was encountered while getting the current event handler</DL></DD></DL><HR><A NAME="createUnmarshalException(org.xml.sax.SAXException)"><!-- --></A><H3>createUnmarshalException</H3><PRE>protected <A HREF="../../../../javax/xml/bind/UnmarshalException.html" title="class in javax.xml.bind">UnmarshalException</A> <B>createUnmarshalException</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/org/xml/sax/SAXException.html" title="class or interface in org.xml.sax">SAXException</A> e)</PRE><DL><DD>Creates an UnmarshalException from a SAXException. This is an utility method provided for the derived classes. <p> When a provider-implemented ContentHandler wants to throw a JAXBException, it needs to wrap the exception by a SAXException. If the unmarshaller implementation blindly wrap SAXException by JAXBException, such an exception will be a JAXBException wrapped by a SAXException wrapped by another JAXBException. This is silly. <p> This method checks the nested exception of SAXException and reduce those excessive wrapping.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the resulting UnmarshalException</DL></DD></DL><HR><A NAME="setProperty(java.lang.String, java.lang.Object)"><!-- --></A><H3>setProperty</H3><PRE>public void <B>setProperty</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> value) throws <A HREF="../../../../javax/xml/bind/PropertyException.html" title="class in javax.xml.bind">PropertyException</A></PRE><DL><DD>Default implementation of the setProperty method always throws PropertyException since there are no required properties. If a provider needs to handle additional properties, it should override this method in a derived class.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html#setProperty(java.lang.String, java.lang.Object)">setProperty</A></CODE> in interface <CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html" title="interface in javax.xml.bind">Unmarshaller</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the property to be set. This value can either be specified using one of the constant fields or a user supplied string.<DD><CODE>value</CODE> - the value of the property to be set<DT><B>Throws:</B><DD><CODE><A HREF="../../../../javax/xml/bind/PropertyException.html" title="class in javax.xml.bind">PropertyException</A></CODE> - when there is an error processing the given property or value</DL></DD></DL><HR><A NAME="getProperty(java.lang.String)"><!-- --></A><H3>getProperty</H3><PRE>public <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>getProperty</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name) throws <A HREF="../../../../javax/xml/bind/PropertyException.html" title="class in javax.xml.bind">PropertyException</A></PRE><DL><DD>Default implementation of the getProperty method always throws PropertyException since there are no required properties. If a provider needs to handle additional properties, it should override this method in a derived class.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html#getProperty(java.lang.String)">getProperty</A></CODE> in interface <CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html" title="interface in javax.xml.bind">Unmarshaller</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the property to retrieve<DT><B>Returns:</B><DD>the value of the requested property<DT><B>Throws:</B><DD><CODE><A HREF="../../../../javax/xml/bind/PropertyException.html" title="class in javax.xml.bind">PropertyException</A></CODE> - when there is an error retrieving the given property or value property name</DL></DD></DL><HR><A NAME="unmarshal(javax.xml.stream.XMLEventReader)"><!-- --></A><H3>unmarshal</H3><PRE>public <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/XMLEventReader.html" title="interface in javax.xml.stream">XMLEventReader</A> reader) throws <A HREF="../../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html#unmarshal(javax.xml.stream.XMLEventReader)">Unmarshaller</A></CODE></B></DD><DD>Unmarshal XML data from the specified pull parser and return the resulting content tree. <p> This method is an <a href="#unmarshalGlobal">Unmarshal Global Root method</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>Specified by:</B><DD><CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html#unmarshal(javax.xml.stream.XMLEventReader)">unmarshal</A></CODE> in interface <CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html" title="interface in javax.xml.bind">Unmarshaller</A></CODE></DL></DD><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><DT><B>See Also:</B><DD><A HREF="../../../../javax/xml/bind/Unmarshaller.html#unmarshal(javax.xml.stream.XMLEventReader, java.lang.Class)"><CODE>Unmarshaller.unmarshal(javax.xml.stream.XMLEventReader, Class)</CODE></A></DL></DD></DL><HR><A NAME="unmarshal(javax.xml.stream.XMLStreamReader)"><!-- --></A><H3>unmarshal</H3><PRE>public <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><B>Description copied from interface: <CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html#unmarshal(javax.xml.stream.XMLStreamReader)">Unmarshaller</A></CODE></B></DD><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>Specified by:</B><DD><CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html#unmarshal(javax.xml.stream.XMLStreamReader)">unmarshal</A></CODE> in interface <CODE><A HREF="../../../../javax/xml/bind/Unmarshaller.html" title="interface in javax.xml.bind">Unmarshaller</A></CODE></DL></DD><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><DT><B>See Also:</B><DD><A HREF="../../../../javax/xml/bind/Unmarshaller.html#unmarshal(javax.xml.stream.XMLStreamReader, java.lang.Class)"><CODE>Unmarshaller.unmarshal(javax.xml.stream.XMLStreamReader, Class)</CODE></A></DL></DD></DL><HR><A NAME="unmarshal(org.w3c.dom.Node, java.lang.Class)"><!-- --></A><H3>unmarshal</H3><PRE>public <T> <A HREF="../../../..
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?