Gabriel Roldán a écrit :
> If I want to pass hints to FilterFactory, does it necessarly needs to declare
> which ones it accepts through getImplementationHints()?
Yes, you need to declares the hints are significant to FilterFactory. Note that
getImplementationHints() is significant only after FilterFactory construction,
not before. getImplementationHints() is used by FactoryRegistry when a request
for a new FilterFactory is made, in order to check if an existing instance could
match the hints provided in the new request.
> I ask because I'm looking at GridCoverageFactory and, thgough it can handle
> some hints at its constructor, it just returns an empty map in
> getImplementationHints (inherited from AbstractFactory).
It should not be an empty map... Lines 135 and 136 in GridCoverageFactory (on
trunk) set the implementation hints to the values that GridCoverageFactory
choose to retains. Note that the hints are set only after the hints has been
processed, and the hint values are the values that GridCoverageFactory is going
to use, which may or may not be identical to the value given by the users
(depending on any validation process the factory may apply).
> But if I do the same in FilterFactoryImpl, the hints are never passed, seems
> an instance preiously created without hints were cached somehow and after
> that the constructor that expects Hints gets never called, even if I pass an
> actual Hints to CommonFactoryFinder.getFilterFactory(Hints).
This is because FilterFactoryImpl do not declares the hints that it use. It
should contains the following code at line 112:
hints.put(Hints.THE_HINT_THAT_MATTER, theValueThatTheConstructorRetained);
Without such line, FactoryRegistry don't know that THE_HINT_THAT_MATTER is
significant to FilterFactory. If an existing instance is found, it will be
returned because FactoryRegistry believes that this hint doesn't make any
difference to FactoryFilterImpl.
Martin
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel