public class IdentifiedObjectFinder extends Object
AUTHORITY[...]
" element in Well Known Text terminology.Modifier | Constructor and Description |
---|---|
protected |
IdentifiedObjectFinder()
Default constructor, subclass should provide an override for getProxy
|
protected |
IdentifiedObjectFinder(AuthorityFactory factory,
Class type)
Creates a finder using the specified factory.
|
Modifier and Type | Method and Description |
---|---|
protected IdentifiedObject |
deriveEquivalent(IdentifiedObject candidate,
IdentifiedObject model)
Returns
candidate , or an object derived from candidate , if it is equals ignoring metadata to the specified model. |
IdentifiedObject |
find(IdentifiedObject object)
Lookups an object which is equals, ignoring metadata,
to the specified object.
|
String |
findIdentifier(IdentifiedObject object)
Returns the identifier of the specified object, or
null if none. |
protected Citation |
getAuthority()
The Authority for this Finder; used during get Identifier.
|
protected Set |
getCodeCandidates(IdentifiedObject object)
Returns a set of authority codes that may identify the same object than the
specified one.
|
protected AuthorityFactoryProxy |
getProxy() |
protected Set |
getSpecificCodeCandidates(IdentifiedObject object) |
boolean |
isFullScanAllowed()
If
true , an exhaustive full scan against all registered objects will be performed
(may be slow). |
void |
setFullScanAllowed(boolean fullScan)
Set whatever an exhaustive scan against all registered objects is allowed.
|
void |
setProxy(AuthorityFactoryProxy proxy) |
String |
toString()
Returns a string representation of this finder, for debugging purpose only.
|
public static final Logger LOGGER
protected IdentifiedObjectFinder()
protected IdentifiedObjectFinder(AuthorityFactory factory, Class type)
AbstractAuthorityFactory.getIdentifiedObjectFinder(java.lang.Class<? extends org.opengis.referencing.IdentifiedObject>)
instead.factory
- The factory to scan for the identified objects.type
- The type of objects to lookup.protected AuthorityFactoryProxy getProxy()
public boolean isFullScanAllowed()
true
, an exhaustive full scan against all registered objects will be performed
(may be slow). Otherwise only a fast lookup based on embedded identifiers and names will be
performed. The default value is true
.public void setFullScanAllowed(boolean fullScan)
true
.public IdentifiedObject find(IdentifiedObject object) throws FactoryException
The first of the above created objects which is equals to the specified object in the the
sense of equalsIgnoreMetadata
is returned.
object
- The object looked up.null
if not found.FactoryException
- if an error occured while creating an object.public String findIdentifier(IdentifiedObject object) throws FactoryException
null
if none. The default
implementation invokes find(object)
and extracts the code
from the returned identified object.FactoryException
protected Citation getAuthority()
protected Set getSpecificCodeCandidates(IdentifiedObject object) throws FactoryException
FactoryException
protected Set getCodeCandidates(IdentifiedObject object) throws FactoryException
This method is invoked by the default find
method implementation. The caller
may iterates through every returned codes, instantiate the objects and compare them with the
specified one in order to determine which codes are really applicable.
The default implementation returns the same set than
getAuthorityCodes(type)
where type
is the interface specified at construction type. Subclasses should override this method
in order to return a smaller set, if they can.
object
- The object looked up.FactoryException
- if an error occured while fetching the set of code candidates.protected IdentifiedObject deriveEquivalent(IdentifiedObject candidate, IdentifiedObject model) throws FactoryException
candidate
, or an object derived from candidate
, if it is equals ignoring metadata to the specified model. Otherwise returns
null
.
This method is overriden by factories that may test many flavors of candidate
, for
example TransformedAuthorityFactory
.
candidate
- An object created by the factory specified at construction time.candidate
, or an object derived from candidate
(for example with axis
order forced to (longitude, latitude), or null
if none of
the above is equals ignoring metadata to the
specified model.FactoryException
- if an error occured while creating a derived object.public String toString()
public void setProxy(AuthorityFactoryProxy proxy)
proxy
- the proxy to setCopyright © 1996–2019 Geotools. All rights reserved.