new FieldInjectionTarget(injectionTargetClassName, memberName, classType.getName()) : new MethodInjectionTarget(injectionTargetClassName, memberName, classType.getName());
private Field getField(final DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { final String name = getName(); final String className = getClassName(); final Module module = deploymentUnit.getAttachment(MODULE); final ModuleClassLoader classLoader = module.getClassLoader(); final DeploymentReflectionIndex reflectionIndex = deploymentUnit.getAttachment(REFLECTION_INDEX); final ClassReflectionIndex classIndex; try { classIndex = reflectionIndex.getClassIndex(Class.forName(className, false, classLoader)); } catch (ClassNotFoundException e) { throw new DeploymentUnitProcessingException(e); } final Field field = classIndex.getField(name); if (field == null) { throw EeLogger.ROOT_LOGGER.fieldNotFound(name); } return field; } }
@Override public boolean isStatic(DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { return Modifier.isStatic(getField(deploymentUnit).getModifiers()); }
protected void processFieldResource(final DeploymentPhaseContext phaseContext, final FieldInfo fieldInfo, final String name, final String type, final EEModuleClassDescription classDescription, final AnnotationInstance annotation, final EEModuleDescription eeModuleDescription, final Module module, final EEApplicationClasses applicationClasses, final PropertyReplacer replacer) throws DeploymentUnitProcessingException { final String fieldName = fieldInfo.name(); final String injectionType = isEmpty(type) || type.equals(Object.class.getName()) ? fieldInfo.type().name().toString() : type; final String localContextName = isEmpty(name) ? fieldInfo.declaringClass().name().toString() + "/" + fieldName : name; final InjectionTarget targetDescription = new FieldInjectionTarget(fieldInfo.declaringClass().name().toString(), fieldName, fieldInfo.type().name().toString()); process(phaseContext, classDescription, annotation, injectionType, localContextName, targetDescription, eeModuleDescription, module, applicationClasses, replacer); }
private Field getField(final DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { final String name = getName(); final String className = getClassName(); final Module module = deploymentUnit.getAttachment(MODULE); final ModuleClassLoader classLoader = module.getClassLoader(); final DeploymentReflectionIndex reflectionIndex = deploymentUnit.getAttachment(REFLECTION_INDEX); final ClassReflectionIndex<?> classIndex; try { classIndex = reflectionIndex.getClassIndex(Class.forName(className, false, classLoader)); } catch (ClassNotFoundException e) { throw new DeploymentUnitProcessingException(e); } final Field field = classIndex.getField(name); if (field == null) { throw MESSAGES.fieldNotFound(name); } return field; } }
public InterceptorFactory createInjectionInterceptorFactory(final Object targetContextKey, final Object valueContextKey, final Value<ManagedReferenceFactory> factoryValue, final DeploymentUnit deploymentUnit, final boolean optional) throws DeploymentUnitProcessingException { return new ManagedReferenceFieldInjectionInterceptorFactory(targetContextKey, valueContextKey, factoryValue, getField(deploymentUnit), optional); }
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 Field getField(final DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { final String name = getName(); final String className = getClassName(); final Module module = deploymentUnit.getAttachment(MODULE); final ModuleClassLoader classLoader = module.getClassLoader(); final DeploymentReflectionIndex reflectionIndex = deploymentUnit.getAttachment(REFLECTION_INDEX); final ClassReflectionIndex classIndex; try { classIndex = reflectionIndex.getClassIndex(Class.forName(className, false, classLoader)); } catch (ClassNotFoundException e) { throw new DeploymentUnitProcessingException(e); } final Field field = classIndex.getField(name); if (field == null) { throw EeLogger.ROOT_LOGGER.fieldNotFound(name); } return field; } }
@Override public boolean isStatic(DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { return Modifier.isStatic(getField(deploymentUnit).getModifiers()); }
new FieldInjectionTarget(injectionTargetClassName, memberName, classType.getName()) : new MethodInjectionTarget(injectionTargetClassName, memberName, classType.getName());
private Field getField(final DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { final String name = getName(); final String className = getClassName(); final Module module = deploymentUnit.getAttachment(MODULE); final ModuleClassLoader classLoader = module.getClassLoader(); final DeploymentReflectionIndex reflectionIndex = deploymentUnit.getAttachment(REFLECTION_INDEX); final ClassReflectionIndex classIndex; try { classIndex = reflectionIndex.getClassIndex(Class.forName(className, false, classLoader)); } catch (ClassNotFoundException e) { throw new DeploymentUnitProcessingException(e); } final Field field = classIndex.getField(name); if (field == null) { throw EeLogger.ROOT_LOGGER.fieldNotFound(name); } return field; } }
@Override public boolean isStatic(DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { return Modifier.isStatic(getField(deploymentUnit).getModifiers()); }
new FieldInjectionTarget(injectionTargetClassName, memberName, classType.getName()) : new MethodInjectionTarget(injectionTargetClassName, memberName, classType.getName());
@Override public boolean isStatic(DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { return Modifier.isStatic(getField(deploymentUnit).getModifiers()); }
new FieldInjectionTarget(injectionTargetClassName, memberName, classType.getName()) : new MethodInjectionTarget(injectionTargetClassName, memberName, classType.getName());
public InterceptorFactory createInjectionInterceptorFactory(final Object targetContextKey, final Object valueContextKey, final Value<ManagedReferenceFactory> factoryValue, final DeploymentUnit deploymentUnit, final boolean optional) throws DeploymentUnitProcessingException { return new ManagedReferenceFieldInjectionInterceptorFactory(targetContextKey, valueContextKey, factoryValue, getField(deploymentUnit), optional); }
protected void processFieldResource(final DeploymentPhaseContext phaseContext, final FieldInfo fieldInfo, final String name, final String type, final EEModuleClassDescription classDescription, final AnnotationInstance annotation, final EEModuleDescription eeModuleDescription, final Module module, final EEApplicationClasses applicationClasses, final PropertyReplacer replacer) throws DeploymentUnitProcessingException { final String fieldName = fieldInfo.name(); final String injectionType = isEmpty(type) || type.equals(Object.class.getName()) ? fieldInfo.type().name().toString() : type; final String localContextName = isEmpty(name) ? fieldInfo.declaringClass().name().toString() + "/" + fieldName : name; final InjectionTarget targetDescription = new FieldInjectionTarget(fieldInfo.declaringClass().name().toString(), fieldName, fieldInfo.type().name().toString()); process(phaseContext, classDescription, annotation, injectionType, localContextName, targetDescription, eeModuleDescription, module, applicationClasses, replacer); }
public InterceptorFactory createInjectionInterceptorFactory(final Object targetContextKey, final Object valueContextKey, final Value<ManagedReferenceFactory> factoryValue, final DeploymentUnit deploymentUnit, final boolean optional) throws DeploymentUnitProcessingException { return new ManagedReferenceFieldInjectionInterceptorFactory(targetContextKey, valueContextKey, factoryValue, getField(deploymentUnit), optional); }
protected void processFieldResource(final DeploymentPhaseContext phaseContext, final FieldInfo fieldInfo, final String name, final String type, final EEModuleClassDescription classDescription, final AnnotationInstance annotation, final EEModuleDescription eeModuleDescription, final Module module, final EEApplicationClasses applicationClasses, final PropertyReplacer replacer) throws DeploymentUnitProcessingException { final String fieldName = fieldInfo.name(); final String injectionType = isEmpty(type) || type.equals(Object.class.getName()) ? fieldInfo.type().name().toString() : type; final String localContextName = isEmpty(name) ? fieldInfo.declaringClass().name().toString() + "/" + fieldName : name; final InjectionTarget targetDescription = new FieldInjectionTarget(fieldInfo.declaringClass().name().toString(), fieldName, fieldInfo.type().name().toString()); process(phaseContext, classDescription, annotation, injectionType, localContextName, targetDescription, eeModuleDescription, module, applicationClasses, replacer); }
public InterceptorFactory createInjectionInterceptorFactory(final Object targetContextKey, final Object valueContextKey, final Value<ManagedReferenceFactory> factoryValue, final DeploymentUnit deploymentUnit, final boolean optional) throws DeploymentUnitProcessingException { return new ManagedReferenceFieldInjectionInterceptorFactory(targetContextKey, valueContextKey, factoryValue, getField(deploymentUnit), optional); }