Comment detail

メソッド名一覧の表示 (Nested Flatten)

[obj].class.Operations で、[obj]のクラスのメソッド一覧を取得できます。 上記で取得できるのはOperationクラスで、 Operation.Name でオペレーション名を取得できます。

念のためoperation, functionの両方で試しましたが、 両方ともOperationsで取得できました。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import java.lang.System;

public class TestClass {
    public function test_function();
    public operation test_operation();
    public function notest_function();
    public operation notest_operation();
}

var a = new TestClass();

var testNames = select op.Name from op in a.class.Operations 
    where op.Name.startsWith("test_");

for(name in testNames) {
    System.out.println(name);
}

Index

Feed

Other

Link

Pathtraq

loading...