binder.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 809 行 · 第 1/3 页
HTML
809 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_14) on Mon Jan 28 05:46:58 PST 2008 --><TITLE>Binder (Java EE 5)</TITLE><META NAME="keywords" CONTENT="javax.xml.bind.Binder class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="Binder (Java EE 5)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../javax/xml/bind/DatatypeConverter.html" title="class in javax.xml.bind"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/xml/bind/Binder.html" target="_top"><B>FRAMES</B></A> <A HREF="Binder.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.xml.bind</FONT><BR>Class Binder<XmlNode></H2><PRE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>javax.xml.bind.Binder<XmlNode></B></PRE><HR><DL><DT><PRE>public abstract class <B>Binder<XmlNode></B><DT>extends <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></DL></PRE><P>Enable synchronization between XML infoset nodes and JAXB objects representing same XML document. <p> An instance of this class maintains the association between XML nodes of an infoset preserving view and a JAXB representation of an XML document. Navigation between the two views is provided by the methods <A HREF="../../../javax/xml/bind/Binder.html#getXMLNode(java.lang.Object)"><CODE>getXMLNode(Object)</CODE></A> and <A HREF="../../../javax/xml/bind/Binder.html#getJAXBNode(XmlNode)"><CODE>getJAXBNode(Object)</CODE></A>. <p> Modifications can be made to either the infoset preserving view or the JAXB representation of the document while the other view remains unmodified. The binder is able to synchronize the changes made in the modified view back into the other view using the appropriate Binder update methods, <A HREF="../../../javax/xml/bind/Binder.html#updateXML(java.lang.Object, XmlNode)"><CODE>updateXML(Object, Object)</CODE></A> or <A HREF="../../../javax/xml/bind/Binder.html#updateJAXB(XmlNode)"><CODE>updateJAXB(Object)</CODE></A>. <p> A typical usage scenario is the following: <ul> <li>load XML document into an XML infoset representation</li> <li><A HREF="../../../javax/xml/bind/Binder.html#unmarshal(XmlNode)"><CODE>unmarshal(Object)</CODE></A> XML infoset view to JAXB view. (Note to conserve resources, it is possible to only unmarshal a subtree of the XML infoset view to the JAXB view.)</li> <li>application access/updates JAXB view of XML document.</li> <li><A HREF="../../../javax/xml/bind/Binder.html#updateXML(java.lang.Object)"><CODE>updateXML(Object)</CODE></A> synchronizes modifications to JAXB view back into the XML infoset view. Update operation preserves as much of original XML infoset as possible (i.e. comments, PI, ...)</li> </ul> <p> A Binder instance is created using the factory method <A HREF="../../../javax/xml/bind/JAXBContext.html#createBinder()"><CODE>JAXBContext.createBinder()</CODE></A> or <A HREF="../../../javax/xml/bind/JAXBContext.html#createBinder(java.lang.Class)"><CODE>JAXBContext.createBinder(Class)</CODE></A>. <p> The template parameter, <code>XmlNode</code>, is the root interface/class for the XML infoset preserving representation. A Binder implementation is required to minimally support an <code>XmlNode</code> value of <code>org.w3c.dom.Node.class</code>. A Binder implementation can support alternative XML infoset preserving representations.<P><P><DL><DT><B>Since:</B></DT> <DD>JAXB 2.0</DD><DT><B>Author:</B></DT> <DD>Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) Joseph Fialli</DD></DL><HR><P><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../javax/xml/bind/Binder.html#Binder()">Binder</A></B>()</CODE><BR> </TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="../../../javax/xml/bind/ValidationEventHandler.html" title="interface in javax.xml.bind">ValidationEventHandler</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/bind/Binder.html#getEventHandler()">getEventHandler</A></B>()</CODE><BR> Return the current event handler or the default event handler if one hasn't been set.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/bind/Binder.html#getJAXBNode(XmlNode)">getJAXBNode</A></B>(<A HREF="../../../javax/xml/bind/Binder.html" title="type parameter in Binder">XmlNode</A> xmlNode)</CODE><BR> Gets the JAXB object associated with the given XML element.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/bind/Binder.html#getProperty(java.lang.String)">getProperty</A></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)</CODE><BR> Get the particular property in the underlying implementation of <tt>Binder</tt>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <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></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/bind/Binder.html#getSchema()">getSchema</A></B>()</CODE><BR> Gets the last <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 (including null) set by the <A HREF="../../../javax/xml/bind/Binder.html#setSchema(javax.xml.validation.Schema)"><CODE>setSchema(Schema)</CODE></A> method.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="../../../javax/xml/bind/Binder.html" title="type parameter in Binder">XmlNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/bind/Binder.html#getXMLNode(java.lang.Object)">getXMLNode</A></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> jaxbObject)</CODE><BR> Gets the XML element associated with the given JAXB object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/bind/Binder.html#marshal(java.lang.Object, XmlNode)">marshal</A></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> jaxbObject, <A HREF="../../../javax/xml/bind/Binder.html" title="type parameter in Binder">XmlNode</A> xmlNode)</CODE><BR> Marshal a JAXB object tree to a new XML document.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/bind/Binder.html#setEventHandler(javax.xml.bind.ValidationEventHandler)">setEventHandler</A></B>(<A HREF="../../../javax/xml/bind/ValidationEventHandler.html" title="interface in javax.xml.bind">ValidationEventHandler</A> handler)</CODE><BR> Allow an application to register a <tt>ValidationEventHandler</tt>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/bind/Binder.html#setProperty(java.lang.String, java.lang.Object)">setProperty</A></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)</CODE><BR> Set the particular property in the underlying implementation of <tt>Binder</tt>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/bind/Binder.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> Specifies whether marshal, unmarshal and update methods performs validation on their XML content.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/bind/Binder.html#unmarshal(XmlNode)">unmarshal</A></B>(<A HREF="../../../javax/xml/bind/Binder.html" title="type parameter in Binder">XmlNode</A> xmlNode)</CODE><BR> Unmarshal XML infoset view to a JAXB object tree.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN="">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?