public class SassResourceHandler extends AbstractCompiledResourceHandler
Modifier and Type | Field and Description |
---|---|
private static String[] |
__SASS_EXTENSION |
protected ProxiedContextPathProvider |
_proxiedContextPathProvider
Proxied context path provider
|
protected ResourceDependenciesListExtensionPoint |
_resourceDependenciesListEP
ResourceDependenciesListExtensionPoint
|
protected SassImportHelper |
_sassImportHelper
Sass import helper
|
protected MinimizeSassManager |
_sassMinimizeManager
CSS minimize manager
|
private static String |
ADDITIONAL_PARAMETER_LOCATION |
private static String |
ADDITIONAL_PARAMETER_MINIMIZE |
private static String |
ADDITIONAL_PARAMETER_SASS_LOCATION |
_cocoonContext, _context, _resolver, _supportedSuffixes
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
SassResourceHandler() |
Modifier and Type | Method and Description |
---|---|
void |
generateResource(Source resource,
OutputStream out,
Map objectModel,
Parameters parameters,
Map<String,Object> additionalParameters)
Generate the resource configured during setup, and output it
|
protected List<String> |
getDependenciesList(Source inputSource)
Calculate the list of dependencies for the given source, for validity calculations.
|
Serializable |
getKey(Source source,
Map objectModel,
Parameters parameters,
Map<String,Object> additionalParameters)
Get the unique key for this resource, for cache purpose.
|
String |
getMimeType(Source source,
Parameters par)
Return the mime type of the configured resource.
|
int |
getPriority()
Get the priority of this handler
|
protected Source |
getSourceToCompile(String location,
Map<String,Object> additionalParameters)
Get the compiled source uri
|
boolean |
isSupported(String source)
Determines if the resource is supported by this handler
|
void |
service(ServiceManager manager) |
Source |
setup(String location,
Map objectModel,
Parameters par,
Map<String,Object> additionalParameters)
Initialize the resource handler with a resource.
|
_isBasicallySupported, getValidity
configure, contextualize, getLastModified, getSize
getLogger, setLogger
private static final String[] __SASS_EXTENSION
private static final String ADDITIONAL_PARAMETER_LOCATION
private static final String ADDITIONAL_PARAMETER_SASS_LOCATION
private static final String ADDITIONAL_PARAMETER_MINIMIZE
protected ResourceDependenciesListExtensionPoint _resourceDependenciesListEP
protected MinimizeSassManager _sassMinimizeManager
protected SassImportHelper _sassImportHelper
protected ProxiedContextPathProvider _proxiedContextPathProvider
public SassResourceHandler()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
service
in class AbstractResourceHandler
ServiceException
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 getSourceToCompile(String location, Map<String,Object> additionalParameters) throws MalformedURLException, IOException
AbstractCompiledResourceHandler
getSourceToCompile
in class AbstractCompiledResourceHandler
location
- The requested locationadditionalParameters
- Additional parameters to fill, that will be transmitted to the generate methodMalformedURLException
- if location is malformed.IOException
- If an IO error occurspublic Source setup(String location, Map objectModel, Parameters par, Map<String,Object> additionalParameters) throws ProcessingException, IOException
ResourceHandler
setup
in interface ResourceHandler
setup
in class AbstractCompiledResourceHandler
location
- The source uriobjectModel
- The object modelpar
- The parametersadditionalParameters
- Additional parameters that can be filled, and will be transmitted to getKey, getValidity and generateResourceProcessingException
- If an error occursIOException
- If an error occurspublic void generateResource(Source resource, OutputStream out, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters) throws IOException, ProcessingException
ResourceHandler
resource
- The sourceout
- The output stream to write toobjectModel
- The object modelparameters
- The sitemap parametersadditionalParameters
- Additional parametersIOException
- If an error occursProcessingException
- If an 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 parameterspublic Serializable getKey(Source source, Map objectModel, Parameters parameters, Map<String,Object> additionalParameters)
ResourceHandler
getKey
in interface ResourceHandler
getKey
in class AbstractCompiledResourceHandler
source
- The sourceobjectModel
- The object modelparameters
- The parametersadditionalParameters
- Additional parameters