Monday, January 20, 2014

Read the code of a method in a class


We can read the code of a class method and print in the infolog:

static void ReadTheMethodCode(Args _args)
{

    SysDictClass    sysDictClass  = new SysDictClass(1023922); //Provide the Class ID
    TreeNode        treeNode = TreeNode::findNode(sysDictClass.path()); // to find the class in AOT
    TreeNode        childNode;

    if (treenode)
    {
        info(strfmt('Number of methods in the class: %1',treenode.aotchildnodecount()));
        //childnode = treenode.aotfirstchild();
        childnode = treenode.AOTfindChild("createStatusMessage");
        info(childNode.AOTgetSource());
    }
}


No comments:

Post a Comment