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

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

本文整理了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

/**
 * Creates a new instance of this factory.
 */
public HsqlDialectEpsgMediator() throws FactoryException {
  this( GeoTools.getDefaultHints() );
}

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

/**
 * Creates an instance of a Filter factory.
 *
 * @return An instance of the Filter factory.
 *
 * @throws FactoryRegistryException If the factory is not found.
 */
public static FilterFactory createFilterFactory() throws FactoryRegistryException {
  Hints hints = GeoTools.getDefaultHints();
  return (FilterFactory) CommonFactoryFinder.getFilterFactory( hints );
}

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

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

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

/**
 * Creates a new instance of DefaultGraphic
 */
protected GraphicImpl() {
  this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints())); 
}

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

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

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

public GetCoverage(
    WCSInfo serviceInfo,
    Catalog catalog,
    EnvelopeAxesLabelsMapper envelopeDimensionsMapper,
    MIMETypeMapper mimeMapper) {
  this.wcs = serviceInfo;
  this.catalog = catalog;
  this.envelopeDimensionsMapper = envelopeDimensionsMapper;
  this.mimeMapper = mimeMapper;
  this.gridCoverageFactory =
      CoverageFactoryFinder.getGridCoverageFactory(GeoTools.getDefaultHints());
}

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

/**
 * Use the supplied StyleFactory when building styles
 *
 * @param styleFactory the StyleFactory to use in building Styles
 */
public StyleBuilder(StyleFactory styleFactory ) {
  this( styleFactory, CommonFactoryFinder.getFilterFactory( GeoTools.getDefaultHints() ) );
}

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

/**
 * Creates a new instance of DefaultGraphic
 */
protected GraphicImpl() {
  this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints())); 
}

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

/**
 * Creates a new instance of DefaultMark
 */
public MarkImpl() {
  this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()), null);        
}

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

/**
 * Creates a new instance of Stroke
 */
protected StrokeImpl() {
  this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()));
}

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

/**
 * Tells me if this {@link Format} can read the provided <code>input</code>.
 * 
 * 
 * @param input
 *            The input object to test for suitability.
 * @return True if this format can read this object, False otherwise.
 */
public boolean accepts(Object source){
  return accepts(source,GeoTools.getDefaultHints());
}

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

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

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

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

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

/**
 * Creates an instance of a Filter factory.
 *
 * @return An instance of the Filter factory.
 *
 * @throws FactoryConfigurationError If a factory is not found.
 */
public static FilterFactory createFilterFactory()
  throws FactoryConfigurationError {
  Hints hints = GeoTools.getDefaultHints();
  return (FilterFactory) CommonFactoryFinder.getFilterFactory( hints );
}

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

/**
 * Creates a new instance of DefaultMark
 */
public MarkImpl() {
  this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()));        
}

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

private static Hints addDefaultHints(final Hints hints) {
  final Hints completed = GeoTools.getDefaultHints();
  if (hints != null) {
    completed.add(hints);
  }
  return completed;
}

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

/**
   * Processed the {@link ConverterFactory} extension point.
   * 
   * @return A collection of converter factories.
   * @since 2.4 
   */
  static Collection factories() {
    if(factories == null)
    factories = getConverterFactories(GeoTools.getDefaultHints());
    return factories;
  }
}

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

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

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

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

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

/**
 * Creates a new instance of TextMark
 *
 * @param font DOCUMENT ME!
 * @param symbol DOCUMENT ME!
 */
public TextMarkImpl(Font font, String symbol) {
  this( CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()));
  addFont(font);
  setSymbol(symbol);
  wellKnownName = filterFactory.literal("Symbol");
}

相关文章