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) Deprecated.Kept for legacystatic List<ICodeClass>collectClasses(ICodeUnit unit, boolean internal, boolean topLevel, Pattern addressFilter, boolean fullMatch) Collect classes.static List<ICodeMethod>collectMethods(ICodeUnit unit, boolean internal, boolean topLevel, Pattern addressFilter) Deprecated.Kept for legacystatic List<ICodeMethod>collectMethods(ICodeUnit unit, boolean internal, boolean topLevel, Pattern addressFilter, boolean fullMatch) Collect methods.static IAddressableDigraphBuilderstatic StringfindCodeItemReference(ICodeUnit unit, ICodeItem item, int pos) static ICodeFieldgetFieldByName(ICodeUnit unit, String partialName, boolean failIfAmbiguous) Get a field by name.static ICodeMethodgetMethodByName(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
@Deprecated public static List<ICodeClass> collectClasses(ICodeUnit unit, boolean internal, boolean topLevel, Pattern addressFilter) Deprecated.Kept for legacy -
collectClasses
public static List<ICodeClass> collectClasses(ICodeUnit unit, boolean internal, boolean topLevel, Pattern addressFilter, boolean fullMatch) Collect classes.- Parameters:
unit-ICodeUnitcontaining classes (seeICodeUnit.getClasses()internal- true to collect internal classes onlytopLevel- true to collect non-inner classes onlyaddressFilter- optional filter onICodeItem.getAddress()fullMatch- true if pattern must match the entire addresses. false if we only intend a search into the address.- Returns:
-
collectMethods
@Deprecated public static List<ICodeMethod> collectMethods(ICodeUnit unit, boolean internal, boolean topLevel, Pattern addressFilter) Deprecated.Kept for legacy -
collectMethods
public static List<ICodeMethod> collectMethods(ICodeUnit unit, boolean internal, boolean topLevel, Pattern addressFilter, boolean fullMatch) Collect methods.- Parameters:
unit-ICodeUnitcontaining methods (seeICodeUnit.getMethods()internal- true to collect internal methods onlytopLevel- true to collect orphaned methods only (not belonging to any class)addressFilter- optional filter onICodeItem.getAddress()fullMatch- true if pattern must match the entire addresses. false if we only intend a search into the address.- Returns:
-
createCallgraphBuilder
- Parameters:
unit-- Returns:
-