org.geotools.factory.GeoTools.getDefaultHints()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(242)

本文整理了Java中org.geotools.factory.GeoTools.getDefaultHints()方法的一些代码示例,展示了GeoTools.getDefaultHints()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeoTools.getDefaultHints()方法的具体详情如下:
包路径:org.geotools.factory.GeoTools
类名称:GeoTools
方法名:getDefaultHints

GeoTools.getDefaultHints介绍

[英]Returns the default set of hints used for the various utility classes. This default set is determined by:

  • The System#getProperties system properties available. Some property keys are enumerated in the GeoTools class.
  • Any hints added by call to the Hints#putSystemDefaultor #init method.

Long term plan: We would like to transition the utility classes to being injected with their required factories, either by taking Hints as part of their constructor, or otherwise. Making this change would be a three step process 1) create instance methods for each static final class method 2) create an singleton instance of the class 3) change each static final class method into a call to the singleton. With this in place we could then encourage client code to make use of utility class instances before eventually retiring the static final methods.
[中]返回用于各种实用程序类的默认提示集。此默认设置由以下因素确定:
*系统#getProperties系统属性可用。某些属性键在GeoTools类中枚举。
*通过调用hints#putSystemDefaultor#init方法添加的任何提示。
长期计划:我们希望通过将提示作为构造函数的一部分或其他方式,将实用程序类转换为注入它们所需的工厂。进行此更改需要三个步骤:1)为每个静态最终类方法创建实例方法2)创建类的单例实例3)将每个静态最终类方法更改为对单例的调用。这样,我们就可以鼓励客户机代码在最终停用静态final方法之前使用实用程序类实例。

代码示例

代码示例来源:origin: org.geotools/gt-epsg-hsql

  1. /**
  2. * Creates a new instance of this factory.
  3. */
  4. public HsqlDialectEpsgMediator() throws FactoryException {
  5. this( GeoTools.getDefaultHints() );
  6. }

代码示例来源:origin: org.geotools/gt-main

  1. /**
  2. * Creates an instance of a Filter factory.
  3. *
  4. * @return An instance of the Filter factory.
  5. *
  6. * @throws FactoryRegistryException If the factory is not found.
  7. */
  8. public static FilterFactory createFilterFactory() throws FactoryRegistryException {
  9. Hints hints = GeoTools.getDefaultHints();
  10. return (FilterFactory) CommonFactoryFinder.getFilterFactory( hints );
  11. }

代码示例来源:origin: org.geotools/gt2-main

  1. /**
  2. * Returns the default attribute factory for the system - constucting a new
  3. * one if this is first time the method has been called.
  4. *
  5. * @return the default instance of AttributeTypeFactory.
  6. */
  7. public static AttributeTypeFactory defaultInstance() {
  8. // depend on CommonFactoryFinder to keep singleton cached
  9. //
  10. return CommonFactoryFinder.getAttributeTypeFactory( GeoTools.getDefaultHints() );
  11. }

代码示例来源:origin: org.geotools/gt2-main

  1. /**
  2. * Creates a new instance of DefaultGraphic
  3. */
  4. protected GraphicImpl() {
  5. this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()));
  6. }

代码示例来源:origin: org.geotools/gt2-main

  1. /**
  2. * Create a Stylereader - use if you already have a dom to parse.
  3. *
  4. * @param factory
  5. * The StyleFactory to use to build the style
  6. */
  7. public SLDParser(StyleFactory factory) {
  8. this( factory, CommonFactoryFinder.getFilterFactory( GeoTools.getDefaultHints() ));
  9. }

代码示例来源:origin: org.geoserver/gs-wcs2_0

  1. public GetCoverage(
  2. WCSInfo serviceInfo,
  3. Catalog catalog,
  4. EnvelopeAxesLabelsMapper envelopeDimensionsMapper,
  5. MIMETypeMapper mimeMapper) {
  6. this.wcs = serviceInfo;
  7. this.catalog = catalog;
  8. this.envelopeDimensionsMapper = envelopeDimensionsMapper;
  9. this.mimeMapper = mimeMapper;
  10. this.gridCoverageFactory =
  11. CoverageFactoryFinder.getGridCoverageFactory(GeoTools.getDefaultHints());
  12. }

代码示例来源:origin: org.geotools/gt-main

  1. /**
  2. * Use the supplied StyleFactory when building styles
  3. *
  4. * @param styleFactory the StyleFactory to use in building Styles
  5. */
  6. public StyleBuilder(StyleFactory styleFactory ) {
  7. this( styleFactory, CommonFactoryFinder.getFilterFactory( GeoTools.getDefaultHints() ) );
  8. }

代码示例来源:origin: org.geotools/gt-main

  1. /**
  2. * Creates a new instance of DefaultGraphic
  3. */
  4. protected GraphicImpl() {
  5. this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()));
  6. }

代码示例来源:origin: org.geotools/gt-main

  1. /**
  2. * Creates a new instance of DefaultMark
  3. */
  4. public MarkImpl() {
  5. this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()), null);
  6. }

代码示例来源:origin: org.geotools/gt-main

  1. /**
  2. * Creates a new instance of Stroke
  3. */
  4. protected StrokeImpl() {
  5. this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()));
  6. }

代码示例来源:origin: org.geotools/gt-coverage

  1. /**
  2. * Tells me if this {@link Format} can read the provided <code>input</code>.
  3. *
  4. *
  5. * @param input
  6. * The input object to test for suitability.
  7. * @return True if this format can read this object, False otherwise.
  8. */
  9. public boolean accepts(Object source){
  10. return accepts(source,GeoTools.getDefaultHints());
  11. }

代码示例来源:origin: org.geotools/gt-main

  1. /** Creates a new instance of DefaultFill */
  2. protected FillImpl() {
  3. this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()));
  4. }

代码示例来源:origin: org.geotools/gt-main

  1. /**
  2. * Create a Stylereader - use if you already have a dom to parse.
  3. *
  4. * @param factory
  5. * The StyleFactory to use to build the style
  6. */
  7. public SLDParser(StyleFactory factory) {
  8. this(factory, CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()));
  9. }

代码示例来源:origin: org.geotools/gt2-main

  1. /**
  2. * Creates an instance of a Filter factory.
  3. *
  4. * @return An instance of the Filter factory.
  5. *
  6. * @throws FactoryConfigurationError If a factory is not found.
  7. */
  8. public static FilterFactory createFilterFactory()
  9. throws FactoryConfigurationError {
  10. Hints hints = GeoTools.getDefaultHints();
  11. return (FilterFactory) CommonFactoryFinder.getFilterFactory( hints );
  12. }

代码示例来源:origin: org.geotools/gt2-main

  1. /**
  2. * Creates a new instance of DefaultMark
  3. */
  4. public MarkImpl() {
  5. this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()));
  6. }

代码示例来源:origin: org.geotools/gt2-main

  1. private static Hints addDefaultHints(final Hints hints) {
  2. final Hints completed = GeoTools.getDefaultHints();
  3. if (hints != null) {
  4. completed.add(hints);
  5. }
  6. return completed;
  7. }

代码示例来源:origin: org.geotools/gt2-main

  1. /**
  2. * Processed the {@link ConverterFactory} extension point.
  3. *
  4. * @return A collection of converter factories.
  5. * @since 2.4
  6. */
  7. static Collection factories() {
  8. if(factories == null)
  9. factories = getConverterFactories(GeoTools.getDefaultHints());
  10. return factories;
  11. }
  12. }

代码示例来源:origin: org.geotools/gt-main

  1. public MarkImpl(String name) {
  2. this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()), null);
  3. LOGGER.fine("creating " + name + " type mark");
  4. setWellKnownName(name);
  5. }

代码示例来源:origin: org.geoserver/gs-wms

  1. public GridCoverageReader getCoverageReader() throws IOException {
  2. if (type != TYPE_RASTER) {
  3. throw new IllegalArgumentException("Layer type is not raster");
  4. }
  5. CoverageInfo resource = (CoverageInfo) layerInfo.getResource();
  6. return resource.getGridCoverageReader(null, GeoTools.getDefaultHints());
  7. }

代码示例来源:origin: org.geotools/gt2-main

  1. /**
  2. * Creates a new instance of TextMark
  3. *
  4. * @param font DOCUMENT ME!
  5. * @param symbol DOCUMENT ME!
  6. */
  7. public TextMarkImpl(Font font, String symbol) {
  8. this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()));
  9. addFont(font);
  10. setSymbol(symbol);
  11. wellKnownName = filterFactory.literal("Symbol");
  12. }

相关文章