In package com.eden.orchid.api.compilers

@ImplementedBy(
    value=CompilerServiceImpl)
public interface interface CompilerService extends OrchidService

since: v1.0.0 public abstract

Handles the conversion of source content from one language or format to another. Specific OrchidCompilers or OrchidParsers can be added seamlessly by injecting into the appropriate set in your Module.

Methods

String getDefaultPrecompilerExtension() public since: v1.0.0

Get the file extension that is used by default by the Precompiler.

Set<E> getCompilerExtensions() public since: v1.0.0

Get the file extensions that can be converted using the registered OrchidCompilers.

String getOutputExtension(String extension) public since: v1.0.0

For a given input extension, determine the language it will become after it has been compiled

Parameters:
  • String extension

    the input file extension
Set<E> getParserExtensions() public since: v1.0.0

Get the file extensions that can be converted using the registered OrchidParsers.

OrchidCompiler compilerFor(String extension) public since: v1.0.0

Finds an OrchidCompiler capable of evaluating input with a given file extension.

Parameters:
  • String extension

    the extension representing content that needs to be compiled
OrchidParser parserFor(String extension) public since: v1.0.0

Finds an OrchidParser capable of evaluating input with a given file extension.

Parameters:
  • String extension

    the extension representing content that needs to be parsed
String compile(String extension, String input) public since: v1.0.0

Compiles input against a given Compiler identified by file extension. Additional data may be passed in that individual Compilers may use to render into the resulting output.

Parameters:
  • String extension

    the extension to find a Compiler for
  • String input

    the input to compile
String compile(String extension, String input, Object data) public since: v1.0.0

Compiles input against a given Compiler identified by file extension. Additional data may be passed in that individual Compilers may use to render into the resulting output.

Parameters:
  • String extension

    the extension to find a Compiler for
  • String input

    the input to compile
  • Object data

    additional data to pass to the OrchidCompiler
Map<K, V> parse(String extension, String input) public since: v1.0.0

Compiles input against a given Parser identified by file extension.

Parameters:
  • String extension

    the extension to find a Parser for
  • String input

    the input to parse
String serialize(String extension, Object input) public since: v1.0.0

Compiles input against a given Parser identified by file extension.

Parameters:
  • String extension

    the extension to find a Parser for
  • Object input

    the input to parse
EdenPair<F, S> getEmbeddedData(String input) public since: v1.0.0

Extract the data embedded within some given content, returning the data that was extracted as well as the content after the embedded data has been removed.

Parameters:
  • String input

    the input content to parse
List<E> getBinaryExtensions() public since: v1.0.0

Many file types need to be processed and rendered as a binary stream rather than being decoded into a String. This method returns a List of the current known binary file extensions, so it can be determined how to process a given file type.

void isBinaryExtension(String extension) public since: v1.0.0

Determines if a given file extension is known to require processing as a binary stream rather than an encoded String.

Parameters:
  • String extension
List<E> getIgnoredOutputExtensions() public since: v1.0.0

Normally, a filename like `index.php.peb` would be read as being compiled with the `peb` extension, but instead of rendering to the normal `html` output extension, use `php`. However, for a filename file `index.min.js`, the `min` should be ignored from this process and kept in the filename, as it is a common convention to use `min.js` to denote a compiled/minified Javascript asset. This method returns a List of the current known ignored output extensions

void isIgnoredOutputExtension(String extension) public since: v1.0.0

Determines if a given file extension should be ignored when considering 'intermediate' dots in a filename.

Parameters:
  • String extension