| java.lang.Object org.geotools.referencing.factory.IdentifiedObjectFinder
IdentifiedObjectFinder | public class IdentifiedObjectFinder (Code) | | Looks up an object from an
which is
, to the specified
object. The main purpose of this class is to get a fully
from an incomplete one, for example from an object without
or "
AUTHORITY[...] "
element in Well Known Text terminology.
since: 2.4 version: $Id: IdentifiedObjectFinder.java 27862 2007-11-12 19:51:19Z desruisseaux $ author: Martin Desruisseaux |
Method Summary | |
final IdentifiedObject | createFromCodes(IdentifiedObject object) Creates an object
, to the
specified object. | final IdentifiedObject | createFromIdentifiers(IdentifiedObject object) Creates an object
, to the
specified object using only the
.
If no such object is found, returns
null .
This method may be used in order to get a fully identified object from a partially
identified one.
Parameters: object - The object looked up. | final IdentifiedObject | createFromNames(IdentifiedObject object) Creates an object
, to
the specified object using only the
and
. | protected IdentifiedObject | deriveEquivalent(IdentifiedObject candidate, IdentifiedObject model) Returns
candidate , or an object derived from
candidate , if it is
to the specified
model. | public IdentifiedObject | find(IdentifiedObject object) Lookups an object which is
, to the
specified object. | public String | findIdentifier(IdentifiedObject object) Returns the identifier of the specified object, or
null if none. | protected Set | getCodeCandidates(IdentifiedObject object) Returns a set of authority codes that may identify the same object than
the specified one. | final String | getIdentifier(IdentifiedObject object) Returns the identifier for the specified object. | public boolean | isFullScanAllowed() If
true , an exhaustive full scan against all registered objects
will be performed (may be slow). | public void | setFullScanAllowed(boolean fullScan) Set whatever an exhaustive scan against all registered objects is allowed. | public String | toString() Returns a string representation of this finder, for debugging purpose only. |
IdentifiedObjectFinder | IdentifiedObjectFinder(IdentifiedObjectFinder finder)(Code) | | Creates a finder using the same proxy than the specified finder.
|
IdentifiedObjectFinder | protected IdentifiedObjectFinder(AuthorityFactory factory, Class type)(Code) | | Creates a finder using the specified factory. This constructor is
protected because instances of this class should not be created directly.
Use
AbstractAuthorityFactory.getIdentifiedObjectFinder instead.
Parameters: factory - The factory to scan for the identified objects. Parameters: type - The type of objects to lookup. |
createFromCodes | final IdentifiedObject createFromCodes(IdentifiedObject object) throws FactoryException(Code) | | Creates an object
, to the
specified object. This method scans the
,
create the objects and returns the first one which is equals to the specified object in
the sense of
CRS.equalsIgnoreMetadata equalsIgnoreMetadata .
This method may be used in order to get a fully
from an object without
.
Scaning the whole set of authority codes may be slow. Users should try
(object) and/or
(object) before to fallback
on this method.
Parameters: object - The object looked up. The identified object, or null if not found. throws: FactoryException - if an error occured while scanning through authority codes. See Also: IdentifiedObjectFinder.createFromIdentifiers See Also: IdentifiedObjectFinder.createFromNames |
createFromIdentifiers | final IdentifiedObject createFromIdentifiers(IdentifiedObject object) throws FactoryException(Code) | | Creates an object
, to the
specified object using only the
.
If no such object is found, returns
null .
This method may be used in order to get a fully identified object from a partially
identified one.
Parameters: object - The object looked up. The identified object, or null if not found. See Also: IdentifiedObjectFinder.createFromCodes See Also: IdentifiedObjectFinder.createFromNames throws: FactoryException - if an error occured while creating an object. |
createFromNames | final IdentifiedObject createFromNames(IdentifiedObject object) throws FactoryException(Code) | | Creates an object
, to
the specified object using only the
and
. If no such object is found, returns
null .
This method may be used with some
implementations like the one backed by the EPSG database, which are capable to find
an object from its name when the identifier is unknown.
Parameters: object - The object looked up. The identified object, or null if not found. See Also: IdentifiedObjectFinder.createFromCodes See Also: IdentifiedObjectFinder.createFromIdentifiers throws: FactoryException - if an error occured while creating an object. |
deriveEquivalent | protected IdentifiedObject deriveEquivalent(IdentifiedObject candidate, IdentifiedObject model) throws FactoryException(Code) | | Returns
candidate , or an object derived from
candidate , if it is
to the specified
model. Otherwise returns
null .
This method is overriden by factories that may test many flavors of
candidate , for example
TransformedAuthorityFactory .
Parameters: candidate - An object created by the factory specified at construction time. candidate , or an object derived from candidate (for example with axisorder forced to (longitude, latitude), or null if noneof the above is to thespecified model. throws: FactoryException - if an error occured while creating a derived object. |
find | public IdentifiedObject find(IdentifiedObject object) throws FactoryException(Code) | | Lookups an object which is
, to the
specified object. The default implementation tries to instantiate some
from the authority factory
specified at construction time, in the following order:
- If the specified object contains
associated to the same authority than the factory, then those
identifiers are used for
to be tested.
- If the authority factory can create objects from their
in addition of identifiers, then the name and
are used for creating objects
to be tested.
- If
, then full
are used for
creating objects to be tested.
The first of the above created objects which is equals to the specified object in the
the sense of
CRS.equalsIgnoreMetadata equalsIgnoreMetadata is returned.
Parameters: object - The object looked up. The identified object, or null if not found. throws: FactoryException - if an error occured while creating an object. |
findIdentifier | public String findIdentifier(IdentifiedObject object) throws FactoryException(Code) | | Returns the identifier of the specified object, or
null if none. The default
implementation invokes
(object) and extracts the
code from the returned
.
|
getCodeCandidates | protected Set getCodeCandidates(IdentifiedObject object) throws FactoryException(Code) | | Returns a set of authority codes that may identify the same object than
the specified one. The returned set must contains the code of every objects that are
, to the specified one.
However the set is not required to contains only the codes of those objects; it may
conservatively contains the code for more objects if an exact search is too expensive.
This method is invoked by the default
IdentifiedObjectFinder.find 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
(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.
Parameters: object - The object looked up. A set of code candidates. throws: FactoryException - if an error occured while fetching the set of code candidates. |
getIdentifier | final String getIdentifier(IdentifiedObject object)(Code) | | Returns the identifier for the specified object.
|
isFullScanAllowed | public boolean isFullScanAllowed()(Code) | | If
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 .
|
setFullScanAllowed | public void setFullScanAllowed(boolean fullScan)(Code) | | Set whatever an exhaustive scan against all registered objects is allowed.
The default value is
true .
|
toString | public String toString()(Code) | | Returns a string representation of this finder, for debugging purpose only.
|
|
|