info.informatica.doc.agent
Interface UserAgent<C>

All Known Implementing Classes:
DOM4JUserAgent, Java2DUserAgent, PDFUserAgent

public interface UserAgent<C>

User agent for rendering documents.

Author:
Carlos Amengual

Method Summary
 void addDownloadListener(URL url, DownloadListener<C> listener)
          Adds a download listener for asynchronous retrieval of resources (embedded images, etc.)
 ResourceDownloader<C> download(URL url)
          Registers an URL for downloading with this user agent.
 ElementReplacer<C> getElementReplacer(String namespaceUri)
          Gets the element replacer for the given namespace URI.
 ResourceDownloader<C> getResourceDownloader(URL url)
          Gets the resource downloader for the given URL, creating one if none exists.
 StyleDatabase getStyleDatabase()
          Gets the style database used for the styles applied by this agent.
 void setElementReplacer(String namespaceUri, ElementReplacer<C> replacer)
          Sets the element replacer for the given namespace URI.
 

Method Detail

download

ResourceDownloader<C> download(URL url)
Registers an URL for downloading with this user agent.

Parameters:
url - the URL to be downloaded.
Returns:
the downloader for the URL.

addDownloadListener

void addDownloadListener(URL url,
                         DownloadListener<C> listener)
Adds a download listener for asynchronous retrieval of resources (embedded images, etc.)

In the process, it creates a resource downloader object.

Parameters:
url - the URL for the resource to be downloaded.
listener - the download listener.

getResourceDownloader

ResourceDownloader<C> getResourceDownloader(URL url)
Gets the resource downloader for the given URL, creating one if none exists.

Parameters:
url - the URL.
Returns:
the resource downloader.

getElementReplacer

ElementReplacer<C> getElementReplacer(String namespaceUri)
Gets the element replacer for the given namespace URI.

Parameters:
namespaceUri - the namespace URI of the requested replacer. If passed an empty string, will return the replacer for the namespace of XHTML.
Returns:
the element replacer, or null if the namespace is not known to this user agent.

setElementReplacer

void setElementReplacer(String namespaceUri,
                        ElementReplacer<C> replacer)
Sets the element replacer for the given namespace URI.

Parameters:
namespaceUri - the namespace URI of the supplied replacer.
replacer - the element replacer.

getStyleDatabase

StyleDatabase getStyleDatabase()
Gets the style database used for the styles applied by this agent.

Returns:
the style database.


Copyright © 2011 informatica.info. All Rights Reserved.