Class BaseTranspiler
- java.lang.Object
-
- com.google.javascript.jscomp.transpile.BaseTranspiler
-
- All Implemented Interfaces:
Transpiler
public final class BaseTranspiler extends java.lang.Object implements Transpiler
Basic Transpiler implementation for outputting ES5 code.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BaseTranspiler.CompileResult
The source together with the additional compilation results.static class
BaseTranspiler.CompilerSupplier
Wraps the Compiler into a more relevant interface, making it easy to test the Transpiler without depending on implementation details of the Compiler itself.
-
Field Summary
Fields Modifier and Type Field Description static BaseTranspiler
ES5_TRANSPILER
static BaseTranspiler
LATEST_TRANSPILER
-
Fields inherited from interface com.google.javascript.jscomp.transpile.Transpiler
NULL
-
-
Constructor Summary
Constructors Constructor Description BaseTranspiler(BaseTranspiler.CompilerSupplier compilerSupplier, java.lang.String runtimeLibraryName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
runtime()
Returns any necessary runtime code as a string.static BaseTranspiler
to(FeatureSet featureSet)
static BaseTranspiler
to(FeatureSet featureSet, java.lang.String runtime)
TranspileResult
transpile(java.net.URI path, java.lang.String code)
Transforms the given chunk of code.
-
-
-
Field Detail
-
LATEST_TRANSPILER
public static final BaseTranspiler LATEST_TRANSPILER
-
ES5_TRANSPILER
public static final BaseTranspiler ES5_TRANSPILER
-
-
Constructor Detail
-
BaseTranspiler
public BaseTranspiler(BaseTranspiler.CompilerSupplier compilerSupplier, java.lang.String runtimeLibraryName)
-
-
Method Detail
-
transpile
public TranspileResult transpile(java.net.URI path, java.lang.String code)
Description copied from interface:Transpiler
Transforms the given chunk of code. The input should be an entire file worth of code.- Specified by:
transpile
in interfaceTranspiler
-
runtime
public java.lang.String runtime()
Description copied from interface:Transpiler
Returns any necessary runtime code as a string. This should include everything that could possibly be required at runtime, regardless of whether it's actually used by any of the code that will be transpiled.- Specified by:
runtime
in interfaceTranspiler
-
to
public static final BaseTranspiler to(FeatureSet featureSet, java.lang.String runtime)
-
to
public static final BaseTranspiler to(FeatureSet featureSet)
-
-