|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectIdentifiedObjectFinder
public class IdentifiedObjectFinder
Looks up an object from an authority factory which is
equals, ignoring metadata, to the specified
object. The main purpose of this class is to get a fully identified object from an incomplete one, for example from an object without
identifiers or "AUTHORITY[...]
"
element in Well Known Text terminology.
Field Summary | |
---|---|
static Logger |
LOGGER
|
Constructor Summary | |
---|---|
protected |
IdentifiedObjectFinder()
Default constructor, subclass should provide an override for getProxy |
protected |
IdentifiedObjectFinder(AuthorityFactory factory,
Class type)
Creates a finder using the specified factory. |
Method Summary | |
---|---|
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()
|
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. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Logger LOGGER
Constructor Detail |
---|
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.Method Detail |
---|
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 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()
toString
in class Object
public void setProxy(AuthorityFactoryProxy proxy)
proxy
- the proxy to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |