websphinx
Class MirrorTransformer

java.lang.Object
  |
  +--websphinx.HTMLTransformer
        |
        +--websphinx.LinkTransformer
              |
              +--websphinx.RewritableLinkTransformer
                    |
                    +--websphinx.MirrorTransformer

class MirrorTransformer
extends RewritableLinkTransformer


Field Summary
(package private)  Mirror mirror
           
 
Fields inherited from class websphinx.RewritableLinkTransformer
BUFFER_SIZE, closed, file, head, PLACEHOLDER, tail
 
Fields inherited from class websphinx.LinkTransformer
base, emitBaseElement, map, needToEmitBase
 
Fields inherited from class websphinx.HTMLTransformer
content, emitEnd, emitStart, next, openedStream, readwrite, stream, transformEnd
 
Constructor Summary
MirrorTransformer(Mirror mirror, java.io.File file)
           
 
Method Summary
 boolean isMapped(java.net.URL url)
          Test whether a URL is mapped.
 java.lang.String lookup(java.net.URL base, java.net.URL url)
          Look up the href for a URL, taking any mapping into account.
 void map(java.net.URL remoteURL, java.lang.String href)
          Map a URL to an href.
 void map(java.net.URL remoteURL, java.net.URL url)
          Map a URL to a new URL.
 
Methods inherited from class websphinx.RewritableLinkTransformer
addURL, close, handleLink, rewrite
 
Methods inherited from class websphinx.LinkTransformer
getBase, getEmitBaseElement, handleBase, handleElement, setBase, setEmitBaseElement, writePage
 
Methods inherited from class websphinx.HTMLTransformer
emit, emit, emitInternal, emitPendingRegion, finalize, flush, getFilePointer, getOutput, getRandomAccessFile, openFile, processElementsInRegion, seek, setOutput, setOutput, setRandomAccessFile, transformContents, transformElement, write, write, writeStream
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

mirror

Mirror mirror
Constructor Detail

MirrorTransformer

public MirrorTransformer(Mirror mirror,
                         java.io.File file)
                  throws java.io.IOException
Method Detail

lookup

public java.lang.String lookup(java.net.URL base,
                               java.net.URL url)
Description copied from class: LinkTransformer
Look up the href for a URL, taking any mapping into account.
Overrides:
lookup in class LinkTransformer
Following copied from class: websphinx.LinkTransformer
Parameters:
base - base URL (or null if an absolute URL is desired)
url - URL of interest
Returns:
relative href for url from base

map

public void map(java.net.URL remoteURL,
                java.lang.String href)
Description copied from class: LinkTransformer
Map a URL to an href. For example, Concatenator uses this call to map page URLs to their corresponding anchors in the concatenation.
Overrides:
map in class LinkTransformer
Following copied from class: websphinx.LinkTransformer
Parameters:
url - URL of interest
href - href which should be returned by lookup (null, url)

map

public void map(java.net.URL remoteURL,
                java.net.URL url)
Description copied from class: LinkTransformer
Map a URL to a new URL. For example, Mirror uses this call to map remote URLs to their corresponding local URLs.
Overrides:
map in class LinkTransformer
Following copied from class: websphinx.LinkTransformer
Parameters:
url - URL of interest
newURL - URL which should be returned by lookup (null, url)

isMapped

public boolean isMapped(java.net.URL url)
Description copied from class: LinkTransformer
Test whether a URL is mapped.
Overrides:
isMapped in class LinkTransformer
Following copied from class: websphinx.LinkTransformer
Parameters:
url - URL of interest
Returns:
true if map () was called to remap url