public class LessResourceHandler extends AbstractCompiledResourceHandler
Modifier and Type | Class and Description |
---|---|
private static class |
LessResourceHandler.AmetysLessSource
LessSource definition for Ametys Resources
|
Modifier and Type | Field and Description |
---|---|
private static Pattern |
__IMPORT_PATTERN |
private static String[] |
__LESS_EXTENSION |
private com.github.sommeri.less4j.core.DefaultLessCompiler |
_defaultLessCompiler |
_cocoonContext, _context, _resolver, _supportedSuffixes
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
LessResourceHandler() |
Modifier and Type | Method and Description |
---|---|
String |
compileResource(Source source)
Compile the current resource, and returns its value.
|
protected Source |
getCompiledSource(String location)
Get the compiled source uri
|
protected List<String> |
getDependenciesList(Source inputSource)
Calculate the list of dependencies for the given source, for validity calculations.
|
String |
getMimeType(Source source,
Parameters par)
Return the mime type of the configured resource.
|
int |
getPriority()
Get the priority of this handler
|
boolean |
isSupported(String source)
Determines if the resource is supported by this handler
|
Source |
setup(String location,
Parameters par)
Initialize the resource handler with a resource.
|
generateResource, getKey, getValidity
configure, contextualize, getLastModified, getSize, service
getLogger, setLogger
private static final Pattern __IMPORT_PATTERN
private static final String[] __LESS_EXTENSION
private com.github.sommeri.less4j.core.DefaultLessCompiler _defaultLessCompiler
public LessResourceHandler()
public int getPriority()
ResourceHandler
getPriority
in interface ResourceHandler
getPriority
in class AbstractResourceHandler
public boolean isSupported(String source)
ResourceHandler
isSupported
in interface ResourceHandler
isSupported
in class AbstractCompiledResourceHandler
source
- The uri of resourcetrue
if the resource is supportedprotected Source getCompiledSource(String location) throws MalformedURLException, IOException
AbstractCompiledResourceHandler
getCompiledSource
in class AbstractCompiledResourceHandler
location
- The requested locationMalformedURLException
- if location is malformed.IOException
- If an IO error occurspublic Source setup(String location, Parameters par) throws ProcessingException, IOException
ResourceHandler
setup
in interface ResourceHandler
setup
in class AbstractCompiledResourceHandler
location
- The source uripar
- The parametersProcessingException
- If an error occursIOException
- If an error occurspublic String compileResource(Source source) throws IOException, ProcessingException
AbstractCompiledResourceHandler
compileResource
in class AbstractCompiledResourceHandler
source
- The current resourceIOException
- If an IO error occursProcessingException
- If a processing error occursprotected List<String> getDependenciesList(Source inputSource)
AbstractCompiledResourceHandler
getDependenciesList
in class AbstractCompiledResourceHandler
inputSource
- The sourcepublic String getMimeType(Source source, Parameters par)
ResourceHandler
getMimeType
in interface ResourceHandler
getMimeType
in class AbstractResourceHandler
source
- The sourcepar
- The parameters