public class RemoveJavaDependenciesAdapter extends Java2TypeScriptAdapter
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
extTypesMapping |
context, logger, typeVariablesToErase| Constructor and Description |
|---|
RemoveJavaDependenciesAdapter(JSweetContext context) |
RemoveJavaDependenciesAdapter(PrinterAdapter parentAdapter) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
eraseSuperClass(TypeElement classdecl,
TypeElement superClass)
Tells if a super class has to be erased in the generated source.
|
boolean |
eraseSuperInterface(TypeElement classdecl,
TypeElement superInterface)
Tells if a super interface has to be erased in the generated source.
|
boolean |
isSubstituteSuperTypes()
Tells if this adapter substitutes types in extends or implements clauses.
|
String |
needsImport(ImportElement importElement,
String qualifiedName)
Returns the import qualified id if the given import requires an import
statement to be printed.
|
protected RemoveJavaDependenciesAdapter |
print(ExtendedElement expression,
boolean delegate) |
boolean |
substituteBinaryOperator(BinaryOperatorElement binaryOperator)
Substitutes the value of a binary operator.
|
boolean |
substituteForEachLoop(ForeachLoopElement foreachLoop,
boolean targetHasLength,
String indexVarName)
Substitutes if necessary the given foreach loop.
|
boolean |
substituteInstanceof(String exprStr,
ExtendedElement expr,
TypeMirror typeMirror)
Substitutes if necessary an instanceof expression.
|
boolean |
substituteMethodInvocation(MethodInvocationElement invocation)
Substitutes the value of a method invocation expression.
|
protected boolean |
substituteMethodInvocationOnArray(MethodInvocationElement invocation,
String targetMethodName,
String targetClassName,
boolean delegate) |
protected boolean |
substituteMethodInvocationOnArrays(MethodInvocationElement invocation,
String targetMethodName,
ExtendedElement targetExpression,
boolean delegate) |
protected boolean |
substituteMethodInvocationOnCalendar(MethodInvocationElement invocation,
String targetMethodName,
boolean delegate) |
protected boolean |
substituteMethodInvocationOnCharacter(MethodInvocationElement invocation,
String targetMethodName) |
protected boolean |
substituteMethodInvocationOnClass(MethodInvocationElement invocation,
String targetMethodName,
boolean delegate) |
protected boolean |
substituteMethodInvocationOnCollections(MethodInvocationElement invocation,
String targetMethodName,
ExtendedElement targetExpression,
boolean delegate) |
protected boolean |
substituteMethodInvocationOnField(MethodInvocationElement invocation,
String targetMethodName,
boolean delegate) |
protected boolean |
substituteMethodInvocationOnMap(MethodInvocationElement invocation,
String targetMethodName,
ExtendedElement targetExpression,
boolean delegate) |
protected boolean |
substituteMethodInvocationOnMethod(MethodInvocationElement invocation,
String targetMethodName,
boolean delegate) |
protected boolean |
substituteMethodInvocationOnNumber(MethodInvocationElement invocation,
String targetMethodName) |
protected boolean |
substituteMethodInvocationOnObjects(MethodInvocationElement invocation,
String targetMethodName,
boolean delegate) |
boolean |
substituteNewClass(NewClassElement newClass)
To override to tune the printing of a new class expression.
|
boolean |
substituteVariableAccess(VariableAccessElement variableAccess)
Substitutes the given variable access.
|
delegateToEmulLayer, delegateToEmulLayer, delegateToEmulLayerStatic, getErasedTypes, getPrinter, printCastMethodInvocation, printForEachLoop, printFunctionalInvocation, printTarget, substituteAndPrintType, substituteIdentifieradaptDocComment, addAnnotation, addAnnotation, addAnnotationManager, addAnnotationWithValue, addHeader, addTypeMapping, addTypeMapping, addTypeMappings, afterType, endIndent, findExecutableDeclarationInType, getAnnotationValue, getAnnotationValue, getContext, getFunctionalTypeMappings, getHeader, getMappedType, getModuleImportDescriptor, getParentAdapter, getParentElement, getParentElement, getRootRelativeName, getTranspilerOptions, getTypeMappingTarget, hasAnnotationType, isAmbientDeclaration, isMappedType, print, print, print, print, printArgList, printIdentifierList, printIndent, println, printMacroName, removeLastChar, removeLastChar, removeLastChars, removeLastIndent, report, report, report, report, setParentAdapter, setPrinter, space, startIndent, substitute, substituteArrayAccess, substituteAssignment, substituteAssignmentWithOperator, substituteCaseStatementPattern, substituteUnaryOperator, types, utilpublic RemoveJavaDependenciesAdapter(JSweetContext context)
public RemoveJavaDependenciesAdapter(PrinterAdapter parentAdapter)
public String needsImport(ImportElement importElement, String qualifiedName)
PrinterAdapterneedsImport in class Java2TypeScriptAdapterimportElement - the given import declarationqualifiedName - the qualified import idprotected RemoveJavaDependenciesAdapter print(ExtendedElement expression, boolean delegate)
public boolean substituteMethodInvocation(MethodInvocationElement invocation)
PrinterAdaptersubstituteMethodInvocation in class Java2TypeScriptAdapterinvocation - the invocation being printedprotected boolean substituteMethodInvocationOnObjects(MethodInvocationElement invocation, String targetMethodName, boolean delegate)
protected boolean substituteMethodInvocationOnField(MethodInvocationElement invocation, String targetMethodName, boolean delegate)
protected boolean substituteMethodInvocationOnMethod(MethodInvocationElement invocation, String targetMethodName, boolean delegate)
protected boolean substituteMethodInvocationOnClass(MethodInvocationElement invocation, String targetMethodName, boolean delegate)
protected boolean substituteMethodInvocationOnArrays(MethodInvocationElement invocation, String targetMethodName, ExtendedElement targetExpression, boolean delegate)
protected boolean substituteMethodInvocationOnCollections(MethodInvocationElement invocation, String targetMethodName, ExtendedElement targetExpression, boolean delegate)
protected boolean substituteMethodInvocationOnCalendar(MethodInvocationElement invocation, String targetMethodName, boolean delegate)
protected boolean substituteMethodInvocationOnMap(MethodInvocationElement invocation, String targetMethodName, ExtendedElement targetExpression, boolean delegate)
protected boolean substituteMethodInvocationOnArray(MethodInvocationElement invocation, String targetMethodName, String targetClassName, boolean delegate)
protected boolean substituteMethodInvocationOnNumber(MethodInvocationElement invocation, String targetMethodName)
protected boolean substituteMethodInvocationOnCharacter(MethodInvocationElement invocation, String targetMethodName)
public boolean substituteVariableAccess(VariableAccessElement variableAccess)
PrinterAdaptersubstituteVariableAccess in class Java2TypeScriptAdaptervariableAccess - the variable access being printedpublic boolean substituteNewClass(NewClassElement newClass)
PrinterAdaptersubstituteNewClass in class Java2TypeScriptAdapternewClass - the new class expressionpublic boolean substituteForEachLoop(ForeachLoopElement foreachLoop, boolean targetHasLength, String indexVarName)
PrinterAdaptersubstituteForEachLoop in class Java2TypeScriptAdapterforeachLoop - the foreach loop to printtargetHasLength - true if the iterable defines a public length fieldindexVarName - a possible (fresh) variable name that can used to iteratepublic boolean eraseSuperClass(TypeElement classdecl, TypeElement superClass)
PrinterAdaptereraseSuperClass in class PrinterAdapterpublic boolean eraseSuperInterface(TypeElement classdecl, TypeElement superInterface)
PrinterAdaptereraseSuperInterface in class PrinterAdapterpublic boolean isSubstituteSuperTypes()
PrinterAdapterisSubstituteSuperTypes in class PrinterAdapterpublic boolean substituteInstanceof(String exprStr, ExtendedElement expr, TypeMirror typeMirror)
PrinterAdaptersubstituteInstanceof in class PrinterAdapterexprStr - the expression being tested as a string (null if provided as a
tree)expr - the expression being tested as a tree (null if provided as a
string)typeMirror - the type of the instanceof expressionpublic boolean substituteBinaryOperator(BinaryOperatorElement binaryOperator)
PrinterAdaptersubstituteBinaryOperator in class PrinterAdapterbinaryOperator - the binary operator being printed