简体   繁体   English

我如何获得课程名称?

[英]how can i get the class name?

i have an instance of IMethod type. 我有一个IMethod类型的实例。 i want to get the class name from it. 我想从中获取课程名称。 How can i do that ....help 我该怎么办....帮助

I haven't used the Eclipse API, but it looks like you should call getDeclaringType() to get an IType . 我还没有使用Eclipse API,但是看起来您应该调用getDeclaringType()来获取IType You can then call getElementName() , getFullyQualifiedName() etc depending on your requirements. 然后可以根据需要调用getElementName()getFullyQualifiedName()等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获取引发自定义异常的类的名称 - How can I get the name of the class that throws a custom made Exception 如何使用静态方法(而不是异常)获取类的名称 - How can I get the name of a class, with an static Method (not with Exception) 如何从摆动组件获取类名称? - How can I get the Class name from a swing Component? 我可以用Java获取子类名称吗 - Can I get the child class name in Java 如何使用特定的Annotation获取所有方法的javadoc,方法名称和包/类名? - How can I get the javadoc of all methods with a specific Annotation, with the method name and package/class name? 如何获得在我的第一堂课的模板部分定义的班级的名称? - How can I get the name of the class defined in the template section of my first class? 我如何调用一个类,该类将获得被调用的类的名称? - How can I call a class which will get the name of the class which is being invoked? 如何在不使用类名的情况下在静态方法中获取Class对象? - How can I get the Class object in a static method without using the class name? 如何自动使用班级名称? - How can I automatically use the name of the class? Log4j2:如何在不使用 Throwable 的情况下获取类名和行号? - Log4j2: How can I get Class Name and Line Number without using Throwable?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM