add an afterTypeBody customization method to inject TS code at the end of type bodies

This commit is contained in:
Renaud Pawlak 2020-08-09 09:52:29 +02:00
parent 8e276782e8
commit 6841f03327
2 changed files with 11 additions and 0 deletions

View File

@ -1939,6 +1939,8 @@ public class Java2TypeScriptTranslator extends AbstractTreePrinter {
removeLastChar().println();
}
getAdapter().afterTypeBody(classdecl.sym);
if (!globals) {
endIndent().printIndent().print("}");
if (!getScope().interfaceScope && !getScope().declareClassScope && !getScope().enumScope

View File

@ -1094,6 +1094,15 @@ public class PrinterAdapter {
}
}
/**
* This method is called after printing the body of a type.
*/
public void afterTypeBody(TypeElement type) {
if (parentAdapter != null) {
parentAdapter.afterTypeBody(type);
}
}
/**
* Adapts the JavaDoc comment for a given element.
*