org.apache.jetspeed.util
Class HTMLRewriter
java.lang.Object
org.apache.jetspeed.util.HTMLRewriter
- public class HTMLRewriter
- extends java.lang.Object
- Version:
- 0.2
- Author:
- Ingo Rammer (rammer@sycom.at), Santiago Gala, Paul Spencer
Constructor Summary |
HTMLRewriter(boolean removeScript,
boolean removeStyle,
boolean removeNoScript,
boolean removeMeta,
boolean removeApplet,
boolean removeObject,
boolean removeHead,
boolean removeOnSomething)
Sets the parameters for the HTMLRewriter |
HTMLRewriter(boolean removeScript,
boolean removeStyle,
boolean removeNoScript,
boolean removeMeta,
boolean removeApplet,
boolean removeObject,
boolean removeHead,
boolean removeOnSomething,
boolean openInNewWindow)
Sets the parameters for the HTMLRewriter |
Method Summary |
java.lang.String |
convertURLs(java.io.Reader HTMLrdr,
java.lang.String BaseUrl)
Does the conversion of the HTML |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HTMLRewriter
public HTMLRewriter(boolean removeScript,
boolean removeStyle,
boolean removeNoScript,
boolean removeMeta,
boolean removeApplet,
boolean removeObject,
boolean removeHead,
boolean removeOnSomething)
- Sets the parameters for the HTMLRewriter
- Parameters:
removeScript
- Shall SCRIPT-Tags and their content be removedremoveStyle
- Shall STYLE-Tags and their content be removedremoveNoScript
- Shall NOSCRIPT-Tags and their content be removedremoveMeta
- Shall META-Tags be removedremoveApplet
- Shall APPLET-Tags and their content be removedremoveObject
- Shall OBJECT-Tags and their content be removedremoveHead
- Shall HEAD-Tags and their content be removedremoveOnSomething
- Shall onClick, onBlur, etc. -Attributes be removed
HTMLRewriter
public HTMLRewriter(boolean removeScript,
boolean removeStyle,
boolean removeNoScript,
boolean removeMeta,
boolean removeApplet,
boolean removeObject,
boolean removeHead,
boolean removeOnSomething,
boolean openInNewWindow)
- Sets the parameters for the HTMLRewriter
- Parameters:
removeScript
- Shall SCRIPT-Tags and their content be removedremoveStyle
- Shall STYLE-Tags and their content be removedremoveNoScript
- Shall NOSCRIPT-Tags and their content be removedremoveMeta
- Shall META-Tags be removedremoveApplet
- Shall APPLET-Tags and their content be removedremoveObject
- Shall OBJECT-Tags and their content be removedremoveHead
- Shall HEAD-Tags and their content be removedremoveOnSomething
- Shall onClick, onBlur, etc. -Attributes be removed
convertURLs
public java.lang.String convertURLs(java.io.Reader HTMLrdr,
java.lang.String BaseUrl)
throws java.net.MalformedURLException
- Does the conversion of the HTML
- Parameters:
HTMLrdr
- Reader for HTML to be convertedBaseUrl
- URL from which this HTML was taken. We be the base-Url
for all URL-rewritings.
- Returns:
- HTML-String with rewritten URLs and removed (according
to constructor-settings) tags
- Throws:
java.net.MalformedURLException
- If the BaseUrl is not a valid URL or if an URL inside
the document could not be converted. Should not happen
normally, even in badly formatted HTML.
Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.