java.lang.Object | |
↳ | com.pnfsoftware.jeb.core.units.UnitUtil |
Utility methods for units
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | pdmRegionParsers | ||||||||||
String | pdmRegionText |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
UnitUtil() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static String |
buildFullyQualifiedCandidateUnitPath(String candidateUnitName, IUnitCreator parent, boolean includeArtifact, String separator)
Build the fully-qualified path of a potential unit whose only the name is provided.
| ||||||||||
static String |
buildFullyQualifiedUnitPath(IUnit unit, boolean includeArtifact, String separator)
Build a fully-qualified unit path.
| ||||||||||
static String |
buildFullyQualifiedUnitPath(IUnit unit)
Build a unit path of the artifact name and its parent units, such
as:
artifact > unit > unit > ... | ||||||||||
static List<String> |
buildFullyQualifiedUnitPathList(IUnitCreator unit, boolean includeArtifact)
Build a fully-qualified unit path as list of unit names.
| ||||||||||
static PropertyDefinitionManager |
createTextPDM(IPropertyDefinitionManager unitPDM)
Create a 'text' region for the property definition manager of the provided units.
| ||||||||||
static PropertyManager |
createTextPM(IUnit unit)
Create a 'text' sub-namespace of a Unit's property namespace.
| ||||||||||
static List<IUnit> |
filterDescendants(IUnit base, int maxDepth, IUnitFilter filter)
Retrieve a list of descendants of the provided unit that pass the provided filter test and do
not exceeded the maximum depth.
| ||||||||||
static <T extends IUnit> List<T> | findAll(String name, Class<T> c, boolean strict) | ||||||||||
static <T extends IUnit> T | findChild(IUnit base, String name, Class<T> c, boolean strict, int index) | ||||||||||
static IUnit | findChildByFormatType(IUnit base, String formatType, int index) | ||||||||||
static IUnit | findChildByName(IUnit base, String name, int index) | ||||||||||
static <T extends IUnit> T | findChildByType(IUnit base, Class<T> classtype, boolean exactClasstype, int index) | ||||||||||
static <T extends IUnit> List<T> | findChildren(IUnit base, String name, Class<T> c, boolean strict) | ||||||||||
static List<IUnit> | findChildrenByFormatType(IUnit base, String formatType) | ||||||||||
static List<IUnit> | findChildrenByName(IUnit base, String name) | ||||||||||
static <T extends IUnit> List<T> | findChildrenByType(IUnit base, Class<T> classtype, boolean exactClasstype) | ||||||||||
static <T extends IUnit> List<T> | findDescendants(ILiveArtifact base, int level, String name, Class<T> c, boolean strict) | ||||||||||
static <T extends IUnit> List<T> |
findDescendants(IUnit base, int maxDepth, String name, Class<T> classtype, boolean exactClasstype)
Convenience function to find descendant units by type and/or name.
| ||||||||||
static List<IUnit> | findDescendantsByFormatType(IUnit base, String formatType) | ||||||||||
static <T extends IUnit> List<T> | findDescendantsByFormatType(IUnit base, int level, String formatType) | ||||||||||
static List<IUnit> | findDescendantsByName(IUnit base, String name) | ||||||||||
static List<IUnit> |
findDescendantsByName(IUnit base, int maxDepth, String name)
Retrieve a list of descendant units of the provided unit that have the provided name.
| ||||||||||
static <T extends IUnit> List<T> |
findDescendantsByType(IUnit base, int maxDepth, Class<T> classtype, boolean exactClasstype)
Retrieve a list of descendant units of the provided unit that are of the provided classtype
(exact or derived) and do not exceeded the maximum depth.
| ||||||||||
static <T extends IUnit> List<T> | findDescendantsByType(IUnit base, Class<T> classtype, boolean exactClasstype) | ||||||||||
static IUnit | findFirstChildByFormatType(IUnit base, String formatType) | ||||||||||
static IUnit | findFirstChildByName(IUnit base, String name) | ||||||||||
static <T extends IUnit> T | findFirstChildByType(IUnit base, Class<T> classtype, boolean exactClasstype) | ||||||||||
static List<IUnit> |
getUnitsFromPathList(IRuntimeProject prj, List<String> path)
Retrieve the targets
IUnit from its path (built from
buildFullyQualifiedUnitPathList(IUnitCreator, boolean) for example). | ||||||||||
static boolean | isAncestorOf(IUnit unit, IUnit expectedAncestor) | ||||||||||
static boolean | isAncestorOf(IUnit unit, IUnit expectedAncestor, boolean strictAncestor) | ||||||||||
static boolean | isTopLevelUnit(IUnit unit) | ||||||||||
static void |
logError(IUnit unit, String address, boolean recordNotification, ILogger logger, String format, Object... params)
Log an error and optionally record a unit notification.
| ||||||||||
static void |
logException(IUnit unit, ILogger logger, Exception e)
Log an exception and optionally record a unit notification.
| ||||||||||
static void |
logInfo(IUnit unit, String address, boolean recordNotification, ILogger logger, String format, Object... params)
Log an informational message and optionally record a unit notification.
| ||||||||||
static void |
logWarn(IUnit unit, String address, boolean recordNotification, ILogger logger, String format, Object... params)
Log a warning and optionally record a unit notification.
| ||||||||||
static void |
notifyGenericChange(IUnit unit)
Issue a generic
UnitChange event to all listeners of the provided unit. | ||||||||||
static IUnit |
retrieve(IUnit base, String... pathElements)
Retrieve a unit rooted in the provided base, and whose relative path from that base consists
of the provided path elements.
| ||||||||||
static IUnit |
retrieveProcessed(boolean processIfUnprocessed, IUnit base, String... pathElements)
Retrieve a unit rooted in the provided base, and whose relative path from that base consists
of the provided path elements.
| ||||||||||
final static String |
textProperty(String propertyName)
Convenience method.
| ||||||||||
static String |
unitFQProperty(IUnit unit, String propertyName, boolean isTextProperty)
Convenience method.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Build the fully-qualified path of a potential unit whose only the name is provided.
Build a fully-qualified unit path.
Build a unit path of the artifact name and its parent units, such
as:artifact > unit > unit > ... > unit
Build a fully-qualified unit path as list of unit names.
Create a 'text' region for the property definition manager of the provided units.
Create a 'text' sub-namespace of a Unit's property namespace. The 'text' namespace contains properties that control how text documents (such as disassemblies or decompilations) are rendered. They can be changed after unit processing.
Retrieve a list of descendants of the provided unit that pass the provided filter test and do not exceeded the maximum depth.
maxDepth | use -1 to go as deep as possible |
---|
Convenience function to find descendant units by type and/or name.
maxDepth | use -1 to go as deep as possible |
---|---|
name | optional |
classtype | optional |
Retrieve a list of descendant units of the provided unit that have the provided name.
maxDepth | use -1 to go as deep as possible |
---|
Retrieve a list of descendant units of the provided unit that are of the provided classtype (exact or derived) and do not exceeded the maximum depth.
maxDepth | use -1 to go as deep as possible |
---|---|
classtype | wanted classtype |
exactClasstype | if true, only units of the exact classtype will be returned |
Retrieve the targets IUnit
from its path (built from
buildFullyQualifiedUnitPathList(IUnitCreator, boolean)
for example). Note that
result target will be unique in most of the cases.
Log an error and optionally record a unit notification.
Log an exception and optionally record a unit notification.
Log an informational message and optionally record a unit notification.
Log a warning and optionally record a unit notification.
Issue a generic UnitChange
event to all listeners of the provided unit.
unit | a unit |
---|
Retrieve a unit rooted in the provided base, and whose relative path from that base consists of the provided path elements.
base | a root unit |
---|---|
pathElements | 1 or more sub-unit names |
Retrieve a unit rooted in the provided base, and whose relative path from that base consists of the provided path elements. The returned unit is guaranteed to be processed.
processIfUnprocessed | attempt to process the unit if it is unprocessed |
---|
Convenience method. Make a simple 'text' property name a relative path of its unit.
propertyName | a simple text property name, eg "Abc" |
---|
Convenience method.
propertyName | simple property name |
---|