📄 factory.html
字号:
limited to) any <A HREF="http://java.sun.com/j2se/1.4/docs/api/javax/imageio/spi/ServiceRegistry.html" title="class or interface in javax.imageio.spi"><CODE>ServiceRegistry</CODE></A> subclass. If the standard (or its Geotools extension <A HREF="../../../org/geotools/factory/FactoryRegistry.html" title="class in org.geotools.factory"><CODE>FactoryRegistry</CODE></A>) is selected as a container for services, then factory implementations should be declared as below (select only one way):</p> <ul> <li><strong>Register for automatic discovery</strong></li> <ul> <li>Provide a public no-arguments constructor.</li> <li>Add the fully qualified name of the <u>implementation</u> class in the <var>classname</var> file where <var>classname</var> is the fully qualified name of the service <u>interface</u>.</li> <li>The factory implementations will be discovered when <A HREF="../../../org/geotools/factory/FactoryRegistry.html#scanForPlugins()"><CODE>FactoryRegistry.scanForPlugins()</CODE></A> will be invoked.</li> </ul> <li><strong><u>Or</u> register explicitly by application code</strong></li> <ul> <li>Invoke <A HREF="http://java.sun.com/j2se/1.4/docs/api/javax/imageio/spi/ServiceRegistry.html#registerServiceProvider(java.lang.Object)" title="class or interface in javax.imageio.spi"><CODE>ServiceRegistry.registerServiceProvider(java.lang.Object)</CODE></A> in application code.</li> </ul> </ul> <p>In addition, it is recommended that implementations provide a constructor expecting a single <A HREF="../../../org/geotools/factory/Hints.html" title="class in org.geotools.factory"><CODE>Hints</CODE></A> argument. This optional argument gives to the user some control of the factory's low-level details. The amount of control is factory specific. The geotools library defines a global class called <A HREF="../../../org/geotools/factory/Hints.html" title="class in org.geotools.factory"><CODE>Hints</CODE></A> that is ment as API (i.e. you can assume these hints are supported). Factories may also provide information on their own custom hints as part of their javadoc class description.</p> <strong>Examples:</strong> <ul> <li><p>An application supplied a datum factory hint, being passed to a datum authority factory so that all datum created from an authority code will come from the supplied datum factory.</p></li> <li><p>An application supplied a <A HREF="../../../org/geotools/feature/FeatureFactory.html" title="interface in org.geotools.feature"><CODE>FeatureFactory</CODE></A> (ensuring all constructed features support the interface), being passed to a <A HREF="../../../org/geotools/feature/FeatureTypeFactory.html" title="class in org.geotools.feature"><CODE>FeatureTypeFactory</CODE></A> so that all constructed will produce features supporting the indicated interface.<p></li> </ul> <p>As seen in those examples this concept of a hint becomes more interesting when the opperation being controlled is discovery of other services used by the Factory. By supplying appropriate hints one can chain together several factories and retarget them to an application specific task.</p><P><P><DL><DT><B>Author:</B></DT> <DD>Ian Schneider, Martin Desruisseaux, Jody Garnett</DD><DT><B>See Also:</B><DD><A HREF="../../../org/geotools/factory/Hints.html" title="class in org.geotools.factory"><CODE>Hints</CODE></A>, <A HREF="../../../org/geotools/factory/FactoryRegistry.html" title="class in org.geotools.factory"><CODE>FactoryRegistry</CODE></A><DT><B>Module:</B></DT><DD><CODE><B>module/referencing</B></CODE> (<A HREF="http://maven.geotools.fr/repository/org/geotools/gt2-referencing/"><CODE>gt2-referencing.jar</CODE></A>) (<A HREF="http://maven.geotools.fr/reports/referencing/index.html">Maven report</A>) (<A HREF="http://svn.geotools.org/geotools/tags/2.3.2/module/referencing/src/org/geotools/factory/Factory.java">SVN head</A>)</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> <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Map.html" title="class or interface in java.util">Map</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/factory/Factory.html#getImplementationHints()">getImplementationHints</A></B>()</CODE><BR> Map of hints (maybe <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collections.html#unmodifiableMap(java.util.Map)" title="class or interface in java.util">unmodifiable</A>) used by this factory to customize its use. </TD></TR></TABLE> <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="getImplementationHints()"><!-- --></A><H3>getImplementationHints</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Map.html" title="class or interface in java.util">Map</A> <B>getImplementationHints</B>()</PRE><DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -