Class SassCompiler

java.lang.Object
de.larsgrefer.sass.embedded.SassCompiler
All Implemented Interfaces:
Closeable, AutoCloseable

public class SassCompiler extends Object implements Closeable
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess
     
    sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess
    compile(@NonNull URL source, sass.embedded_protocol.EmbeddedSass.OutputStyle outputStyle)
     
    sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess
     
    sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess
     
    sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess
    compileFile(@NonNull File file, @NonNull sass.embedded_protocol.EmbeddedSass.OutputStyle outputStyle)
     
    protected sass.embedded_protocol.EmbeddedSass.InboundMessage.CompileRequest.Builder
     
    sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess
     
    sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess
     
    sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess
    compileString(@NonNull String source, sass.embedded_protocol.EmbeddedSass.Syntax syntax, sass.embedded_protocol.EmbeddedSass.OutputStyle outputStyle)
     
    sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess
    compileString(String source, sass.embedded_protocol.EmbeddedSass.Syntax syntax)
     
    sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess
    compileString(sass.embedded_protocol.EmbeddedSass.InboundMessage.CompileRequest.StringInput string, @NonNull sass.embedded_protocol.EmbeddedSass.OutputStyle outputStyle)
     
     
     
    sass.embedded_protocol.EmbeddedSass.OutputStyle
    How to format the CSS output.
    sass.embedded_protocol.EmbeddedSass.OutboundMessage.VersionResponse
     
    boolean
    Whether to encode the formatted message of errors and logs in ASCII.
    boolean
    Whether to use terminal colors in the formatted message of errors and logs.
    boolean
    Whether to emit a `@charset`/BOM for non-ASCII stylesheets.
    boolean
    Whether to generate a source map.
    boolean
    Whether to omit events for deprecation warnings coming from dependencies (files loaded from a different importer than the input).
    boolean
    Whether to include sources in the generated sourcemap
    boolean
    Whether to report all deprecation warnings or only the first few ones.
    void
     
    void
     
    void
     
    void
    setAlertAscii(boolean alertAscii)
    Whether to encode the formatted message of errors and logs in ASCII.
    void
    setAlertColor(boolean alertColor)
    Whether to use terminal colors in the formatted message of errors and logs.
    void
    setEmitCharset(boolean emitCharset)
    Whether to emit a `@charset`/BOM for non-ASCII stylesheets.
    void
    setGenerateSourceMaps(boolean generateSourceMaps)
    Whether to generate a source map.
    void
    setLoadPaths(List<File> loadPaths)
     
    void
     
    void
    setOutputStyle(sass.embedded_protocol.EmbeddedSass.OutputStyle outputStyle)
    How to format the CSS output.
    void
    setQuietDeps(boolean quietDeps)
    Whether to omit events for deprecation warnings coming from dependencies (files loaded from a different importer than the input).
    void
    setSourceMapIncludeSources(boolean sourceMapIncludeSources)
    Whether to include sources in the generated sourcemap
    void
    setVerbose(boolean verbose)
    Whether to report all deprecation warnings or only the first few ones.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getVersion

      public sass.embedded_protocol.EmbeddedSass.OutboundMessage.VersionResponse getVersion() throws IOException
      Throws:
      IOException
    • registerFunction

      public void registerFunction(@NonNull @NonNull HostFunction sassFunction)
    • registerImporter

      public void registerImporter(@NonNull @NonNull FileImporter fileImporter)
    • registerImporter

      public void registerImporter(@NonNull @NonNull CustomImporter customImporter)
    • compileRequestBuilder

      protected sass.embedded_protocol.EmbeddedSass.InboundMessage.CompileRequest.Builder compileRequestBuilder()
    • compile

      public sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess compile(@NonNull @NonNull URL source) throws SassCompilationFailedException, IOException
      Throws:
      SassCompilationFailedException
      IOException
    • compile

      public sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess compile(@NonNull @NonNull URL source, sass.embedded_protocol.EmbeddedSass.OutputStyle outputStyle) throws SassCompilationFailedException, IOException
      Throws:
      SassCompilationFailedException
      IOException
    • compileScssString

      public sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess compileScssString(@NonNull @NonNull String source) throws IOException, SassCompilationFailedException
      Throws:
      IOException
      SassCompilationFailedException
    • compileSassString

      public sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess compileSassString(@NonNull @NonNull String source) throws IOException, SassCompilationFailedException
      Throws:
      IOException
      SassCompilationFailedException
    • compileCssString

      public sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess compileCssString(@NonNull @NonNull String source) throws IOException, SassCompilationFailedException
      Throws:
      IOException
      SassCompilationFailedException
    • compileString

      public sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess compileString(String source, sass.embedded_protocol.EmbeddedSass.Syntax syntax) throws SassCompilationFailedException, IOException
      Throws:
      SassCompilationFailedException
      IOException
    • compileString

      public sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess compileString(@NonNull @NonNull String source, sass.embedded_protocol.EmbeddedSass.Syntax syntax, sass.embedded_protocol.EmbeddedSass.OutputStyle outputStyle) throws IOException, SassCompilationFailedException
      Throws:
      IOException
      SassCompilationFailedException
    • compileString

      @Nonnull public sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess compileString(sass.embedded_protocol.EmbeddedSass.InboundMessage.CompileRequest.StringInput string, @NonNull @NonNull sass.embedded_protocol.EmbeddedSass.OutputStyle outputStyle) throws IOException, SassCompilationFailedException
      Throws:
      IOException
      SassCompilationFailedException
    • compileFile

      public sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess compileFile(@NonNull @NonNull File inputFile) throws IOException, SassCompilationFailedException
      Throws:
      IOException
      SassCompilationFailedException
    • compileFile

      public sass.embedded_protocol.EmbeddedSass.OutboundMessage.CompileResponse.CompileSuccess compileFile(@NonNull @NonNull File file, @NonNull @NonNull sass.embedded_protocol.EmbeddedSass.OutputStyle outputStyle) throws IOException, SassCompilationFailedException
      Throws:
      IOException
      SassCompilationFailedException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getOutputStyle

      public sass.embedded_protocol.EmbeddedSass.OutputStyle getOutputStyle()
      How to format the CSS output.
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getStyle()
    • setOutputStyle

      public void setOutputStyle(sass.embedded_protocol.EmbeddedSass.OutputStyle outputStyle)
      How to format the CSS output.
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getStyle()
    • isGenerateSourceMaps

      public boolean isGenerateSourceMaps()
      Whether to generate a source map. Note that this will *not* add a source map comment to the stylesheet; that's up to the host or its users.
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getSourceMap()
    • setGenerateSourceMaps

      public void setGenerateSourceMaps(boolean generateSourceMaps)
      Whether to generate a source map. Note that this will *not* add a source map comment to the stylesheet; that's up to the host or its users.
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getSourceMap()
    • isAlertColor

      public boolean isAlertColor()
      Whether to use terminal colors in the formatted message of errors and logs.
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getAlertColor()
    • setAlertColor

      public void setAlertColor(boolean alertColor)
      Whether to use terminal colors in the formatted message of errors and logs.
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getAlertColor()
    • isAlertAscii

      public boolean isAlertAscii()
      Whether to encode the formatted message of errors and logs in ASCII.
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getAlertAscii()
    • setAlertAscii

      public void setAlertAscii(boolean alertAscii)
      Whether to encode the formatted message of errors and logs in ASCII.
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getAlertAscii()
    • isVerbose

      public boolean isVerbose()
      Whether to report all deprecation warnings or only the first few ones. If this is `false`, the compiler may choose not to send events for repeated deprecation warnings. If this is `true`, the compiler must emit an event for every deprecation warning it encounters.
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getVerbose()
    • setVerbose

      public void setVerbose(boolean verbose)
      Whether to report all deprecation warnings or only the first few ones. If this is `false`, the compiler may choose not to send events for repeated deprecation warnings. If this is `true`, the compiler must emit an event for every deprecation warning it encounters.
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getVerbose()
    • isQuietDeps

      public boolean isQuietDeps()
      Whether to omit events for deprecation warnings coming from dependencies (files loaded from a different importer than the input).
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getQuietDeps()
    • setQuietDeps

      public void setQuietDeps(boolean quietDeps)
      Whether to omit events for deprecation warnings coming from dependencies (files loaded from a different importer than the input).
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getQuietDeps()
    • isSourceMapIncludeSources

      public boolean isSourceMapIncludeSources()
      Whether to include sources in the generated sourcemap
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getSourceMapIncludeSources()
    • setSourceMapIncludeSources

      public void setSourceMapIncludeSources(boolean sourceMapIncludeSources)
      Whether to include sources in the generated sourcemap
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getSourceMapIncludeSources()
    • isEmitCharset

      public boolean isEmitCharset()
      Whether to emit a `@charset`/BOM for non-ASCII stylesheets.
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getCharset()
    • setEmitCharset

      public void setEmitCharset(boolean emitCharset)
      Whether to emit a `@charset`/BOM for non-ASCII stylesheets.
      See Also:
      • EmbeddedSass.InboundMessage.CompileRequest.getCharset()
    • setLoggingHandler

      public void setLoggingHandler(LoggingHandler loggingHandler)
    • getLoggingHandler

      public LoggingHandler getLoggingHandler()
    • getLoadPaths

      public List<File> getLoadPaths()
    • setLoadPaths

      public void setLoadPaths(List<File> loadPaths)