Class CodeUtil
java.lang.Object
com.pnfsoftware.jeb.core.units.code.CodeUtil
Utility routines for code units.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<ICodeClass>
collectClasses
(ICodeUnit unit, boolean internal, boolean topLevel, Pattern addressFilter) Collect classes.static List<ICodeMethod>
collectMethods
(ICodeUnit unit, boolean internal, boolean topLevel, Pattern addressFilter) Collect methods.static IAddressableDigraphBuilder
static String
findCodeItemReference
(ICodeUnit unit, ICodeItem item, int pos) static ICodeField
getFieldByName
(ICodeUnit unit, String partialName, boolean failIfAmbiguous) Get a field by name.static ICodeMethod
getMethodByName
(ICodeUnit unit, String partialName, boolean failIfAmbiguous) Get a method/routine by name.
-
Constructor Details
-
CodeUtil
public CodeUtil()
-
-
Method Details
-
findCodeItemReference
- Parameters:
unit
-item
-pos
-- Returns:
-
getMethodByName
public static ICodeMethod getMethodByName(ICodeUnit unit, String partialName, boolean failIfAmbiguous) Get a method/routine by name.- Parameters:
unit
-partialName
-failIfAmbiguous
-- Returns:
-
getFieldByName
public static ICodeField getFieldByName(ICodeUnit unit, String partialName, boolean failIfAmbiguous) Get a field by name.- Parameters:
unit
-partialName
-failIfAmbiguous
-- Returns:
-
collectClasses
public static List<ICodeClass> collectClasses(ICodeUnit unit, boolean internal, boolean topLevel, Pattern addressFilter) Collect classes.- Parameters:
unit
-internal
- true to collect internal classes onlytopLevel
- true to collect non-inner classes onlyaddressFilter
- optional filter onICodeItem.getAddress()
- Returns:
-
collectMethods
public static List<ICodeMethod> collectMethods(ICodeUnit unit, boolean internal, boolean topLevel, Pattern addressFilter) Collect methods.- Parameters:
unit
-internal
- true to collect internal methods onlytopLevel
- true to collect orphaned methods only (not belonging to any class)addressFilter
- optional filter onICodeItem.getAddress()
- Returns:
-
createCallgraphBuilder
- Parameters:
unit
-- Returns:
-