com.teamdev.jxbrowser
Interface ContentHandler


public interface ContentHandler

Implementing this interface allows to intercept requests for certain content types. E.g. implementing this allows to perform downloads of non-displayable content, or ignore certain content altogether.


Method Summary
 boolean canHandleContent(java.lang.String contentType)
          This method notifies underlying browser that this instance is capable of handling the given content type.
 void handleContent(java.net.URL url)
          Process the data.
 boolean isPreferred(java.lang.String contentType)
          This method notifies underlying browser that this instance should be treated as a preferred handler for the given content type.
 

Method Detail

isPreferred

boolean isPreferred(java.lang.String contentType)
This method notifies underlying browser that this instance should be treated as a preferred handler for the given content type.

Parameters:
contentType - type of content (for example "application/zip").
Returns:
true if this interface is using to storing data of this content type.

canHandleContent

boolean canHandleContent(java.lang.String contentType)
This method notifies underlying browser that this instance is capable of handling the given content type. It may be used to prevent default handling machinery from running.

Parameters:
contentType - type of content (for example "application/zip").
Returns:
true if this interface can process data of given content type.

handleContent

void handleContent(java.net.URL url)
Process the data. If this object was chosen by the browser engine to handle a particular request based on return values of isPreferred and canHandleContent, this method is invoked when the request for content should be processed.

Parameters:
url - location of content that has to be processed.