|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.mwi.mobileok.basic.LinkedResourceExtractor
public class LinkedResourceExtractor
Extracts all linked resources from a given XHTML resource.
The notion of linked resource is to be understood as a resource linked to from the XHTML resource being parsed (other than the resource itself), but which does not take part in the rendering of that resource.
In practice, it means the resources identified by the href
attribute of the a
elements, and by the action
attribute of form
elements whose method
attribute
is set to "get" (or is not set).
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 | |
---|---|
LinkedResourceExtractor()
Default constructor. |
Method Summary | |
---|---|
private java.util.List<java.net.URI> |
extractLinks(java.net.URI baseURI,
org.w3c.dom.Document theDOM)
Extracts the list of URIs of the links defined 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 LinkedResourceExtractor()
Method Detail |
---|
public java.util.List<Resource> extractResources(Resource resource, java.util.List<Resource> knownResources)
ResourceExtractor
The 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 ResourceExtractor
resource
- resource to parse.knownResources
- list of known resources.
null
when no resources were extracted.private java.util.List<java.net.URI> extractLinks(java.net.URI baseURI, org.w3c.dom.Document theDOM)
Such links are defined in:
a
elementsform
elements (in which case a default submission URI
is computed)
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 |