Hi folks, how are we going to "unset" a parameter that is defined somewhere higher up in the hierarchy? The example at hand is the default proxy. An application defines a default proxy in the client parameters, but wants a specific request to be sent without the proxy. Setting the value to null in the request parameters doesn't work, since null means "look higher up in the hierarchy".
Option A: Define a global "Void" object that can be used to explicitly unset any parameter value. Since the global object does not match the expected type of parameters, the check for "Void" has to be done before casting the value to the target type. Moving the check for the "Void" object into the params implementations will not work, since each param impl can be put into a hierarchy. If it's in the hierarchy, it has to return the object to cancel recursion, only the outmost impl can be allowed to do the null conversion. Option B: Define a parameter specific Null object for those parameters where it matters, with the appropriate type. That would mean a specific HttpHost constant indicating NO_PROXY. It must be a valid HttpHost, but must also never equal a real HttpHost. We could use an invalid port number such as -2 to do that, but this approach breaks when HttpHost gets better argument checking. The same applies for invalid or otherwise special hostnames or protocols. Option C: something else? cheers, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
