On Sat, 2008-11-15 at 12:37 +0100, Oleg Kalnichevski wrote:
> Folks
>
> I can't help thinking Handler is a bit too generic and not descriptive
> enough. How do you feel about renaming it to ContentHandler or some
> such?
I chatted with Henri about this a while @apachecon. We came to the
conclusion that the current API is to open:
public interface Handler {
/**
* @param openStream
* the underlying stream
* @param uri
* the uri we are currently processing
* @param parse
* the parse object from a former processing step
* @throws Exception
*/
void handle(InputStream openStream, URI uri, Parse parse)
throws IOException, DroidsException;
}
We have access to the parse object, the original stream and the underlying URI.
Back in the days I thought it was a good idea since every possible usecase could
be handled but maybe we it is way too brought.
So maybe we want have different type of handlers:
- content handler (using parse)
- stream handler (using the openStream)
- uri handler (using the uri)
The super interface could look like
public interface Handler {
void handle(Object object)
}
WDYT?
salu2
--
Thorsten Scherler <thorsten.at.apache.org>
Open Source Java <consulting, training and solutions>