public class

CodeNodeUtil

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.output.tree.CodeNodeUtil

Class Overview

Convenience methods to filter ICodeNodes.

Summary

Constants
int IS_ARTIFICIAL The code item is artificial
int IS_CLASS The code item implements ICodeClass
int IS_FIELD The code item implements ICodeField
int IS_INTERNAL The code item is internal
int IS_METHOD The code item implements ICodeMethod
int IS_PACKAGE The code item implements ICodePackage
int IS_TYPE The code item implements ICodeType
Public Constructors
CodeNodeUtil()
Public Methods
static boolean cannotBe(ICodeNode node, int flags)
static List<ICodeNode> getChildren(ICodeNode node, int included, int excluded)
Get the children nodes that meet the provided criteria.
static String getPackageNameFromHierarchy(ICodeNode node)
Get full package name from hierarchy, e.g.
static boolean hasChildren(ICodeNode node, int included, int excluded)
static boolean meetsConditions(ICodeNode node, int included, int excluded)
Verify if this node meets the provided criteria.
static boolean mustBe(ICodeNode node, int flags)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int IS_ARTIFICIAL

The code item is artificial

Constant Value: 16 (0x00000010)

public static final int IS_CLASS

The code item implements ICodeClass

Constant Value: 131072 (0x00020000)

public static final int IS_FIELD

The code item implements ICodeField

Constant Value: 262144 (0x00040000)

public static final int IS_INTERNAL

The code item is internal

Constant Value: 256 (0x00000100)

public static final int IS_METHOD

The code item implements ICodeMethod

Constant Value: 524288 (0x00080000)

public static final int IS_PACKAGE

The code item implements ICodePackage

Constant Value: 32768 (0x00008000)

public static final int IS_TYPE

The code item implements ICodeType

Constant Value: 65536 (0x00010000)

Public Constructors

public CodeNodeUtil ()

Public Methods

public static boolean cannotBe (ICodeNode node, int flags)

public static List<ICodeNode> getChildren (ICodeNode node, int included, int excluded)

Get the children nodes that meet the provided criteria. Refer to the IS_xxx possible flags returned by #getItemFlags().

Parameters
node parent code node
included if non-0, candidates children MUST have the flags set
excluded if non-0, candidates children MUST NOT have the flags set
Returns
  • the list of children

public static String getPackageNameFromHierarchy (ICodeNode node)

Get full package name from hierarchy, e.g. package 'bar' located in packages std->foo is named 'std::foo::bar'.

Returns
  • full package name using C++ separator, null if node is not a package

public static boolean hasChildren (ICodeNode node, int included, int excluded)

public static boolean meetsConditions (ICodeNode node, int included, int excluded)

Verify if this node meets the provided criteria. Refer to the IS_xxx possible flags returned by #getItemFlags().

Parameters
node node to be tested
included these flags MUST be set
excluded these flags MUST NOT be set
Returns
  • true iff the node meets the required conditions

public static boolean mustBe (ICodeNode node, int flags)