当前位置: 首页>>代码示例>>Java>>正文


Java MethodMetadata.getMethodName方法代码示例

本文整理汇总了Java中org.springframework.core.type.MethodMetadata.getMethodName方法的典型用法代码示例。如果您正苦于以下问题:Java MethodMetadata.getMethodName方法的具体用法?Java MethodMetadata.getMethodName怎么用?Java MethodMetadata.getMethodName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.core.type.MethodMetadata的用法示例。


在下文中一共展示了MethodMetadata.getMethodName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addDeducedBeanTypeForBeanMethod

import org.springframework.core.type.MethodMetadata; //导入方法依赖的package包/类
private void addDeducedBeanTypeForBeanMethod(ConditionContext context,
		AnnotatedTypeMetadata metadata, final List<String> beanTypes,
		final MethodMetadata methodMetadata) {
	try {
		// We should be safe to load at this point since we are in the
		// REGISTER_BEAN phase
		Class<?> configClass = ClassUtils.forName(
				methodMetadata.getDeclaringClassName(), context.getClassLoader());
		ReflectionUtils.doWithMethods(configClass, new MethodCallback() {
			@Override
			public void doWith(Method method)
					throws IllegalArgumentException, IllegalAccessException {
				if (methodMetadata.getMethodName().equals(method.getName())) {
					beanTypes.add(method.getReturnType().getName());
				}
			}
		});
	}
	catch (Throwable ex) {
		throw new BeanTypeDeductionException(
				methodMetadata.getDeclaringClassName(),
				methodMetadata.getMethodName(), ex);
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:25,代码来源:OnBeanCondition.java

示例2: addDeducedBeanTypeForBeanMethod

import org.springframework.core.type.MethodMetadata; //导入方法依赖的package包/类
private void addDeducedBeanTypeForBeanMethod(ConditionContext context,
                                             MethodMetadata metadata, final List<String> beanTypes) {
    try {
        // We should be safe to load at this point since we are in the
        // REGISTER_BEAN phase
        Class<?> returnType = ClassUtils.forName(metadata.getReturnTypeName(), context.getClassLoader());
        beanTypes.add(returnType.getName());
    } catch (Throwable ex) {
        throw new BeanTypeDeductionException(metadata.getDeclaringClassName(), metadata.getMethodName(), ex);
    }
}
 
开发者ID:drtrang,项目名称:spring-boot-autoconfigure,代码行数:12,代码来源:OnBeansCondition.java

示例3: addDeducedBeanTypeForBeanMethod

import org.springframework.core.type.MethodMetadata; //导入方法依赖的package包/类
private void addDeducedBeanTypeForBeanMethod(ConditionContext context,
		MethodMetadata metadata, final List<String> beanTypes) {
	try {
		// We should be safe to load at this point since we are in the
		// REGISTER_BEAN phase
		Class<?> returnType = ClassUtils.forName(metadata.getReturnTypeName(),
				context.getClassLoader());
		beanTypes.add(returnType.getName());
	}
	catch (Throwable ex) {
		throw new BeanTypeDeductionException(metadata.getDeclaringClassName(),
				metadata.getMethodName(), ex);
	}
}
 
开发者ID:lodsve,项目名称:lodsve-framework,代码行数:15,代码来源:OnBeanCondition.java

示例4: getName

import org.springframework.core.type.MethodMetadata; //导入方法依赖的package包/类
private String getName(AnnotatedTypeMetadata metadata) {
	if (metadata instanceof AnnotationMetadata) {
		return ((AnnotationMetadata) metadata).getClassName();
	}
	if (metadata instanceof MethodMetadata) {
		MethodMetadata methodMetadata = (MethodMetadata) metadata;
		return methodMetadata.getDeclaringClassName() + "."
				+ methodMetadata.getMethodName();
	}
	return metadata.toString();
}
 
开发者ID:lodsve,项目名称:lodsve-framework,代码行数:12,代码来源:SpringBootCondition.java

示例5: getClassOrMethodName

import org.springframework.core.type.MethodMetadata; //导入方法依赖的package包/类
private static String getClassOrMethodName(AnnotatedTypeMetadata metadata) {
	if (metadata instanceof ClassMetadata) {
		ClassMetadata classMetadata = (ClassMetadata) metadata;
		return classMetadata.getClassName();
	}
	MethodMetadata methodMetadata = (MethodMetadata) metadata;
	return methodMetadata.getDeclaringClassName() + "#"
			+ methodMetadata.getMethodName();
}
 
开发者ID:lodsve,项目名称:lodsve-framework,代码行数:10,代码来源:SpringBootCondition.java


注:本文中的org.springframework.core.type.MethodMetadata.getMethodName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。