configuration.html

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

HTML
400
字号
<!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>Configuration (Geotools 2.3.x 2.3.2 API)</TITLE><META NAME="keywords" CONTENT="org.geotools.xml.Configuration interface"><META NAME="keywords" CONTENT="configureBindings()"><META NAME="keywords" CONTENT="configureContext()"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="Configuration (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/Configuration.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/ComplexBinding.html" title="interface in org.geotools.xml"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../org/geotools/xml/ElementInstance.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="Configuration.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 Configuration</H2><HR><DL><DT>public interface <B>Configuration</B></DL><P>Responsible for configuring a parser runtime environment. <p> Implementations have the following responsibilites: <ul>  <li>Configuration of bindings.  <li>Configuration of context used by bindings.  <li>Supplying specialized handlers for looking up schemas.  <li>Supplying specialized handlers for parsing schemas. </ul> </p> <h3>Binding Configuration</h3> <p>  In able for a particular binding to be found during a parse, the  configuration must first populate a container with said binding. A binding  is stored in as a key value pair. The key is the qualified name of the type '  being bound to. The value is the class of the binding. For instance, the  following configures a container with a binding for type <b>xs:string</b>  <pre>          <code>  void configureBindings( MutablePicoContainer container ) {      container.registerComponentImplementation(XS.STRING,XSStringBinding.class);  }          </code>  </pre>  Usually it is desirable to populate a container with a set of bindings from  a specific schema. For instance, the following configuration populates the  binding container with all the bindings for types defined in XML schema  itself.  <pre>          <code>  void configureBindings(MutablePicoContainer container) {           new XSBindingConfiguration().configure(container);  }          </code>  </pre>  Instances of type <A HREF="../../../org/geotools/xml/BindingConfiguration.html" title="interface in org.geotools.xml"><CODE>BindingConfiguration</CODE></A> are used to  populate a container with all the bindings from a particular schema. </p> <h3>Context Configuration</h3> <p> Many bindings have dependencies on other types of objects. The pattern used to satisfy these dependencies is known as <b>Constructor Injection</b>. Which means that any dependencies a binding has is passed to it in its constructor. For instance, the following binding has a dependency on java.util.List. <pre>         <code> class MyBinding implements SimpleBinding {                List list;                 public MyBinding(List list) {                         this.list = list;                 } }         </code> </pre> Before a binding can be created, the container in which it is housed in must be able to satisfy all of its dependencies. It is the responsibility of the configuration to statisfy this criteria. This is known as configuring the binding context. The following is a suitable configuration for the above binding. <pre>         <code> class MyConfiguration implements Configuration {                void configureContext(MutablePicoContainer container) {                        container.registerComponentImplementation(ArrayList.class);                } }         </code> </pre>  <h3>Schema Resolution</h3> <p> XML instance documents often contain schema uri references that are invalid  with respect to the parser, or non-existant. A configuration can supply  specialized look up classes to prevent the parser from following an  invalid uri and prevent any errors that may occur as a result.  </p> <p> An instance of <CODE>XSDSchemaLocationResolver</CODE> can be used to override a schemaLocation referencing another schema. This can be useful  when the entity parsing an instance document stores schemas in a location  unkown to the entity providing hte instance document. </p>  <p> An instance of <CODE>XSDSchemaLocator</CODE> can be used  to provide an pre-parsed schema and prevent the parser from parsing a  schemaLocation manually. This can be useful when an instance document does  not supply a schemaLocation for the targetNamespace of the document. <pre>         <code> class MyConfiguration implements Configuration {                void configureContext(MutablePicoContainer container) {                		  container.registerComponentImplemnetation(MySchemaLocationResolver.class);                        container.registerComponentImplementation(MySchemaLocator.class);                } }         </code> </pre> </p> <p> The XSDSchemaLocator and XSDSchemeLocationResolver implementations are used in a couple of scenarios. The first is when the <b>schemaLocation</b> attribute of the root element of the instance document is being parsed. The schemaLocation attribute has the form: <pre> <code>         schemaLocation="namespace location namespace location ..." </code> </pre> In which (namespace,location) tuples are listed. For each each namespace encountered when parsing the schemaLocation attribute, an appropriate resolver / locator is looked up. If an override is not aviable, the framework attempts to resolve the location part of the tuple into a schema. The second scenario occurs when the parsing of a schema encounters an <b>import</b> or an <b>include<b> element. These elements have the form:  <pre>  <code>      &lt;import namespace="" schemaLocation=""/&gt;        </code>  </pre>  and:  <pre>  <code>      &lt;include schemaLocation=""&gt;  </code>        </pre>        respectivley. Similar to above, the schemaLocation (and namespace in the        case of an import) are used to find an override. If not found they are        resolved directly. </p><P><P><DL><DT><B>Author:</B></DT>  <DD>Justin Deoliveira,Refractions Research Inc.,jdeolive@refractions.net</DD><DT><B>See Also:</B><DD><A HREF="../../../org/geotools/xml/BindingConfiguration.html" title="interface in org.geotools.xml"><CODE>BindingConfiguration</CODE></A></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/Configuration.html#configureBindings(org.picocontainer.MutablePicoContainer)">configureBindings</A></B>(MutablePicoContainer&nbsp;container)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configures a container which houses all the bindings used during a parse.</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/Configuration.html#configureContext(org.picocontainer.MutablePicoContainer)">configureContext</A></B>(MutablePicoContainer&nbsp;container)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configures the root context to be used when parsing elements.</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="configureBindings(org.picocontainer.MutablePicoContainer)"><!-- --></A><H3>configureBindings</H3><PRE>public void <B>configureBindings</B>(MutablePicoContainer&nbsp;container)</PRE><DL><DD>Configures a container which houses all the bindings used during a parse.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>container</CODE> - The container housing the binding objects.</DL></DD></DL><HR><A NAME="configureContext(org.picocontainer.MutablePicoContainer)"><!-- --></A><H3>configureContext</H3><PRE>public void <B>configureContext</B>(MutablePicoContainer&nbsp;container)</PRE><DL><DD>Configures the root context to be used when parsing elements.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>container</CODE> - The container representing the context.</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/Configuration.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/ComplexBinding.html" title="interface in org.geotools.xml"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../org/geotools/xml/ElementInstance.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="Configuration.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 + -
显示快捷键?