private void processField( final DeploymentUnit deploymentUnit, final EJBResourceWrapper annotation, final FieldInfo fieldInfo, final EEModuleDescription eeModuleDescription) { final String fieldName = fieldInfo.name(); final String fieldType = fieldInfo.type().name().toString(); final InjectionTarget targetDescription = new FieldInjectionTarget( fieldInfo.declaringClass().name().toString(), fieldName, fieldType); final String localContextName = isEmpty(annotation.name()) ? fieldInfo.declaringClass().name().toString() + "/" + fieldInfo.name() : annotation.name(); final String beanInterfaceType = isEmpty(annotation.beanInterface()) || annotation.beanInterface().equals(Object.class.getName()) ? fieldType : annotation.beanInterface(); process( deploymentUnit, beanInterfaceType, annotation.beanName(), annotation.lookup(), fieldInfo.declaringClass(), targetDescription, localContextName, eeModuleDescription); }
private void processClass( final DeploymentUnit deploymentUnit, final EJBResourceWrapper annotation, final ClassInfo classInfo, final EEModuleDescription eeModuleDescription) throws DeploymentUnitProcessingException { if (isEmpty(annotation.name())) { throw MESSAGES.nameAttributeRequiredForEJBAnnotationOnClass(classInfo.toString()); } if (isEmpty(annotation.beanInterface())) { throw MESSAGES.beanInterfaceAttributeRequiredForEJBAnnotationOnClass(classInfo.toString()); } process( deploymentUnit, annotation.beanInterface(), annotation.beanName(), annotation.lookup(), classInfo, null, annotation.name(), eeModuleDescription); }
private void processMethod( final DeploymentUnit deploymentUnit, final EJBResourceWrapper annotation, final MethodInfo methodInfo, final EEModuleDescription eeModuleDescription) { final String methodName = methodInfo.name(); if (!methodName.startsWith("set") || methodInfo.args().length != 1) { throw MESSAGES.onlySetterMethodsAllowedToHaveEJBAnnotation(methodInfo); } final String methodParamType = methodInfo.args()[0].name().toString(); final InjectionTarget targetDescription = new MethodInjectionTarget( methodInfo.declaringClass().name().toString(), methodName, methodParamType); final String localContextName = isEmpty(annotation.name()) ? methodInfo.declaringClass().name().toString() + "/" + methodName.substring(3, 4).toLowerCase(Locale.ENGLISH) + methodName.substring(4) : annotation.name(); final String beanInterfaceType = isEmpty(annotation.beanInterface()) || annotation.beanInterface().equals(Object.class.getName()) ? methodParamType : annotation.beanInterface(); process( deploymentUnit, beanInterfaceType, annotation.beanName(), annotation.lookup(), methodInfo.declaringClass(), targetDescription, localContextName, eeModuleDescription); }