Community
Participate
Working Groups
AdapterManager.getFactories(Class<? extends Object>) currently return a map from adapter type to exactly one Adapter factory. This works quite well for simple cases but has two major drawbacks: - if there is more than one Adapter capable of adapting a given type then it is a matter of start order which one is chosen - if the chosen adapter can't adapt, the other is not queried anymore currently this is "solved" in most cases to have special classes extending the desired one but this is not always possible, especially if the decision if a class can be adapted is done on the properties of the object itself! Think about this simple use case: - There is a tree of (java.io) file objects - each file can have a different label/icon depending on its file type and additional metadata available - each file might be converted and then opened by a special editor Currently providing such functionality in a generic way requires a lot of effort and different techniques because it is not possible to use adapters for more than one type. == What is proposed == AdapterManager is capable to iterate over all adapters providing a given adaptable == What is not proposed == There is no guarantee on the order adapters are queried if they can adapt the same type, the first non-null result is chosen