org.lobobrowser.clientlet
Interface ClientletSelector


public interface ClientletSelector

Interface implemented in order to handle web responses, typically by checking the content types.

See Also:
NavigatorExtensionContext.addClientletSelector(ClientletSelector)

Method Summary
 Clientlet lastResortSelect(ClientletRequest request, ClientletResponse response)
          This method is meant for the primary extension to handle content that was not handled by any other extension.
 Clientlet select(ClientletRequest request, ClientletResponse response)
          This method is invoked after a URL response has been received by the user agent.
 

Method Detail

select

Clientlet select(ClientletRequest request,
                 ClientletResponse response)
This method is invoked after a URL response has been received by the user agent. It obtains a Clientlet instance that can handle the given request and response. It must return null if it does not know how to handle the response. Generally a selector should only attempt to handle a specific response MIME type. If the MIME type is missing or is generic (e.g. application/octet-stream), then the selector should check the file extension. It is recommended that implementors use the convenience method, ClientletResponse.matches(String, String[]), to determine if they should handle a response.

The select method is invoked on all extensions that have registered one or more clientlet selectors. Extensions are invoked in descending order of priority. If a extension returns a non-null clientlet, the rest of the extensions are not invoked.

Returns:
A new Clientlet instance, or null if the clientlet selector does not know how to handle the response.
See Also:
ClientletResponse.matches(String, String[])

lastResortSelect

Clientlet lastResortSelect(ClientletRequest request,
                           ClientletResponse response)
This method is meant for the primary extension to handle content that was not handled by any other extension. Invocation of this method proceeds in ascending order of extension priority. Implementors will generally have this method return null unless they would like to allow extensions with lower priority to override the selection.



SourceForge.net LogoCopyright © 2005, 2006, 2007 The Lobo Project. All Rights Reserved.
[Lobo Home]