Class JavaStringConcatenationOperationHandler
java.lang.Object
de.monticore.codegen.javagen.operationprinter.JavaStringConcatenationOperationHandler
- All Implemented Interfaces:
ICodeGenOperationHandler
public class JavaStringConcatenationOperationHandler
extends Object
implements ICodeGenOperationHandler
Handles "+"-operator for String concatenation
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.monticore.codegen.ICodeGenOperationHandler
ICodeGenOperationHandler.BinaryOperator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprintConvertedToString(de.monticore.prettyprint.IndentPrinter printer, CodeGenPrintAction exprPrintAction) conversion is required for weird cases with generics, e.g.,<T extends String> String f(T t1, T t2) { return String.valueOf(t1) + String.valueOf(t2); }booleantryPrint(ICodeGenOperationHandler.BinaryOperator operator, de.monticore.prettyprint.IndentPrinter printer, SymTypeExpression resultType, SymTypeExpression leftType, SymTypeExpression rightType, CodeGenPrintAction leftExprPrintAction, CodeGenPrintAction rightExprPrintAction)
-
Constructor Details
-
JavaStringConcatenationOperationHandler
public JavaStringConcatenationOperationHandler()
-
-
Method Details
-
tryPrint
public boolean tryPrint(ICodeGenOperationHandler.BinaryOperator operator, de.monticore.prettyprint.IndentPrinter printer, SymTypeExpression resultType, SymTypeExpression leftType, SymTypeExpression rightType, CodeGenPrintAction leftExprPrintAction, CodeGenPrintAction rightExprPrintAction) - Specified by:
tryPrintin interfaceICodeGenOperationHandler
-
printConvertedToString
protected void printConvertedToString(de.monticore.prettyprint.IndentPrinter printer, CodeGenPrintAction exprPrintAction) conversion is required for weird cases with generics, e.g.,<T extends String> String f(T t1, T t2) { return String.valueOf(t1) + String.valueOf(t2); }
-