Class SQLParameterizer

java.lang.Object
io.codemodder.codemods.SQLParameterizer

public final class SQLParameterizer extends Object
Contains most of the logic for detecting and fixing parameterizable SQL statements for a given MethodCallExpr.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SQLParameterizer(com.github.javaparser.ast.expr.MethodCallExpr methodCallExpr)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if methodCall is a query call that needs to be fixed and fixes if that's the case.
    static boolean
    isSupportedJdbcMethodCall(com.github.javaparser.ast.expr.MethodCallExpr methodCall)
    Returns true if this is a fixable JDBC method name.
    static com.github.javaparser.ast.expr.Expression
    resolveExpression(com.github.javaparser.ast.expr.Expression expr)
    Tries to find the source of an expression if it can be uniquely defined, otherwise, returns self.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SQLParameterizer

      public SQLParameterizer(com.github.javaparser.ast.expr.MethodCallExpr methodCallExpr)
  • Method Details

    • isSupportedJdbcMethodCall

      public static boolean isSupportedJdbcMethodCall(com.github.javaparser.ast.expr.MethodCallExpr methodCall)
      Returns true if this is a fixable JDBC method name.
    • resolveExpression

      public static com.github.javaparser.ast.expr.Expression resolveExpression(com.github.javaparser.ast.expr.Expression expr)
      Tries to find the source of an expression if it can be uniquely defined, otherwise, returns self.
    • checkAndFix

      public boolean checkAndFix()
      Checks if methodCall is a query call that needs to be fixed and fixes if that's the case.