ro.isdc.wro.extensions.processor.css
Class CssLintProcessor

java.lang.Object
  extended by ro.isdc.wro.extensions.processor.css.CssLintProcessor
All Implemented Interfaces:
ResourcePostProcessor, ResourcePreProcessor

@SupportedResourceType(value=CSS)
public class CssLintProcessor
extends Object
implements ResourcePreProcessor, ResourcePostProcessor

Processor which analyze the css code and warns you found problems. The processing result won't change no matter if the processed script contains errors or not. The underlying implementation uses CSSLint script utility ://github.com/stubbornella/csslint.

Since:
1.3.8
Author:
Alex Objelean

Field Summary
static String ALIAS
           
 
Constructor Summary
CssLintProcessor()
           
 
Method Summary
protected  CssLint newCssLint()
           
protected  void onCssLintException(CssLintException e, Resource resource)
          Called when CssLintException is thrown.
 void process(Reader reader, Writer writer)
          
 void process(Resource resource, Reader reader, Writer writer)
          
 CssLintProcessor setOptions(String... options)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIAS

public static final String ALIAS
See Also:
Constant Field Values
Constructor Detail

CssLintProcessor

public CssLintProcessor()
Method Detail

setOptions

public CssLintProcessor setOptions(String... options)

process

public void process(Resource resource,
                    Reader reader,
                    Writer writer)
             throws IOException

Specified by:
process in interface ResourcePreProcessor
Throws:
IOException

newCssLint

protected CssLint newCssLint()
Returns:
CssLint instance.

process

public void process(Reader reader,
                    Writer writer)
             throws IOException

Specified by:
process in interface ResourcePostProcessor
Throws:
IOException

onCssLintException

protected void onCssLintException(CssLintException e,
                                  Resource resource)
                           throws Exception
Called when CssLintException is thrown. Allows subclasses to re-throw this exception as a RuntimeException or handle it differently.

Parameters:
e - CssLintException which has occurred.
resource - the processed resource which caused the exception.
Throws:
Exception


Copyright © 2008-2012. All Rights Reserved.