bindingconfiguration.html

来自「Geotools是一个开源的Java GIS工具包,可利用它来开发符合标准的地理」· HTML 代码 · 共 332 行

HTML
332
字号
<!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.4.2_13) on Tue Jun 05 11:36:30 GMT-05:00 2007 --><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><TITLE>BindingConfiguration (Geotools 2.3.x 2.3.2 API)</TITLE><META NAME="keywords" CONTENT="org.geotools.xml.BindingConfiguration interface"><META NAME="keywords" CONTENT="configure()"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="BindingConfiguration (Geotools 2.3.x 2.3.2 API)";}</SCRIPT></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=3 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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/BindingConfiguration.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../org/geotools/xml/Binding.html" title="interface in org.geotools.xml"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../org/geotools/xml/ComplexBinding.html" title="interface in org.geotools.xml"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="BindingConfiguration.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<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">org.geotools.xml</FONT><BR>Interface BindingConfiguration</H2><DL><DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../org/geotools/gml2/bindings/GMLBindingConfiguration.html" title="class in org.geotools.gml2.bindings">GMLBindingConfiguration</A>, <A HREF="../../../org/geotools/gml3/bindings/GMLBindingConfiguration.html" title="class in org.geotools.gml3.bindings">GMLBindingConfiguration</A>, <A HREF="../../../org/geotools/filter/v1_0/OGCBindingConfiguration.html" title="class in org.geotools.filter.v1_0">OGCBindingConfiguration</A>, <A HREF="../../../org/geotools/filter/v1_1/OGCBindingConfiguration.html" title="class in org.geotools.filter.v1_1">OGCBindingConfiguration</A>, <A HREF="../../../org/geotools/gml3/bindings/smil/SMIL20BindingConfiguration.html" title="class in org.geotools.gml3.bindings.smil">SMIL20BindingConfiguration</A>, <A HREF="../../../org/geotools/gml3/bindings/smil/SMIL20LANGBindingConfiguration.html" title="class in org.geotools.gml3.bindings.smil">SMIL20LANGBindingConfiguration</A>, <A HREF="../../../org/geotools/xlink/bindings/XLINKBindingConfiguration.html" title="class in org.geotools.xlink.bindings">XLINKBindingConfiguration</A>, <A HREF="../../../org/geotools/xs/bindings/XSBindingConfiguration.html" title="class in org.geotools.xs.bindings">XSBindingConfiguration</A></DD></DL><HR><DL><DT>public interface <B>BindingConfiguration</B></DL><P>Resonsible for loading bindings into a container. <p> Strategy objects live inside a pico container. This provides the strategy with the following:  <ul>          <li>Life cycle          <li>Dependency management  </ul> </p> <p>         <h3>Life Cycle</h3> Strategy components that require notification of life cycle events must implement the <CODE>Startable</CODE>, and <CODE>Disposable</CODE> interfaces. </p> <p>         <h3>Dependencies</h3> Pico Container uses a design pattern known as <b>Inversion of Control (IoC)</b>.This pattern is very useful when the implementation of a particular dependency can vary. For a detailed description, see <a href=http://www.picocontainer.org/Inversion+of+Control>  Inversion of Control</a> pattern. </p> <p> To achieve IoC, Pico Container uses a mechanism known as <b>Contstructor Injection</b>. In this scheme, a particular component specifies all of its dependencies in its constructor. The container will ensure that the dependencies are satisfied when the component is instantiated. For an more detailed explanation, see <a href=http://www.martinfowler.com/articles/injection.html#ConstructorInjectionWithPicocontainer> Constructor Injection</a>. </p> <p> So how does the container know which implementation to supply to the component when it is instantiated? An implementation of the dependency must be registered with the container before the component is instantiated. This is usually done at parser configuration time. See <A HREF="../../../org/geotools/xml/Configuration.html" title="interface in org.geotools.xml"><CODE>for more details</CODE></A>. Consider the following strategy. <pre>         <code>         class MyStrategy implements SimpleStrategy {                 List list;                 public MyStrategy(List list) {                         this.list = list;                 }                 public Object parse(InstanceComponent instance, Object value)                         throws Exception {                         list.add(value);                         return list;                 }         }         </code> </pre> In the above example, our component depends on an object of type List. Since List itself is abstract, at some point an actual concrete implementation of List must be passed into the constructor of MyStrategy. Consider the following strategy configuration. <pre>         <code>         class MyStrategyConfiguration implements StrategyConfiguration {                 public void configure(MutablePicoContainer container) {                         //first register a concrete implemtnation of list                         container.registerComponentImplementation(LinkedList.class);                         //register the actual component                         QName qName = new QName("http://geotools/org/", "my");                         container.registerComponentImplementation(qName,MyStrategy.class);                 }         }         </code> </pre> With the above container configuration, the concrete type of List will be LinkedList. </p><P><P><DL><DT><B>Author:</B></DT>  <DD>Justin Deoliveira,Refractions Research Inc.,jdeolive@refractions.net</DD></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/xml/BindingConfiguration.html#configure(org.picocontainer.MutablePicoContainer)">configure</A></B>(MutablePicoContainer&nbsp;container)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configures the container which houses the strategy objects. </TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="configure(org.picocontainer.MutablePicoContainer)"><!-- --></A><H3>configure</H3><PRE>public void <B>configure</B>(MutablePicoContainer&nbsp;container)</PRE><DL><DD>Configures the container which houses the strategy objects. <p>  A strategy object is looked up in the container by its qualified name.  The following code snippet illustrates how to register a strategy with  the container.  </p>  <pre>          <code>  void configure(MutablePicoContainer container) {          QName qName = FOO.BARTYPE;          Class impl = F00BarStrategy.class;          container.registerComponentImplementation(qName,impl);  }          </code>  </pre><P><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/BindingConfiguration.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../org/geotools/xml/Binding.html" title="interface in org.geotools.xml"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../org/geotools/xml/ComplexBinding.html" title="interface in org.geotools.xml"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="BindingConfiguration.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright &copy; 1996-2007 <a href="http://www.geotools.org">Geotools</a>. All Rights Reserved.</BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?