本文整理汇总了Java中javax.ejb.EJB.name方法的典型用法代码示例。如果您正苦于以下问题:Java EJB.name方法的具体用法?Java EJB.name怎么用?Java EJB.name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.ejb.EJB
的用法示例。
在下文中一共展示了EJB.name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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();
}
示例3: createFor
import javax.ejb.EJB; //导入方法依赖的package包/类
public static Reference createFor(EJB ejb, Field field) {
final Class<?> type;
if (!Object.class.equals(ejb.beanInterface())) {
type = ejb.beanInterface();
} else {
type = field.getType();
}
final String name;
if (ejb.name().length() > 0) {
name = ejb.name();
} else {
name = field.getDeclaringClass().getName() + "/" + field.getName();
}
return new Reference(type, name, field);
}
示例4: resolveComponentName
import javax.ejb.EJB; //导入方法依赖的package包/类
/**
* フィールドからコンポーネントの名前を解決します.
*
* @param filed
* フィールド
* @return コンポーネント名
*/
private String resolveComponentName(final Field filed) {
if (_testContext.isEjb3Enabled()) {
final EJB ejb = filed.getAnnotation(EJB.class);
if (ejb != null) {
if (!StringUtil.isEmpty(ejb.beanName())) {
return ejb.beanName();
} else if (!StringUtil.isEmpty(ejb.name())) {
return ejb.name();
}
}
}
return normalizeName(filed.getName());
}