| org.apache.jetspeed.rewriter.Rewriter
All known Subclasses: org.apache.jetspeed.rewriter.WebContentRewriter, org.apache.jetspeed.rewriter.BasicRewriter, org.apache.jetspeed.rewriter.AbstractRewriter,
Rewriter | public interface Rewriter (Code) | | Rewriter
author: David Sean Taylor version: $Id: Rewriter.java 516448 2007-03-09 16:25:47Z ate $ |
Method Summary | |
void | enterConvertTagEvent(String tag, MutableAttributes attrs) Rewriter event called back just before tag conversion (rewriter callbacks) begins by the ParserAdaptor. | boolean | enterEndTagEvent(String tag) Rewriter event called back on the leading edge of processing an end tag by the ParserAdaptor.
Returns false to indicate to the ParserAdaptor to short-circuit processing on this tag.
Parameters: tag - The name of the tag being processed. Parameters: attrs - The attribute list for the tag. | boolean | enterSimpleTagEvent(String tag, MutableAttributes attrs) Rewriter event called back on the leading edge of processing a simple tag by the ParserAdaptor.
Returns false to indicate to the ParserAdaptor to short-circuit processing on this tag.
Parameters: tag - The name of the tag being processed. Parameters: attrs - The attribute list for the tag. | boolean | enterStartTagEvent(String tag, MutableAttributes attrs) Rewriter event called back on the leading edge of processing a start tag by the ParserAdaptor.
Returns false to indicate to the ParserAdaptor to short-circuit processing on this tag.
Parameters: tag - The name of the tag being processed. Parameters: attrs - The attribute list for the tag. | boolean | enterText(char[] values, int param) Rewriter event called back when text is found for
Returns false to indicate to the ParserAdaptor to short-circuit processing on this tag. | String | exitEndTagEvent(String tag) Rewriter event called back on the trailing edge of a end tag by the ParserAdaptor.
Returns a String that can be appended to the rewritten output for the given tag, or null to indicate no content available. | String | exitSimpleTagEvent(String tag, MutableAttributes attrs) Rewriter event called back on the trailing edge of a simple tag by the ParserAdaptor.
Returns a String that can be appended to the rewritten output for the given tag, or null to indicate no content available. | String | exitStartTagEvent(String tag, MutableAttributes attrs) Rewriter event called back on the trailing edge of a start tag by the ParserAdaptor.
Returns a String that can be appended to the rewritten output for the given tag, or null to indicate no content available. | String | getBaseRelativeUrl(String path) | String | getBaseUrl() Gets the base URL for rewriting. | boolean | getUseProxy() Gets whether this rewriter require a proxy server. | void | parse(ParserAdaptor adaptor, Reader reader) Parses the reader of content receiving call backs for rewriter events.
This method does not rewrite, but only parses. | void | rewrite(ParserAdaptor adaptor, Reader reader, Writer writer) Parses the reader of content receiving call backs for rewriter events.
The content is rewritten to the output stream.
The configured parser can parse over different stream formats returning a
normalized (org.sax.xml) attribute and element based events. | String | rewriteUrl(String url, String tag, String attribute) This event is the inteface between the Rewriter and ParserAdaptor for rewriting URLs.
The ParserAdaptor calls back the Rewriter when it finds a URL that is a candidate to be
rewritten. | void | setBaseUrl(String base) Sets the base URL for rewriting. | void | setUseProxy(boolean useProxy) Set whether this rewriter require a proxy server. | boolean | shouldRemoveComments() Returns true if all comments should be removed. | boolean | shouldRemoveTag(String tag) Returns true if the tag should be removed, otherwise false. | boolean | shouldStripTag(String tag) Returns true if the tag should be stripped, otherwise false. |
enterConvertTagEvent | void enterConvertTagEvent(String tag, MutableAttributes attrs)(Code) | | Rewriter event called back just before tag conversion (rewriter callbacks) begins by the ParserAdaptor.
Parameters: tag - The name of the tag being processed. Parameters: attrs - The attribute list for the tag. |
enterEndTagEvent | boolean enterEndTagEvent(String tag)(Code) | | Rewriter event called back on the leading edge of processing an end tag by the ParserAdaptor.
Returns false to indicate to the ParserAdaptor to short-circuit processing on this tag.
Parameters: tag - The name of the tag being processed. Parameters: attrs - The attribute list for the tag. Should return true to continue processing the tag in the ParserAdaptor, false to indicate that processing is completed. |
enterSimpleTagEvent | boolean enterSimpleTagEvent(String tag, MutableAttributes attrs)(Code) | | Rewriter event called back on the leading edge of processing a simple tag by the ParserAdaptor.
Returns false to indicate to the ParserAdaptor to short-circuit processing on this tag.
Parameters: tag - The name of the tag being processed. Parameters: attrs - The attribute list for the tag. Should return true to continue processing the tag in the ParserAdaptor, false to indicate that processing is completed. |
enterStartTagEvent | boolean enterStartTagEvent(String tag, MutableAttributes attrs)(Code) | | Rewriter event called back on the leading edge of processing a start tag by the ParserAdaptor.
Returns false to indicate to the ParserAdaptor to short-circuit processing on this tag.
Parameters: tag - The name of the tag being processed. Parameters: attrs - The attribute list for the tag. Should return true to continue processing the tag in the ParserAdaptor, false to indicate that processing is completed. |
enterText | boolean enterText(char[] values, int param)(Code) | | Rewriter event called back when text is found for
Returns false to indicate to the ParserAdaptor to short-circuit processing on this tag.
Parameters: values - an array of characters containing the text. Parameters: param - Should return true to continue processing the tag in the ParserAdaptor, false to indicate that processing is completed. |
exitEndTagEvent | String exitEndTagEvent(String tag)(Code) | | Rewriter event called back on the trailing edge of a end tag by the ParserAdaptor.
Returns a String that can be appended to the rewritten output for the given tag, or null to indicate no content available.
Parameters: tag - The name of the tag being processed. Parameters: attrs - The attribute list for the tag. Returns a String that can be appended to the rewritten output for the given tag, or null to indicate no content available. |
exitSimpleTagEvent | String exitSimpleTagEvent(String tag, MutableAttributes attrs)(Code) | | Rewriter event called back on the trailing edge of a simple tag by the ParserAdaptor.
Returns a String that can be appended to the rewritten output for the given tag, or null to indicate no content available.
Parameters: tag - The name of the tag being processed. Parameters: attrs - The attribute list for the tag. Returns a String that can be appended to the rewritten output for the given tag, or null to indicate no content available. |
exitStartTagEvent | String exitStartTagEvent(String tag, MutableAttributes attrs)(Code) | | Rewriter event called back on the trailing edge of a start tag by the ParserAdaptor.
Returns a String that can be appended to the rewritten output for the given tag, or null to indicate no content available.
Parameters: tag - The name of the tag being processed. Parameters: attrs - The attribute list for the tag. Returns a String that can be appended to the rewritten output for the given tag, or null to indicate no content available. |
getBaseRelativeUrl | String getBaseRelativeUrl(String path)(Code) | | Gets a new URL relative to Base according to the site / and URL
rewriting rules of java.net.URL
The new URL from path, relative to the base URL (or path, if path is absolute) |
getBaseUrl | String getBaseUrl()(Code) | | Gets the base URL for rewriting. This URL is the base
from which other URLs are generated.
The base URL for this rewriter |
getUseProxy | boolean getUseProxy()(Code) | | Gets whether this rewriter require a proxy server.
true if it requires a proxy |
parse | void parse(ParserAdaptor adaptor, Reader reader) throws RewriterException(Code) | | Parses the reader of content receiving call backs for rewriter events.
This method does not rewrite, but only parses. Useful for readonly operations.
The configured parser can parse over different stream formats returning a
normalized (org.sax.xml) attribute and element based events.
Parameters: adaptor - the parser adaptor which handles generating SAX-like events called back on this object. Parameters: reader - the input stream over the content to be parsed. exception: RewriteException - when a parsing error occurs or unexpected content is found. |
rewrite | void rewrite(ParserAdaptor adaptor, Reader reader, Writer writer) throws RewriterException(Code) | | Parses the reader of content receiving call backs for rewriter events.
The content is rewritten to the output stream.
The configured parser can parse over different stream formats returning a
normalized (org.sax.xml) attribute and element based events.
Parameters: adaptor - the parser adaptor which handles generating SAX-like events called back on this object. Parameters: reader - the input stream over the content to be parsed. Parameters: writer - the output stream where content is rewritten to. exception: RewriteException - when a parsing error occurs or unexpected content is found. |
rewriteUrl | String rewriteUrl(String url, String tag, String attribute)(Code) | | This event is the inteface between the Rewriter and ParserAdaptor for rewriting URLs.
The ParserAdaptor calls back the Rewriter when it finds a URL that is a candidate to be
rewritten. The Rewriter rewrites the URL and returns it as the result of this function.
Parameters: url - the URL to be rewritten Parameters: tag - The tag being processed Parameters: attribute - The current attribute being processsed |
setBaseUrl | void setBaseUrl(String base)(Code) | | Sets the base URL for rewriting. This URL is the base
from which other URLs are generated.
Parameters: base - The base URL for this rewriter |
setUseProxy | void setUseProxy(boolean useProxy)(Code) | | Set whether this rewriter require a proxy server.
Parameters: useProxy - true if it requires a proxy |
shouldRemoveComments | boolean shouldRemoveComments()(Code) | | Returns true if all comments should be removed.
true If all comments should be removed. |
shouldRemoveTag | boolean shouldRemoveTag(String tag)(Code) | | Returns true if the tag should be removed, otherwise false.
Removing a tag only removes the tag but not the contents in
between the start and end tag.
true if the tag should be removed. |
shouldStripTag | boolean shouldStripTag(String tag)(Code) | | Returns true if the tag should be stripped, otherwise false.
Stripping tags removes the start and end tag, plus all tags
and content in between the start and end tag.
true if the tag should be stripped. |
|
|