com.metaweb.lessen.tokenizers
Class UrlRewritingTokenizer

java.lang.Object
  extended by com.metaweb.lessen.tokenizers.UrlRewritingTokenizer
All Implemented Interfaces:
Tokenizer

public class UrlRewritingTokenizer
extends Object
implements Tokenizer


Field Summary
protected  String _relativePath
           
protected  String[] _segments
           
protected  Token _token
           
protected  Tokenizer _tokenizer
           
 
Constructor Summary
UrlRewritingTokenizer(Tokenizer tokenizer, String relativePath)
          relativePath specifies how to get from the output CSS's URL to the input CSS's URL.
 
Method Summary
 Token getToken()
           
 void next()
           
protected  void resolve()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_tokenizer

protected final Tokenizer _tokenizer

_relativePath

protected final String _relativePath

_segments

protected final String[] _segments

_token

protected Token _token
Constructor Detail

UrlRewritingTokenizer

public UrlRewritingTokenizer(Tokenizer tokenizer,
                             String relativePath)
relativePath specifies how to get from the output CSS's URL to the input CSS's URL. For example, say the input CSS is served at some-path/modules/foo/styles/detail-page.css which is to be bundled with other CSS files to produce a CSS bundle to be served at some-path/bundles/foo.css then the relative path is ../modules/foo/styles/ because from foo.css, we need to go up one directory level to some-path, and then down modules/foo/styles/ to get to detail-page.css. If detail-page.css contains url(../images/watermark.png) then it'll be resolved to url(../modules/foo/images/watermark.png) in foo.css so that foo.css effectively references the same image.

Parameters:
tokenizer -
relativePath -
Method Detail

getToken

public Token getToken()
Specified by:
getToken in interface Tokenizer

next

public void next()
Specified by:
next in interface Tokenizer

resolve

protected void resolve()


Copyright © 2011. All Rights Reserved.