public class MinimizeSassManager extends AbstractLogEnabled implements Component, Serviceable, Initializable, Contextualizable
Modifier and Type | Field and Description |
---|---|
private Context |
_context |
private io.bit3.jsass.Compiler |
_jsassCompiler |
private JSASSResourceURIExtensionPoint |
_jsassResourceURIExtensionPoint |
private ProxiedContextPathProvider |
_proxiedContextPathProvider |
private SourceResolver |
_resolver |
private List<SassFunctionsProvider> |
_sassFunctionsProviders |
private SourceMapCache |
_sourceMapCache |
static String |
ROLE
The avalon ROLE
|
Constructor and Description |
---|
MinimizeSassManager() |
Modifier and Type | Method and Description |
---|---|
private io.bit3.jsass.Output |
_compileCss(String content,
String fileName,
URI uri,
boolean minimize,
String extension)
Compile a SCSS and output the JSASS result containing the content and source map
|
String |
compileCss(String content,
String sassLocation,
String location,
boolean minimize,
long lastModified)
Compile a sass file.
|
void |
contextualize(Context context) |
String |
generateCssSourceMap(String content,
String location,
String extension,
String internalContextPath,
String externalContextPath,
boolean minimize,
long lastModified)
Generate the source map of compiled sass file.
|
void |
initialize() |
void |
service(ServiceManager smanager) |
getLogger, setLogger
private io.bit3.jsass.Compiler _jsassCompiler
private JSASSResourceURIExtensionPoint _jsassResourceURIExtensionPoint
private SourceResolver _resolver
private List<SassFunctionsProvider> _sassFunctionsProviders
private SourceMapCache _sourceMapCache
private ProxiedContextPathProvider _proxiedContextPathProvider
public MinimizeSassManager()
public void initialize() throws Exception
initialize
in interface Initializable
Exception
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
ServiceException
public String compileCss(String content, String sassLocation, String location, boolean minimize, long lastModified) throws URISyntaxException, io.bit3.jsass.CompilationException
content
- The content of the sass filesassLocation
- The location of the sass file, e.g. plugin:core-ui:/resources/example/test.scsslocation
- The location of the compiled css, e.g. plugin:core-ui:/resources/example/test.css or plugin:core-ui:/resources/example/test.min.cssminimize
- Minimize the outputlastModified
- The date of last modificationURISyntaxException
- If an exception occurredio.bit3.jsass.CompilationException
- If an exception occurredpublic String generateCssSourceMap(String content, String location, String extension, String internalContextPath, String externalContextPath, boolean minimize, long lastModified) throws URISyntaxException, io.bit3.jsass.CompilationException
content
- The content of the filelocation
- The location of the source map file, e.g. plugin:core-ui:/resources/example/test.scss.map or plugin:core-ui:/resources/example/test.css.mapextension
- The extension of the sass file, e.g. scss or sassinternalContextPath
- The internal context pathexternalContextPath
- The external context pathminimize
- Minimize the outputlastModified
- The date of last modificationURISyntaxException
- If an exception occurredio.bit3.jsass.CompilationException
- If an exception occurredprivate io.bit3.jsass.Output _compileCss(String content, String fileName, URI uri, boolean minimize, String extension) throws URISyntaxException, io.bit3.jsass.CompilationException
content
- The content of the filefileName
- The name of the compiled sass file, e.g. test.css or test.min.cssuri
- The contextualized uri of the sass file, e.g. /EXTERNAL_CONTEXT/plugins/core-ui/resources/example/test.scssminimize
- Minimize the outputextension
- The sass extension such as scss or sassURISyntaxException
- if an error occurred with the uri syntaxio.bit3.jsass.CompilationException
- if an error occured when compiling the sass