org.w3c.mwi.mobileok.basic
Interface ResourceExtractor

All Known Implementing Classes:
CssResourceExtractor, ImageResourceExtractor, InCssResourceExtractor, LinkedResourceExtractor, ObjectResourceExtractor

public interface ResourceExtractor

Interface that must be implemented by all resource extractors.

The goal of a resource extractor is, given a Resource and a list of resources that have already been extracted, to extract new resources from the given resource.

Although there is no restriction whatsoever to the type of extraction that may occur, the spirit of this is more to define one extractor per type of resources to extract, i.e. one for style sheets, one for links, one for images, one for objects. This, in turn, means the same resource will be parsed multiple times, but the net benefit in terms of flexibility should outweigh the cost in terms of performance.

The class does not need to be thread-safe, but the same instance will be used (through a call to extractResources(Resource, List)) to extract resources from different resources.

Version:
$Revision: 1.1 $
Author:
Francois Daoust

Method Summary
 java.util.List<Resource> extractResources(Resource resource, java.util.List<Resource> knownResources)
          Extracts additional resources from the given one.
 

Method Detail

extractResources

java.util.List<Resource> extractResources(Resource resource,
                                          java.util.List<Resource> knownResources)
Extracts additional resources from the given one.

The extracted resources may contain resources that have already been previously extracted, but known resources should not be automatically copied to the returned list.

Parameters:
resource - resource to parse.
knownResources - list of known resources.
Returns:
list of resources extracted from the resource to parse, null when no resources were extracted.