public abstract class SassContext extends Object
A Sass context can be obtained either by passing a file or a SCSS string definition.
SassFileContext.create(java.nio.file.Path),
SassDataContext.create(java.io.InputStream)| Modifier and Type | Field and Description |
|---|---|
protected com.cathive.sass.jna.SassLibrary.Sass_Context |
$context
Underlying native Sass context.
|
protected SassOptions |
options
Underlying native Sass options associated with the data or file context.
|
| Modifier | Constructor and Description |
|---|---|
protected |
SassContext(com.cathive.sass.jna.SassLibrary.Sass_Context $context,
boolean standalone)
Creates a new Sass context wrapper instance.
|
| Modifier and Type | Method and Description |
|---|---|
String |
compile()
Performs compilation of the SCSS data that is represented by this Sass context.
|
void |
compile(OutputStream outputStream)
Performs compilation of the SCSS data that is represented by this Sass context.
|
protected abstract com.cathive.sass.jna.SassLibrary.Sass_Compiler |
createCompiler()
Creates a native Sass compiler instance.
|
protected void |
finalize() |
SassOptions |
getOptions()
Returns the options associated with this Sass context.
|
void |
setOptions(SassOptions options) |
protected void |
throwCompilationException(int compileStatus)
Throws an exception if the compilation of SCSS data or an SCSS file has failed.
|
protected final com.cathive.sass.jna.SassLibrary.Sass_Context $context
protected SassOptions options
protected SassContext(@Nonnull com.cathive.sass.jna.SassLibrary.Sass_Context $context, boolean standalone)
$context - Native underlying Sass context.standalone - Whether this context is managed by a data or file context
or not. (Unmanaged / standalone context must dispose their native
components during the Object's finalize phase).public void compile(@WillNotClose @Nonnull OutputStream outputStream) throws SassCompilationException, IOException
outputStream - Output stream to be written to.SassCompilationException - If compilation of the SCSS source file / data fails.IOException - If writing to the given output stream fails.public String compile() throws SassCompilationException
SassCompilationException - If compilation of the SCSS source file / data fails.@Nonnull protected abstract com.cathive.sass.jna.SassLibrary.Sass_Compiler createCompiler()
This instance will be used in the various compile methods that are part of the public API.
@Nonnull public SassOptions getOptions()
public void setOptions(@Nonnull SassOptions options)
protected void throwCompilationException(int compileStatus)
compileStatus - The numeric status code that has been reported by the SCSS compiler
instance.Copyright © 2013–2015 The Cat Hive Developers. All rights reserved.