/** Creates a finder for the underlying backing store. */ protected Finder(final Class<? extends IdentifiedObject> type) throws FactoryException { super( getGeotoolsFactory("getIdentifiedObjectFinder", null) .getIdentifiedObjectFinder(type)); }
public IdentifiedObjectFinder getIdentifiedObjectFinder(Class type) throws FactoryException { return delegate.getIdentifiedObjectFinder(type); }
/** * Returns a finder which can be used for looking up unidentified objects. The default * implementation delegates lookup to the underlying backing store and caches the result. */ @Override public synchronized IdentifiedObjectFinder getIdentifiedObjectFinder( final Class<? extends IdentifiedObject> type) throws FactoryException { return new Finder(getBackingStore().getIdentifiedObjectFinder(type)); }
/** * Returns a finder which can be used for looking up unidentified objects. The default * implementation delegates lookup to the underlying backing store and caches the result. * * @since 2.4 */ @Override public synchronized IdentifiedObjectFinder getIdentifiedObjectFinder( final Class /*<? extends IdentifiedObject>*/ type) throws FactoryException { return new Finder( delegate.getIdentifiedObjectFinder(type), ObjectCaches.create("weak", 250)); }
/** * Returns a finder which can be used for looking up unidentified objects. The default * implementation delegates lookup to the underlying backing store and caches the result. * * @throws FactoryException if the finder can not be created. * @since 2.4 */ @Override public synchronized IdentifiedObjectFinder getIdentifiedObjectFinder( final Class<? extends IdentifiedObject> type) throws FactoryException { return new Finder(getBackingStore().getIdentifiedObjectFinder(type)); }
/** Returns the next finder in the specified set of factories, or {@code null} if none. */ final IdentifiedObjectFinder next(final Iterator<AuthorityFactory> it) throws FactoryException { while (it.hasNext()) { final AuthorityFactory factory = it.next(); if (exclude(factory)) { continue; } if (factory instanceof AbstractAuthorityFactory) { final IdentifiedObjectFinder finder = ((AbstractAuthorityFactory) factory) .getIdentifiedObjectFinder(getProxy().getType()); if (finder != null) { finder.setFullScanAllowed(isFullScanAllowed()); return finder; } } } return null; }
private Identifier identifySubObject( AbstractAuthorityFactory factory, IdentifiedObject dependency) throws FactoryException { IdentifiedObjectFinder identifiedObjectFinder = factory.getIdentifiedObjectFinder(dependency.getClass()); identifiedObjectFinder.setFullScanAllowed(isFullScanAllowed()); IdentifiedObject identifiedDependency = identifiedObjectFinder.find(dependency); Identifier id = AbstractIdentifiedObject.getIdentifier(identifiedDependency, getAuthority()); return id; }
/** Makes sure that {@link #fallback} is initialized. */ private void ensureFallback() throws FactoryException { if (fallback == null) { fallback = FallbackAuthorityFactory.this.fallback.getIdentifiedObjectFinder( getProxy().getType()); } fallback.setFullScanAllowed(isFullScanAllowed()); }
(AbstractAuthorityFactory) getAuthorityFactory(true); final IdentifiedObjectFinder finder = xyFactory.getIdentifiedObjectFinder(object.getClass()); finder.setFullScanAllowed(fullScan); return finder.findIdentifier(object);
final IdentifiedObjectFinder finder = f.getIdentifiedObjectFinder(crs.getClass()); finder.setFullScanAllowed(fullScan); final String code = finder.findIdentifier(crs);
/** Tests the {@link IdentifiedObjectFinder#find} method. */ @Test public void testFind() throws FactoryException { final AbstractAuthorityFactory all = AllAuthoritiesFactory.DEFAULT; final IdentifiedObjectFinder finder = all.getIdentifiedObjectFinder(CoordinateReferenceSystem.class); finder.setFullScanAllowed(false); assertNull( "Should not find the CRS without a scan.", finder.find(DefaultGeographicCRS.WGS84)); finder.setFullScanAllowed(true); final IdentifiedObject find = finder.find(DefaultGeographicCRS.WGS84); assertNotNull("With scan allowed, should find the CRS.", find); assertTrue(CRS.equalsIgnoreMetadata(find, DefaultGeographicCRS.WGS84)); assertSame(all.createCoordinateReferenceSystem("CRS:84"), find); assertEquals("CRS:84", finder.findIdentifier(DefaultGeographicCRS.WGS84)); } }
final GeographicCRS CRS84 = factory.createGeographicCRS("CRS:84"); final IdentifiedObjectFinder finder = factory.getIdentifiedObjectFinder(CoordinateReferenceSystem.class);