📄 factoryregistry.html
字号:
throws <A HREF="../../../org/geotools/factory/FactoryRegistryException.html" title="class in org.geotools.factory">FactoryRegistryException</A></PRE><DL><DD>Returns the first provider in the registry for the specified category, using the specified map of hints (if any). This method may <A HREF="../../../org/geotools/factory/FactoryRegistry.html#scanForPlugins()">scan for plugins</A> the first time it is invoked. Except as a result of this scan, no new provider instance is created by the default implementation of this method. The <A HREF="../../../org/geotools/factory/FactoryCreator.html" title="class in org.geotools.factory"><CODE>FactoryCreator</CODE></A> class change this behavior however.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>category</CODE> - The category to look for. Must be one of the categories declared to the constructor. Usually an interface class (not the actual implementation class).<DD><CODE>filter</CODE> - An optional filter, or if none. This is used for example in order to select the first factory for some authority.<DD><CODE>hints</CODE> - A <A HREF="../../../org/geotools/factory/Hints.html" title="class in org.geotools.factory">map of hints</A>, or if none.<DD><CODE>key</CODE> - The key to use for looking for a user-provided instance in the hints, or if none.<DT><B>Returns:</B><DD>A factory <A HREF="../../../org/geotools/factory/OptionalFactory.html#isAvailable()">available</A> for use for the specified category and hints. The returns type is instead of <A HREF="../../../org/geotools/factory/Factory.html" title="interface in org.geotools.factory"><CODE>Factory</CODE></A> because the factory implementation doesn't need to be a Geotools one.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/geotools/factory/FactoryNotFoundException.html" title="class in org.geotools.factory">FactoryNotFoundException</A></CODE> - if no factory was found for the specified category, filter and hints.<DD><CODE><A HREF="../../../org/geotools/factory/FactoryRegistryException.html" title="class in org.geotools.factory">FactoryRegistryException</A></CODE> - if a factory can't be returned for some other reason.<DT><B>See Also:</B><DD><A HREF="../../../org/geotools/factory/FactoryRegistry.html#getServiceProviders(java.lang.Class)"><CODE>getServiceProviders(java.lang.Class)</CODE></A>, <A HREF="../../../org/geotools/factory/FactoryCreator.html#getServiceProvider(java.lang.Class, javax.imageio.spi.ServiceRegistry.Filter, org.geotools.factory.Hints, org.geotools.factory.Hints.Key)"><CODE>FactoryCreator.getServiceProvider(java.lang.Class, javax.imageio.spi.ServiceRegistry.Filter, org.geotools.factory.Hints, org.geotools.factory.Hints.Key)</CODE></A></DL></DD></DL><HR><A NAME="isAcceptable(java.lang.Object, java.lang.Class, org.geotools.factory.Hints)"><!-- --></A><H3>isAcceptable</H3><PRE>protected boolean <B>isAcceptable</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> provider, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> category, <A HREF="../../../org/geotools/factory/Hints.html" title="class in org.geotools.factory">Hints</A> hints)</PRE><DL><DD>Returns if the specified meets the requirements specified by a map of . This method is invoked automatically when the is known to meets standard requirements. <p> The default implementation always returns . Override this method if more checks are needed, typically for non-Geotools implementation. For example a JTS geometry factory finder may overrides this method in order to check if a <A HREF="http://www.jump-project.org/docs/jts/1.7/api/com/vividsolutions/jts/geom/GeometryFactory.html" title="class or interface in com.vividsolutions.jts.geom"><CODE>GeometryFactory</CODE></A> uses the required <A HREF="http://www.jump-project.org/docs/jts/1.7/api/com/vividsolutions/jts/geom/CoordinateSequenceFactory.html" title="class or interface in com.vividsolutions.jts.geom"><CODE>CoordinateSequenceFactory</CODE></A>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>provider</CODE> - The provider to checks.<DD><CODE>category</CODE> - The factory category. Usually an interface.<DD><CODE>hints</CODE> - The user requirements, or if none.<DT><B>Returns:</B><DD> if the meets the user requirements.</DL></DD></DL><HR><A NAME="getClassLoaders()"><!-- --></A><H3>getClassLoaders</H3><PRE>public final <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Set.html" title="class or interface in java.util">Set</A> <B>getClassLoaders</B>()</PRE><DL><DD>Returns all class loaders to be used for scanning plugins. Current implementation returns the following class loaders: <p> <ul> <li><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Class.html#getClassLoader()" title="class or interface in java.lang">This object class loader</A></li> <li><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Thread.html#getContextClassLoader()" title="class or interface in java.lang">The thread context class loader</A></li> <li><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ClassLoader.html#getSystemClassLoader()" title="class or interface in java.lang">The system class loader</A></li> </ul> The actual number of class loaders may be smaller if redundancies was found. If some more classloaders should be scanned, they shall be added into the code of this method.<P><DD><DL></DL></DD></DL><HR><A NAME="scanForPlugins()"><!-- --></A><H3>scanForPlugins</H3><PRE>public void <B>scanForPlugins</B>()</PRE><DL><DD>Scans for factory plug-ins on the application class path. This method is needed because the application class path can theoretically change, or additional plug-ins may become available. Rather than re-scanning the classpath on every invocation of the API, the class path is scanned automatically only on the first invocation. Clients can call this method to prompt a re-scan. Thus this method need only be invoked by sophisticated applications which dynamically make new plug-ins available at runtime.<P><DD><DL></DL></DD></DL><HR><A NAME="setOrdering(java.lang.Class, java.util.Comparator)"><!-- --></A><H3>setOrdering</H3><PRE>public boolean <B>setOrdering</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> category, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Comparator.html" title="class or interface in java.util">Comparator</A> comparator)</PRE><DL><DD>Set pairwise ordering between all services according a comparator. Calls to <code><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Comparator.html#compare(java.lang.Object, java.lang.Object)" title="class or interface in java.util">compare</A>(factory1, factory2)</code> should returns: <ul> <li> if is preferred to </li> <li> if is preferred to </li> <li> if there is no preferred order between and </li> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>category</CODE> - The category to set ordering.<DD><CODE>comparator</CODE> - The comparator to use for ordering.<DT><B>Returns:</B><DD> if at least one ordering setting has been modified as a consequence of this call.</DL></DD></DL><HR><A NAME="setOrdering(java.lang.Class, boolean, javax.imageio.spi.ServiceRegistry.Filter, javax.imageio.spi.ServiceRegistry.Filter)"><!-- --></A><H3>setOrdering</H3><PRE>public boolean <B>setOrdering</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> base, boolean set, <A HREF="http://java.sun.com/j2se/1.4/docs/api/javax/imageio/spi/ServiceRegistry.Filter.html" title="class or interface in javax.imageio.spi">ServiceRegistry.Filter</A> service1, <A HREF="http://java.sun.com/j2se/1.4/docs/api/javax/imageio/spi/ServiceRegistry.Filter.html" title="class or interface in javax.imageio.spi">ServiceRegistry.Filter</A> service2)</PRE><DL><DD>Sets or unsets a pairwise ordering between all services meeting a criterion. For example in the CRS framework (<A HREF="../../../org/geotools/referencing/FactoryFinder.html" title="class in org.geotools.referencing"><CODE>FactoryFinder</CODE></A>), this is used for setting ordering between all services provided by two vendors, or for two authorities. If one or both services are not currently registered, or if the desired ordering is already set/unset, nothing happens and false is returned.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>base</CODE> - The base category. Only categories <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Class.html#isAssignableFrom(java.lang.Class)" title="class or interface in java.lang">assignable</A> to will be processed.<DD><CODE>set</CODE> - for setting the ordering, or for unsetting.<DD><CODE>service1</CODE> - Filter for the preferred service.<DD><CODE>service2</CODE> - Filter for the service to which is preferred.</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> </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="class-use/FactoryRegistry.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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"> <A HREF="../../../org/geotools/factory/FactoryFinder.html" title="class in org.geotools.factory"><B>PREV CLASS</B></A> <A HREF="../../../org/geotools/factory/FactoryUsingVolatileDependencies.html" title="class in org.geotools.factory"><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> <A HREF="FactoryRegistry.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: <A HREF="#nested_classes_inherited_from_class_javax.imageio.spi.ServiceRegistry">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright © 1996-2007 <a href="http://www.geotools.org">Geotools</a>. All Rights Reserved.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -