[
https://issues.apache.org/jira/browse/HTTPCORE-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551793
]
Roland Weber commented on HTTPCORE-131:
---------------------------------------
Hi Oleg, Sebastian,
the nesting/linking/stacking are implementation specific and can hardly be
addressed outside of the implementing classes, at least if more than the
standard implementations should be supported. Then there's the problem of
multiple definitions for a key within the hierarchy, which leads to multiple
occurrences in the various iterators.
If we add methods to provide the links, we'd also need some indication about a
search order for the referenced objects. We could do that for the default
implementations, but can we guarantee that all implementations will have a
defined search order that is independent of the key being queried?
By collecting all keys in a set, we loose the information where a key is
defined. But we avoid the search order problem: all keys in the returned set
are defined somewhere, and a lookup on the key will return the correct value.
I don't mind adding an iterator for the locally defined keys, but I don't think
we should try to expose the hierarchy in the interface. Even the iterator for
locally defined keys can be misleading, if a key is locally mapped to null and
triggers a hierarchy search anyway.
The best use I can see for this functionality is a debug output of the set of
parameters being used somewhere. If writing code for myself, I would get the
set of all keys, iterate over that, and perform a lookup for each key to
generate debug output. To investigate definitions along the hierarchies, I
would expect the HttpParams implementations to have a toString() method that
prints the related HttpParams implementations too. I'm not claiming that's the
way it should be in HttpComponents though.
Maybe Johannes has another use case?
cheers,
Roland
> give access to HttpParams keys
> ------------------------------
>
> Key: HTTPCORE-131
> URL: https://issues.apache.org/jira/browse/HTTPCORE-131
> Project: HttpComponents Core
> Issue Type: New Feature
> Components: HttpCore
> Affects Versions: 4.0-alpha6
> Reporter: Roland Weber
> Priority: Minor
> Fix For: 4.0-beta1
>
>
> Johannes Koch suggested on the dev@ list that there should be a way to access
> the keys in the HttpParams interface. Due to the nested, linked, or stacked
> nature of HttpParams implementations, a simple iterator is not feasible.
> However, collecting keys in a set could be implemented:
> HttpParams.collectKeys(Set keySet)
> This would affect all implementations in HttpCore and HttpClient.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]