org.jasig.portal.utils
Class AbsoluteURLFilter
java.lang.Object
org.jasig.portal.utils.SAX2FilterImpl
org.jasig.portal.utils.AbsoluteURLFilter
- All Implemented Interfaces:
- ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler, XMLFilter, XMLReader
- Direct Known Subclasses:
- WMLURLFilter, XHTMLURLFilter
public abstract class AbsoluteURLFilter
- extends SAX2FilterImpl
Replaces all relative URLs with absolute URLs.
- Version:
- $Revision: 19776 $
- Author:
- Ken Weiner, kweiner@unicon.net
|
Constructor Summary |
protected |
AbsoluteURLFilter(ContentHandler handler)
A constructor which receives a ContentHandler to which
filtered SAX events are passed |
| Methods inherited from class org.jasig.portal.utils.SAX2FilterImpl |
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setAllHandlers, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setLexicalHandler, setParent, setProperty, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
baseUrl
protected String baseUrl
AbsoluteURLFilter
protected AbsoluteURLFilter(ContentHandler handler)
- A constructor which receives a ContentHandler to which
filtered SAX events are passed
- Parameters:
handler - the ContentHandler to which filtered SAX events are passed
newAbsoluteURLFilter
public static final AbsoluteURLFilter newAbsoluteURLFilter(String mimeType,
String baseUrl,
ContentHandler handler)
throws PortalException
- A factory method that uses a mime type to decide which kind of
AbsoluteURLFilter to instantiate. There are currently two types
of markup supported: XHTML and WML.
- Parameters:
mimeType - the mime type of the markup that this filter will apply tobaseUrl - the base URL to be prepended to relative URL pathshandler - the ContentHandler to which to pass along filtered SAX events
- Returns:
- filter the AbsoluteURLFilter matching the mimeType
- Throws:
PortalException
setBaseUrl
protected void setBaseUrl(String url)
- Sets the base URL.
- Parameters:
url - the new base URL
fixURL
protected final void fixURL(String elementName,
String attName,
String qName,
Attributes atts,
AttributesImpl attsImpl)
- A helper method for derivitive classes to easily fix an attribute
that has a relative URL value
- Parameters:
elementName - the element name containing an attribute of name attNameattName - the name of the attribute of elementNameqName - the name of the current elementatts - the attibutes of the current elementattsImpl - the attributes implementation to contain the new attribute value
Copyright © 2010 Jasig. All Rights Reserved.