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


Java EJB.mappedName方法代码示例

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


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

示例1: EjbRefElement

import javax.ejb.EJB; //导入方法依赖的package包/类
public EjbRefElement(Member member, PropertyDescriptor pd) {
	super(member, pd);
	AnnotatedElement ae = (AnnotatedElement) member;
	EJB resource = ae.getAnnotation(EJB.class);
	String resourceBeanName = resource.beanName();
	String resourceName = resource.name();
	this.isDefaultName = !StringUtils.hasLength(resourceName);
	if (this.isDefaultName) {
		resourceName = this.member.getName();
		if (this.member instanceof Method && resourceName.startsWith("set") && resourceName.length() > 3) {
			resourceName = Introspector.decapitalize(resourceName.substring(3));
		}
	}
	Class<?> resourceType = resource.beanInterface();
	if (resourceType != null && !Object.class.equals(resourceType)) {
		checkResourceType(resourceType);
	}
	else {
		// No resource type specified... check field/method.
		resourceType = getResourceType();
	}
	this.beanName = resourceBeanName;
	this.name = resourceName;
	this.lookupType = resourceType;
	this.mappedName = resource.mappedName();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:CommonAnnotationBeanPostProcessor.java

示例2: EjbRefElement

import javax.ejb.EJB; //导入方法依赖的package包/类
public EjbRefElement(Member member, AnnotatedElement ae, PropertyDescriptor pd) {
	super(member, pd);
	EJB resource = ae.getAnnotation(EJB.class);
	String resourceBeanName = resource.beanName();
	String resourceName = resource.name();
	this.isDefaultName = !StringUtils.hasLength(resourceName);
	if (this.isDefaultName) {
		resourceName = this.member.getName();
		if (this.member instanceof Method && resourceName.startsWith("set") && resourceName.length() > 3) {
			resourceName = Introspector.decapitalize(resourceName.substring(3));
		}
	}
	Class<?> resourceType = resource.beanInterface();
	if (resourceType != null && Object.class != resourceType) {
		checkResourceType(resourceType);
	}
	else {
		// No resource type specified... check field/method.
		resourceType = getResourceType();
	}
	this.beanName = resourceBeanName;
	this.name = resourceName;
	this.lookupType = resourceType;
	this.mappedName = resource.mappedName();
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:26,代码来源:CommonAnnotationBeanPostProcessor.java

示例3: cacheInjectFields

import javax.ejb.EJB; //导入方法依赖的package包/类
/**
 * Caches {@link EJB} annotated fields
 *
 * @param beanClass
 */
private void cacheInjectFields(Field field) {

    EJB ejb = field.getAnnotation(EJB.class);
    Class<?> interfaceClass = ejb.beanInterface();
    if (interfaceClass == null || interfaceClass.equals(Object.class)) {
        interfaceClass = field.getType();
    }

    String name = ejb.beanName();
    if (name == null || name.isEmpty()) {
        name = BeanUtils.nameFromInterface(interfaceClass);
    }

    String description = ejb.description();
    String mappedName = ejb.mappedName();
    Class<?>[] interfaceClasses = { interfaceClass };
    InjectionData injectionData = new InjectionData();
    injectionData.setField(field);
    injectionData.setInterfaceClasses(interfaceClasses);
    injectionData.setName(name);
    injectionData.setDescription(description);
    injectionData.setMappedName(mappedName);
    metaData.addInject(injectionData);
}
 
开发者ID:levants,项目名称:lightmare,代码行数:30,代码来源:BeanDeployer.java


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