• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AnnotationBeanUtils类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.springframework.beans.annotation.AnnotationBeanUtils的典型用法代码示例。如果您正苦于以下问题:Java AnnotationBeanUtils类的具体用法?Java AnnotationBeanUtils怎么用?Java AnnotationBeanUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

AnnotationBeanUtils类属于org.springframework.beans.annotation包,在下文中一共展示了AnnotationBeanUtils类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getManagedOperationParameters

点赞 3

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
@Override
public ManagedOperationParameter[] getManagedOperationParameters(Method method)
		throws InvalidMetadataException {

	ManagedOperationParameters params = AnnotationUtils.findAnnotation(method, ManagedOperationParameters.class);
	ManagedOperationParameter[] result = null;
	if (params == null) {
		result = new ManagedOperationParameter[0];
	}
	else {
		Annotation[] paramData = params.value();
		result = new ManagedOperationParameter[paramData.length];
		for (int i = 0; i < paramData.length; i++) {
			Annotation annotation = paramData[i];
			ManagedOperationParameter managedOperationParameter = new ManagedOperationParameter();
			AnnotationBeanUtils.copyPropertiesToBean(annotation, managedOperationParameter);
			result[i] = managedOperationParameter;
		}
	}
	return result;
}
 

开发者ID:lamsfoundation,
项目名称:lams,
代码行数:22,
代码来源:AnnotationJmxAttributeSource.java

示例2: getManagedNotifications

点赞 3

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
@Override
public ManagedNotification[] getManagedNotifications(Class<?> clazz) throws InvalidMetadataException {
	ManagedNotifications notificationsAnn = clazz.getAnnotation(ManagedNotifications.class);
	if(notificationsAnn == null) {
		return new ManagedNotification[0];
	}
	Annotation[] notifications = notificationsAnn.value();
	ManagedNotification[] result = new ManagedNotification[notifications.length];
	for (int i = 0; i < notifications.length; i++) {
		Annotation notification = notifications[i];
		ManagedNotification managedNotification = new ManagedNotification();
		AnnotationBeanUtils.copyPropertiesToBean(notification, managedNotification);
		result[i] = managedNotification;
	}
	return result;
}
 

开发者ID:lamsfoundation,
项目名称:lams,
代码行数:17,
代码来源:AnnotationJmxAttributeSource.java

示例3: getManagedOperationParameters

点赞 3

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
public ManagedOperationParameter[] getManagedOperationParameters(Method method)
		throws InvalidMetadataException {

	ManagedOperationParameters params = AnnotationUtils.findAnnotation(method, ManagedOperationParameters.class);
	ManagedOperationParameter[] result = null;
	if (params == null) {
		result = new ManagedOperationParameter[0];
	}
	else {
		Annotation[] paramData = params.value();
		result = new ManagedOperationParameter[paramData.length];
		for (int i = 0; i < paramData.length; i++) {
			Annotation annotation = paramData[i];
			ManagedOperationParameter managedOperationParameter = new ManagedOperationParameter();
			AnnotationBeanUtils.copyPropertiesToBean(annotation, managedOperationParameter);
			result[i] = managedOperationParameter;
		}
	}
	return result;
}
 

开发者ID:deathspeeder,
项目名称:class-guard,
代码行数:21,
代码来源:AnnotationJmxAttributeSource.java

示例4: getManagedAttribute

点赞 2

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
@Override
public ManagedAttribute getManagedAttribute(Method method) throws InvalidMetadataException {
	org.springframework.jmx.export.annotation.ManagedAttribute ann =
			AnnotationUtils.findAnnotation(method, org.springframework.jmx.export.annotation.ManagedAttribute.class);
	if (ann == null) {
		return null;
	}
	ManagedAttribute managedAttribute = new ManagedAttribute();
	AnnotationBeanUtils.copyPropertiesToBean(ann, managedAttribute, "defaultValue");
	if (ann.defaultValue().length() > 0) {
		managedAttribute.setDefaultValue(ann.defaultValue());
	}
	return managedAttribute;
}
 

开发者ID:lamsfoundation,
项目名称:lams,
代码行数:15,
代码来源:AnnotationJmxAttributeSource.java

示例5: getManagedMetric

点赞 2

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
@Override
public ManagedMetric getManagedMetric(Method method) throws InvalidMetadataException {
	org.springframework.jmx.export.annotation.ManagedMetric ann =
			AnnotationUtils.findAnnotation(method, org.springframework.jmx.export.annotation.ManagedMetric.class);
	if (ann == null) {
		return null;
	}
	ManagedMetric managedMetric = new ManagedMetric();
	AnnotationBeanUtils.copyPropertiesToBean(ann, managedMetric);
	return managedMetric;
}
 

开发者ID:lamsfoundation,
项目名称:lams,
代码行数:12,
代码来源:AnnotationJmxAttributeSource.java

示例6: getManagedOperation

点赞 2

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
@Override
public ManagedOperation getManagedOperation(Method method) throws InvalidMetadataException {
	Annotation ann = AnnotationUtils.findAnnotation(method, org.springframework.jmx.export.annotation.ManagedOperation.class);
	if (ann == null) {
		return null;
	}
	ManagedOperation op = new ManagedOperation();
	AnnotationBeanUtils.copyPropertiesToBean(ann, op);
	return op;
}
 

开发者ID:lamsfoundation,
项目名称:lams,
代码行数:11,
代码来源:AnnotationJmxAttributeSource.java

示例7: getManagedResource

点赞 2

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
@Override
public org.springframework.jmx.export.metadata.ManagedResource getManagedResource(Class<?> beanClass) throws InvalidMetadataException {
	ManagedResource ann = AnnotationUtils.findAnnotation(beanClass, ManagedResource.class);
	if (ann == null) {
		return null;
	}
	org.springframework.jmx.export.metadata.ManagedResource managedResource = new org.springframework.jmx.export.metadata.ManagedResource();
	AnnotationBeanUtils.copyPropertiesToBean(ann, managedResource, this.embeddedValueResolver);
	return managedResource;
}
 

开发者ID:langtianya,
项目名称:spring4-understanding,
代码行数:11,
代码来源:AnnotationJmxAttributeSource.java

示例8: getManagedAttribute

点赞 2

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
@Override
public org.springframework.jmx.export.metadata.ManagedAttribute getManagedAttribute(Method method) throws InvalidMetadataException {
	ManagedAttribute ann = AnnotationUtils.findAnnotation(method, ManagedAttribute.class);
	if (ann == null) {
		return null;
	}
	org.springframework.jmx.export.metadata.ManagedAttribute managedAttribute = new org.springframework.jmx.export.metadata.ManagedAttribute();
	AnnotationBeanUtils.copyPropertiesToBean(ann, managedAttribute, "defaultValue");
	if (ann.defaultValue().length() > 0) {
		managedAttribute.setDefaultValue(ann.defaultValue());
	}
	return managedAttribute;
}
 

开发者ID:langtianya,
项目名称:spring4-understanding,
代码行数:14,
代码来源:AnnotationJmxAttributeSource.java

示例9: copyPropertiesToBean

点赞 2

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
private static <T> T copyPropertiesToBean(Annotation ann, Class<T> beanClass) {
	if (ann == null) {
		return null;
	}
	T bean = BeanUtils.instantiate(beanClass);
	AnnotationBeanUtils.copyPropertiesToBean(ann, bean);
	return bean;
}
 

开发者ID:langtianya,
项目名称:spring4-understanding,
代码行数:9,
代码来源:AnnotationJmxAttributeSource.java

示例10: getManagedResource

点赞 2

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
@Override
public org.springframework.jmx.export.metadata.ManagedResource getManagedResource(Class<?> beanClass) throws InvalidMetadataException {
	ManagedResource ann = AnnotationUtils.findAnnotation(beanClass, ManagedResource.class);
	if (ann == null) {
		return null;
	}
	Class<?> declaringClass = AnnotationUtils.findAnnotationDeclaringClass(ManagedResource.class, beanClass);
	Class<?> target = (declaringClass != null && !declaringClass.isInterface() ? declaringClass : beanClass);
	if (!Modifier.isPublic(target.getModifiers())) {
		throw new InvalidMetadataException("@ManagedResource class '" + target.getName() + "' must be public");
	}
	org.springframework.jmx.export.metadata.ManagedResource managedResource = new org.springframework.jmx.export.metadata.ManagedResource();
	AnnotationBeanUtils.copyPropertiesToBean(ann, managedResource, this.embeddedValueResolver);
	return managedResource;
}
 

开发者ID:txazo,
项目名称:spring,
代码行数:16,
代码来源:AnnotationJmxAttributeSource.java

示例11: getManagedAttribute

点赞 2

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
public ManagedAttribute getManagedAttribute(Method method) throws InvalidMetadataException {
	org.springframework.jmx.export.annotation.ManagedAttribute ann =
			AnnotationUtils.findAnnotation(method, org.springframework.jmx.export.annotation.ManagedAttribute.class);
	if (ann == null) {
		return null;
	}
	ManagedAttribute managedAttribute = new ManagedAttribute();
	AnnotationBeanUtils.copyPropertiesToBean(ann, managedAttribute, "defaultValue");
	if (ann.defaultValue().length() > 0) {
		managedAttribute.setDefaultValue(ann.defaultValue());
	}
	return managedAttribute;
}
 

开发者ID:deathspeeder,
项目名称:class-guard,
代码行数:14,
代码来源:AnnotationJmxAttributeSource.java

示例12: getManagedMetric

点赞 2

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
public ManagedMetric getManagedMetric(Method method) throws InvalidMetadataException {
	org.springframework.jmx.export.annotation.ManagedMetric ann =
			AnnotationUtils.findAnnotation(method, org.springframework.jmx.export.annotation.ManagedMetric.class);
	if (ann == null) {
		return null;
	}
	ManagedMetric managedMetric = new ManagedMetric();
	AnnotationBeanUtils.copyPropertiesToBean(ann, managedMetric);
	return managedMetric;
}
 

开发者ID:deathspeeder,
项目名称:class-guard,
代码行数:11,
代码来源:AnnotationJmxAttributeSource.java

示例13: getManagedOperation

点赞 2

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
public ManagedOperation getManagedOperation(Method method) throws InvalidMetadataException {
	Annotation ann = AnnotationUtils.findAnnotation(method, org.springframework.jmx.export.annotation.ManagedOperation.class);
	if (ann == null) {
		return null;
	}
	ManagedOperation op = new ManagedOperation();
	AnnotationBeanUtils.copyPropertiesToBean(ann, op);
	return op;
}
 

开发者ID:deathspeeder,
项目名称:class-guard,
代码行数:10,
代码来源:AnnotationJmxAttributeSource.java

示例14: getManagedNotifications

点赞 2

import org.springframework.beans.annotation.AnnotationBeanUtils; //导入依赖的package包/类
public ManagedNotification[] getManagedNotifications(Class<?> clazz) throws InvalidMetadataException {
	ManagedNotifications notificationsAnn = clazz.getAnnotation(ManagedNotifications.class);
	if(notificationsAnn == null) {
		return new ManagedNotification[0];
	}
	Annotation[] notifications = notificationsAnn.value();
	ManagedNotification[] result = new ManagedNotification[notifications.length];
	for (int i = 0; i < notifications.length; i++) {
		Annotation notification = notifications[i];
		ManagedNotification managedNotification = new ManagedNotification();
		AnnotationBeanUtils.copyPropertiesToBean(notification, managedNotification);
		result[i] = managedNotification;
	}
	return result;
}
 

开发者ID:deathspeeder,
项目名称:class-guard,
代码行数:16,
代码来源:AnnotationJmxAttributeSource.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)