marshaller.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 1,114 行 · 第 1/5 页
HTML
1,114 行
<TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/bind/Marshaller.html#setSchema(javax.xml.validation.Schema)">setSchema</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/javax/xml/validation/Schema.html" title="class or interface in javax.xml.validation">Schema</A> schema)</CODE><BR> Specify the JAXP 1.3 <A HREF="http://java.sun.com/j2se/1.5/docs/api/javax/xml/validation/Schema.html" title="class or interface in javax.xml.validation"><CODE>Schema</CODE></A> object that should be used to validate subsequent marshal operations against.</TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Field Detail</B></FONT></TH></TR></TABLE><A NAME="JAXB_ENCODING"><!-- --></A><H3>JAXB_ENCODING</H3><PRE>static final <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>JAXB_ENCODING</B></PRE><DL><DD>The name of the property used to specify the output encoding in the marshalled XML data.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.xml.bind.Marshaller.JAXB_ENCODING">Constant Field Values</A></DL></DL><HR><A NAME="JAXB_FORMATTED_OUTPUT"><!-- --></A><H3>JAXB_FORMATTED_OUTPUT</H3><PRE>static final <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>JAXB_FORMATTED_OUTPUT</B></PRE><DL><DD>The name of the property used to specify whether or not the marshalled XML data is formatted with linefeeds and indentation.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT">Constant Field Values</A></DL></DL><HR><A NAME="JAXB_SCHEMA_LOCATION"><!-- --></A><H3>JAXB_SCHEMA_LOCATION</H3><PRE>static final <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>JAXB_SCHEMA_LOCATION</B></PRE><DL><DD>The name of the property used to specify the xsi:schemaLocation attribute value to place in the marshalled XML output.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.xml.bind.Marshaller.JAXB_SCHEMA_LOCATION">Constant Field Values</A></DL></DL><HR><A NAME="JAXB_NO_NAMESPACE_SCHEMA_LOCATION"><!-- --></A><H3>JAXB_NO_NAMESPACE_SCHEMA_LOCATION</H3><PRE>static final <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>JAXB_NO_NAMESPACE_SCHEMA_LOCATION</B></PRE><DL><DD>The name of the property used to specify the xsi:noNamespaceSchemaLocation attribute value to place in the marshalled XML output.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.xml.bind.Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION">Constant Field Values</A></DL></DL><HR><A NAME="JAXB_FRAGMENT"><!-- --></A><H3>JAXB_FRAGMENT</H3><PRE>static final <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>JAXB_FRAGMENT</B></PRE><DL><DD>The name of the property used to specify whether or not the marshaller will generate document level events (ie calling startDocument or endDocument).<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.xml.bind.Marshaller.JAXB_FRAGMENT">Constant Field Values</A></DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="marshal(java.lang.Object, javax.xml.transform.Result)"><!-- --></A><H3>marshal</H3><PRE>void <B>marshal</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> jaxbElement, <A HREF="http://java.sun.com/j2se/1.5/docs/api/javax/xml/transform/Result.html" title="class or interface in javax.xml.transform">Result</A> result) throws <A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD>Marshal the content tree rooted at <tt>jaxbElement</tt> into the specified <tt>javax.xml.transform.Result</tt>. <p> All JAXB Providers must at least support <A HREF="http://java.sun.com/j2se/1.5/docs/api/javax/xml/transform/dom/DOMResult.html" title="class or interface in javax.xml.transform.dom"><CODE>DOMResult</CODE></A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/javax/xml/transform/sax/SAXResult.html" title="class or interface in javax.xml.transform.sax"><CODE>SAXResult</CODE></A>, and <A HREF="http://java.sun.com/j2se/1.5/docs/api/javax/xml/transform/stream/StreamResult.html" title="class or interface in javax.xml.transform.stream"><CODE>StreamResult</CODE></A>. It can support other derived classes of <tt>Result</tt> as well.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>jaxbElement</CODE> - The root of content tree to be marshalled.<DD><CODE>result</CODE> - XML will be sent to this Result<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 problem occurs during the marshalling.<DD><CODE><A HREF="../../../javax/xml/bind/MarshalException.html" title="class in javax.xml.bind">MarshalException</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>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any object reachable from <tt>obj</tt>). See <a href="#elementMarshalling"> Marshalling a JAXB element</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 of the method parameters are null</DL></DD></DL><HR><A NAME="marshal(java.lang.Object, java.io.OutputStream)"><!-- --></A><H3>marshal</H3><PRE>void <B>marshal</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> jaxbElement, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/OutputStream.html" title="class or interface in java.io">OutputStream</A> os) throws <A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD>Marshal the content tree rooted at <tt>jaxbElement</tt> into an output stream.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>jaxbElement</CODE> - The root of content tree to be marshalled.<DD><CODE>os</CODE> - XML will be added to this stream.<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 problem occurs during the marshalling.<DD><CODE><A HREF="../../../javax/xml/bind/MarshalException.html" title="class in javax.xml.bind">MarshalException</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>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any object reachable from <tt>obj</tt>). See <a href="#elementMarshalling"> Marshalling a JAXB element</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 of the method parameters are null</DL></DD></DL><HR><A NAME="marshal(java.lang.Object, java.io.Writer)"><!-- --></A><H3>marshal</H3><PRE>void <B>marshal</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> jaxbElement, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/Writer.html" title="class or interface in java.io">Writer</A> writer) throws <A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD>Marshal the content tree rooted at <tt>jaxbElement</tt> into a Writer.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>jaxbElement</CODE> - The root of content tree to be marshalled.<DD><CODE>writer</CODE> - XML will be sent to this writer.<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 problem occurs during the marshalling.<DD><CODE><A HREF="../../../javax/xml/bind/MarshalException.html" title="class in javax.xml.bind">MarshalException</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>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any object reachable from <tt>obj</tt>). See <a href="#elementMarshalling"> Marshalling a JAXB element</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 of the method parameters are null</DL></DD></DL><HR><A NAME="marshal(java.lang.Object, org.xml.sax.ContentHandler)"><!-- --></A><H3>marshal</H3><PRE>void <B>marshal</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> jaxbElement, <A HREF="http://java.sun.com/j2se/1.5/docs/api/org/xml/sax/ContentHandler.html" title="class or interface in org.xml.sax">ContentHandler</A> handler) throws <A HREF="../../../javax/xml/bind/JAXBException.html" title="class in javax.xml.bind">JAXBException</A></PRE><DL><DD>Marshal the content tree rooted at <tt>jaxbElement</tt> into SAX2 events.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>jaxbElement</CODE> - The root of content tree to be marshalled.<DD><CODE>handler</CODE> - XML will be sent to this handler as SAX2 events.<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 problem occurs during the marshalling.<DD><CODE><A HREF="../../../javax/xml/bind/MarshalException.html" title="class in javax.xml.bind">MarshalException</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>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any object reachable from <tt>obj</tt>). See <a href="#elementMarshalling"> Marshalling a JAXB element</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 of the method parameters are null</DL></DD></DL><HR><A NAME="marshal(java.lang.Object, org.w3c.dom.Node)"><!-- --></A><H3>marshal</H3><PRE>void <B>marshal</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> jaxbElement, <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>Marshal the content tree rooted at <tt>jaxbElement</tt> into a DOM tree.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>jaxbElement</CODE> - The content tree to be marshalled.<DD><CODE>node</CODE> - DOM nodes will be added as children of this node. This parameter must be a Node that accepts children (<A HREF="http://java.sun.com/j2se/1.5/docs/api/org/w3c/dom/Document.html" title="class or interface in org.w3c.dom"><CODE>Document</CODE></A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/org/w3c/dom/DocumentFragment.html" title="class or interface in org.w3c.dom"><CODE>DocumentFragment</CODE></A>, or <A HREF="http://java.sun.com/j2se/1.5/docs/api/org/w3c/dom/Element.html" title="class or interface in org.w3c.dom"><CODE>Element</CODE></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 problem occurs during the marshalling.<DD><CODE><A HREF="../../../javax/xml/bind/MarshalException.html" title="class in javax.xml.bind">MarshalException</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>Marshaller</tt> is unable to marshal <tt>jaxbElement</tt> (or any object reachable from <tt>jaxbElement</tt>). See <a href="#elementMarshalling"> Marshalling a JAXB element</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 of the method parameters are null</DL></DD>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?