|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.w3c.mwi.mobileok.basic.ImageResourceExtractor
public class ImageResourceExtractor
Extracts all image resources embedded in the given XHTML resource.
In practice, it means the resources identified by the src
attribute of the img elements, except those that are defined
as a potential fallback of object elements.
The specific case of img elements defined within
object elements is handled in ObjectResourceExtractor,
because the tests on images defined in the mobileOK specification only apply
to images that would be take part of the final representation of the resource.
See Included
resources for more details.
URIs whose scheme is not supported are ignored. As far as mobileOK
is concerned, this means that URIs must use the scheme HTTP
or HTTPS, but note the code actually relies on the list of
ResourceRetriever defined in TesterConfiguration.
| Constructor Summary | |
|---|---|
ImageResourceExtractor()
Default constructor. |
|
| Method Summary | |
|---|---|
private java.util.List<java.net.URI> |
extractImages(java.net.URI baseURI,
org.w3c.dom.Document theDOM)
Extracts the list of URIs of the images referenced in the given DOM document. |
java.util.List<Resource> |
extractResources(Resource resource,
java.util.List<Resource> knownResources)
Extracts additional resources from the given one. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImageResourceExtractor()
| Method Detail |
|---|
public java.util.List<Resource> extractResources(Resource resource,
java.util.List<Resource> knownResources)
ResourceExtractorThe extracted resources may contain resources that have already been previously extracted, but known resources should not be automatically copied to the returned list.
extractResources in interface ResourceExtractorresource - resource to parse.knownResources - list of known resources.
null when no resources were extracted.
private java.util.List<java.net.URI> extractImages(java.net.URI baseURI,
org.w3c.dom.Document theDOM)
Such images are defined in the src attribute of the
img elements.
baseURI - base URI against which relative URIS should be resolved.theDOM - the DOM document to parse.
TestException - an unexpected error occurred.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||