|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.erowid.sperowider.htmlshredding.URLMongler
This abstract class provides "URL Mongling" functionality for any of several kind of data sources, including
URLs, files, input streams,
among others. When the mongle
method is called it will parse the data from that source, and
call the abstract urlFound(String, MongledURLType)
method whenever it finds a URL. The implementing class must
return a new value for that URL (even if it's the same as the old value). This class will replace the originally
found URL with the new value. Finally, the mongle() method will return an HTMLShredder
object
with the new URL values inserted.
Field Summary | |
static MongledURLType |
ACTION
Indicates a URL found as an action attribute of a tag |
static MongledURLType |
BACKGROUND
Indicates a URL found as a background attribute of a tag |
static MongledURLType |
HREF
Indicates a URL found as an href attribute of a tag |
static MongledURLType |
JAVASCRIPT_EVENT
Indicates a URL found as an action attribute of a tag |
static MongledURLType |
OPTION
Indicates a URL found as a value of an option tag |
static MongledURLType |
SRC
Indicates a URL found as a src attribute of a tag |
Constructor Summary | |
URLMongler()
|
Method Summary | |
HTMLShredder |
mongle(BufferedReader reader)
Delegates to mongle(HTMLShredder) . |
HTMLShredder |
mongle(File file)
Delegates to mongle(HTMLShredder) . |
HTMLShredder |
mongle(HTMLShredder shredder)
Calls urlFound(String, MongledURLType) whenever a URL is found, and replaces it with the
value returned by that method. |
HTMLShredder |
mongle(InputStream is)
Delegates to mongle(HTMLShredder) . |
HTMLShredder |
mongle(String filename)
Delegates to mongle(HTMLShredder) . |
HTMLShredder |
mongle(URL url)
Delegates to mongle(HTMLShredder) . |
abstract String |
urlFound(String url,
MongledURLType type)
This method is called when a URL is found in the shredded HTML. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final MongledURLType HREF
public static final MongledURLType SRC
public static final MongledURLType BACKGROUND
public static final MongledURLType OPTION
public static final MongledURLType ACTION
public static final MongledURLType JAVASCRIPT_EVENT
Constructor Detail |
public URLMongler()
Method Detail |
public abstract String urlFound(String url, MongledURLType type)
public HTMLShredder mongle(URL url) throws IOException
mongle(HTMLShredder)
.
IOException
public HTMLShredder mongle(String filename) throws FileNotFoundException
mongle(HTMLShredder)
.
FileNotFoundException
public HTMLShredder mongle(File file) throws FileNotFoundException
mongle(HTMLShredder)
.
FileNotFoundException
public HTMLShredder mongle(InputStream is)
mongle(HTMLShredder)
.
public HTMLShredder mongle(BufferedReader reader)
mongle(HTMLShredder)
.
public HTMLShredder mongle(HTMLShredder shredder)
urlFound(String, MongledURLType)
whenever a URL is found, and replaces it with the
value returned by that method.
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |