com.raritantechnologies.HTML.filter
Class AddBaseURLFilter

java.lang.Object
  extended bycom.raritantechnologies.HTML.filter.AddBaseURLFilter
All Implemented Interfaces:
HTMLEventProcessor, IConfigurable

public class AddBaseURLFilter
extends java.lang.Object
implements HTMLEventProcessor

EventProcessor element of an HTMLFilter. Prepends a base URL to src and href attributes of HTML Simple and Start Tags. Very useful for "fixing" pages with many relative links, for example with an RTI PageImportRenderer.

XML Configuration Template:
  <EventProcessor class="com.raritantechnologies.HTML.filter.AddBaseURLFilter"
                     baseURL="[ the base URL ]" >
     <!-- Optional comparator to selectively add baseURL to href or src values -->
     <Comparator class="[ class of com.raritantechnologies.utils.comparators.IComparator ]" >
         <!-- configuration parameters for comparator -->
     </Comparator>
  </EventProcessor>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Constructor Summary
AddBaseURLFilter()
           
AddBaseURLFilter(java.lang.String baseURL)
           
AddBaseURLFilter(java.lang.String baseURL, java.util.Comparator urlComp)
           
 
Method Summary
 java.lang.String getBaseURL()
           
 java.util.Comparator getComparator()
           
 java.lang.String getConfigurationXML()
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 java.util.ArrayList processEvents(java.util.ArrayList events)
          Process a list of HTMLEvents return a modified list.
 void setBaseURL(java.lang.String baseURL)
           
 void setComparator(java.util.Comparator urlComp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddBaseURLFilter

public AddBaseURLFilter()

AddBaseURLFilter

public AddBaseURLFilter(java.lang.String baseURL)

AddBaseURLFilter

public AddBaseURLFilter(java.lang.String baseURL,
                        java.util.Comparator urlComp)
Method Detail

processEvents

public java.util.ArrayList processEvents(java.util.ArrayList events)
Description copied from interface: HTMLEventProcessor
Process a list of HTMLEvents return a modified list.

Specified by:
processEvents in interface HTMLEventProcessor
Returns:
Modified list of HTMLEvent objects.

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable

setBaseURL

public void setBaseURL(java.lang.String baseURL)

getBaseURL

public java.lang.String getBaseURL()

setComparator

public void setComparator(java.util.Comparator urlComp)

getComparator

public java.util.Comparator getComparator()

getConfigurationXML

public java.lang.String getConfigurationXML()