com.asual.lesscss.loader
Class CssProcessingResourceLoader

java.lang.Object
  extended by com.asual.lesscss.loader.CssProcessingResourceLoader
All Implemented Interfaces:
ResourceLoader

public class CssProcessingResourceLoader
extends Object
implements ResourceLoader

A ResourceLoader that allows using lesscss @include in plain .css files. Multiple levels of nesting are achieved by combining these two actions:

  1. When a resource is loaded all .css strings are replaced with .less
  2. When a .less include file is requested and it does not exist, the extension is changed to .css and lookup is retried.

Author:
RafaƂ Krzewski

Constructor Summary
CssProcessingResourceLoader(ResourceLoader delegate)
           
 
Method Summary
 boolean exists(String path)
          Checks if the given resource exists.
 String load(String path, String charset)
          Loads the given resource's contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CssProcessingResourceLoader

public CssProcessingResourceLoader(ResourceLoader delegate)
Method Detail

exists

public boolean exists(String path)
               throws IOException
Description copied from interface: ResourceLoader
Checks if the given resource exists.

Specified by:
exists in interface ResourceLoader
Parameters:
path - resource path.
Returns:
true if the resource exists.
Throws:
IOException - when i/o error occurs while checking for resource existence.

load

public String load(String path,
                   String charset)
            throws IOException
Description copied from interface: ResourceLoader
Loads the given resource's contents.

Specified by:
load in interface ResourceLoader
Parameters:
path - resource path.
charset - character set name, valid with respect to Charset.
Returns:
resource contents as a string.
Throws:
IOException - when i/o error occurs while loading the resource, or charset is invalid.


Copyright © 2013 Asual DZZD. All Rights Reserved.