本文整理汇总了Java中org.jboss.jandex.ClassInfo.method方法的典型用法代码示例。如果您正苦于以下问题:Java ClassInfo.method方法的具体用法?Java ClassInfo.method怎么用?Java ClassInfo.method使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.jandex.ClassInfo
的用法示例。
在下文中一共展示了ClassInfo.method方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFindBaseClass
import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
@Test
public void testFindBaseClass() {
// PREPARE
final ClassInfo implClass = index.getClassByName(DotName.createSimple(MyClass.class.getName()));
final MethodInfo implMethod = implClass.method("methodMyBaseClass1",
Type.create(DotName.createSimple(Integer.class.getName()), Kind.CLASS));
// TEST
final List<MethodInfo> intfMethods = Utils.findOverrideMethods(index, implMethod);
// VERIFY
assertThat(intfMethods).hasSize(1);
assertThat(intfMethods.get(0).name()).isEqualTo("methodMyBaseClass1");
assertThat(intfMethods.get(0).declaringClass().name().toString()).isEqualTo(
MyBaseClass1.class.getName());
}
示例2: testFindInterface1
import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
@Test
public void testFindInterface1() {
// PREPARE
final ClassInfo implClass = index.getClassByName(DotName.createSimple(MyClass.class.getName()));
final MethodInfo implMethod = implClass.method("methodMyInterface1",
Type.create(DotName.createSimple(Long.class.getName()), Kind.CLASS));
// TEST
final List<MethodInfo> intfMethods = Utils.findOverrideMethods(index, implMethod);
// VERIFY
assertThat(intfMethods).hasSize(1);
assertThat(intfMethods.get(0).name()).isEqualTo("methodMyInterface1");
assertThat(intfMethods.get(0).declaringClass().name().toString()).isEqualTo(
MyInterface1.class.getName());
}
示例3: testFindInterface2
import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
@Test
public void testFindInterface2() {
// PREPARE
final ClassInfo implClass = index.getClassByName(DotName.createSimple(MyClass.class.getName()));
final MethodInfo implMethod = implClass.method("methodMyInterface2",
Type.create(DotName.createSimple(Boolean.class.getName()), Kind.CLASS));
// TEST
final List<MethodInfo> intfMethods = Utils.findOverrideMethods(index, implMethod);
// VERIFY
assertThat(intfMethods).hasSize(1);
assertThat(intfMethods.get(0).name()).isEqualTo("methodMyInterface2");
assertThat(intfMethods.get(0).declaringClass().name().toString()).isEqualTo(
MyInterface2.class.getName());
}
示例4: testFindInterface3
import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
@Test
public void testFindInterface3() {
// PREPARE
final ClassInfo implClass = index.getClassByName(DotName.createSimple(MyClass.class.getName()));
final MethodInfo implMethod = implClass.method("methodMyInterface3");
// TEST
final List<MethodInfo> intfMethods = Utils.findOverrideMethods(index, implMethod);
// VERIFY
assertThat(intfMethods).hasSize(1);
assertThat(intfMethods.get(0).name()).isEqualTo("methodMyInterface3");
assertThat(intfMethods.get(0).declaringClass().name().toString()).isEqualTo(
MySuperInterface.class.getName());
}
示例5: testFindInterface4
import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
@Test
public void testFindInterface4() {
// PREPARE
final ClassInfo implClass = index.getClassByName(DotName.createSimple(MyClass.class.getName()));
final MethodInfo implMethod = implClass.method("methodMyInterface4");
// TEST
final List<MethodInfo> intfMethods = Utils.findOverrideMethods(index, implMethod);
// VERIFY
assertThat(intfMethods).hasSize(1);
assertThat(intfMethods.get(0).name()).isEqualTo("methodMyInterface4");
assertThat(intfMethods.get(0).declaringClass().name().toString()).isEqualTo(
MyInterface4.class.getName());
}
示例6: testFindAll
import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
@Test
public void testFindAll() {
// PREPARE
final ClassInfo implClass = index.getClassByName(DotName.createSimple(MyClass.class.getName()));
final MethodInfo implMethod = implClass.method("all");
// TEST
final List<MethodInfo> intfMethods = Utils.findOverrideMethods(index, implMethod);
// VERIFY
assertThat(intfMethods).hasSize(3);
assertThat(intfMethods.get(0).name()).isEqualTo("all");
assertThat(intfMethods.get(0).declaringClass().name().toString()).isEqualTo(
MyInterface1.class.getName());
assertThat(intfMethods.get(1).name()).isEqualTo("all");
assertThat(intfMethods.get(1).declaringClass().name().toString()).isEqualTo(
MyInterface2.class.getName());
assertThat(intfMethods.get(2).name()).isEqualTo("all");
assertThat(intfMethods.get(2).declaringClass().name().toString()).isEqualTo(
MyBaseClass1.class.getName());
}
示例7: verify
import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
@Override
public final AssertionResult verify(final ClassInfo info) {
final MethodInfo method = info.method("<init>");
if ((method == null) || !publicOrProtected(method)) {
return new AssertionResult("Missing public or protected no arg constructor: " + info.name());
}
return AssertionResult.OK;
}
示例8: addIfFound
import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
private static void addIfFound(final Index index, final ClassInfo clasz, final MethodInfo methodToFind,
final List<MethodInfo> methods) {
if (clasz != null) {
final MethodInfo foundMethod = clasz.method(methodToFind.name(), methodToFind.parameters()
.toArray(new Type[methodToFind.parameters().size()]));
if (foundMethod != null) {
methods.add(foundMethod);
}
}
}
示例9: testFindInterfaceNone
import org.jboss.jandex.ClassInfo; //导入方法依赖的package包/类
@Test
public void testFindInterfaceNone() {
// PREPARE
final ClassInfo implClass = index.getClassByName(DotName.createSimple(MyClass.class.getName()));
final MethodInfo implMethod = implClass.method("methodX",
Type.create(DotName.createSimple(String.class.getName()), Kind.CLASS));
// TEST
final List<MethodInfo> intfMethods = Utils.findOverrideMethods(index, implMethod);
// VERIFY
assertThat(intfMethods).isEmpty();
}