| Package | Description |
|---|---|
| org.jsweet.transpiler |
This package contains the JSweet Java to JavaScript transpiler
implementation.
|
| org.jsweet.transpiler.extension |
This package contains the basic extensions of the JSweet transpiler, as
printer adapters.
|
| org.jsweet.transpiler.util |
This package contains utilities for the JSweet transpiler.
|
| Modifier and Type | Method and Description |
|---|---|
PrinterAdapter |
JSweetFactory.createAdapter(JSweetContext context)
Creates the printer adapter or any subclass.
|
| Modifier and Type | Method and Description |
|---|---|
Java2TypeScriptTranslator |
JSweetFactory.createTranslator(PrinterAdapter adapter,
TranspilationHandler transpilationHandler,
JSweetContext context,
com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit,
boolean fillSourceMap)
Creates the core translator or any subclass.
|
| Constructor and Description |
|---|
Java2TypeScriptTranslator(PrinterAdapter adapter,
TranspilationHandler logHandler,
JSweetContext context,
com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit,
boolean fillSourceMap)
Creates a new TypeScript translator.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AddPrefixToNonPublicMembersAdapter
This simple adapter renames non-public members by adding two underscores as a
prefix.
|
class |
BigDecimalAdapter
This optional adapter tunes the JavaScript generation to map the Java's
BigDecimal API to the Big JavaScript library.
|
class |
DisallowGlobalVariablesAdapter
This simple adapter reports errors when global variables are found.
|
class |
Java2TypeScriptAdapter
This is an adapter for the TypeScript code generator.
|
class |
MapAdapter
This optional adapter tunes the JavaScript generation to use JavaScript ES6
maps to implement Java maps.
|
class |
RemoveJavaDependenciesAdapter
An adapter that removes many uses of Java APIs and replace them with
JavaScript equivalent when possible.
|
class |
StringEnumAdapter
This optional adapter tunes the JavaScript generation to remove enums and
replace them with strings.
|
| Modifier and Type | Method and Description |
|---|---|
PrinterAdapter |
PrinterAdapter.endIndent()
Decrements the current indentation value.
|
PrinterAdapter |
PrinterAdapter.getParentAdapter()
Gets the parent adapter.
|
PrinterAdapter |
PrinterAdapter.print(ExtendedElement element)
Prints a generic element by delegating to the printer.
|
PrinterAdapter |
PrinterAdapter.print(Name name)
Prints a name by delegating to the printer.
|
PrinterAdapter |
PrinterAdapter.print(String string)
Prints a string by delegating to the printer.
|
PrinterAdapter |
PrinterAdapter.printArgList(List<? extends ExtendedElement> args)
Prints an argument list by delegating to the printer.
|
PrinterAdapter |
PrinterAdapter.printIdentifierList(String prefix,
int count)
Prints a comma-separated, zero-indexed, generated identifier list.
|
PrinterAdapter |
PrinterAdapter.printIndent()
Prints an indentation for the current indentation value.
|
PrinterAdapter |
PrinterAdapter.println()
Prints a new line by delegating to the printer.
|
protected PrinterAdapter |
Java2TypeScriptAdapter.printTarget(ExtendedElement target) |
PrinterAdapter |
PrinterAdapter.removeLastChar()
Removes the last output character.
|
PrinterAdapter |
PrinterAdapter.removeLastChars(int count)
Removes the last output characters.
|
PrinterAdapter |
PrinterAdapter.removeLastIndent()
Removes the last printed indentation.
|
PrinterAdapter |
PrinterAdapter.space()
Adds a space to the output.
|
PrinterAdapter |
PrinterAdapter.startIndent()
Increments the current indentation value.
|
| Modifier and Type | Method and Description |
|---|---|
void |
PrinterAdapter.setParentAdapter(PrinterAdapter parentAdapter)
Sets the parent adapter.
|
| Constructor and Description |
|---|
AddPrefixToNonPublicMembersAdapter(PrinterAdapter parentAdapter)
Builds the adapter and delegate to the given parent.
|
BigDecimalAdapter(PrinterAdapter parent) |
DisallowGlobalVariablesAdapter(PrinterAdapter parentAdapter)
Builds an adapter that will delegate to the given parent.
|
Java2TypeScriptAdapter(PrinterAdapter parent)
Creates a new adapter that will try delegate to the given parent adapter when
not implementing its own behavior.
|
MapAdapter(PrinterAdapter parent)
Creates the adapter and initialize all type mappings.
|
PrinterAdapter(PrinterAdapter parentAdapter)
Creates a new adapter that will try delegate to the given parent adapter when
not implementing its own behavior.
|
RemoveJavaDependenciesAdapter(PrinterAdapter parentAdapter) |
StringEnumAdapter(PrinterAdapter parent)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
PrinterAdapter |
AbstractTreePrinter.getAdapter()
Gets the adapter attached to this printer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
AbstractTreePrinter.setAdapter(PrinterAdapter adapter)
Sets the adapter attached to this printer.
|
| Constructor and Description |
|---|
AbstractTreePrinter(TranspilationHandler logHandler,
JSweetContext context,
com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit,
PrinterAdapter adapter,
boolean fillSourceMap)
Creates a new printer.
|