Package jadx.api.utils
Class CodeUtils
java.lang.Object
jadx.api.utils.CodeUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringextractMethodCode(MethodNode mth, ICodeInfo codeInfo) Cut method code (including comments and annotations) from class code.static intgetLineEndForPos(String code, int pos) static StringgetLineForPos(String code, int pos) static intgetLineNumForPos(String code, int pos, String newLine) static intgetLineStartForPos(String code, int pos) static intgetMethodEnd(MethodNode mth, ICodeInfo codeInfo) Search method end position in provided class code info.private static intgetMethodStart(MethodNode mth, ICodeInfo codeInfo) Search first empty line before method definition to include comments and annotationsstatic intgetNewLinePosAfter(String code, int startPos) static intgetNewLinePosBefore(String code, int startPos)
-
Constructor Details
-
CodeUtils
public CodeUtils()
-
-
Method Details
-
getLineForPos
-
getLineStartForPos
-
getLineEndForPos
-
getNewLinePosAfter
-
getNewLinePosBefore
-
getLineNumForPos
-
extractMethodCode
Cut method code (including comments and annotations) from class code.- Returns:
- method code or empty string if metadata is not available
-
getMethodStart
Search first empty line before method definition to include comments and annotations -
getMethodEnd
Search method end position in provided class code info.- Returns:
- end pos or -1 if metadata not available
-