@Override public T get() { return injector.get(clazz); }
private void resolveScope(Annotation annotation, Injector injector) { if (stopInheritedScope) { return; } Class<? extends Annotation> annoClass = annotation.annotationType(); if (injector.isInheritedScopeStopper(annoClass)) { stopInheritedScope = true; scope = null; } else if (injector.isScope(annoClass)) { if (null != scope) { Class<? extends Annotation> newScope = injector.scopeByAlias(annoClass); if (newScope != scope) { throw new InjectException("Incompatible scope annotation found: %s", this); } } else { scope = injector.scopeByAlias(annoClass); // scope annotaton is a decorator for inject library usage, it // can't add scope annotation into annoData and make it // enter the equals and hashCode calculation, //annoData.add(new AnnoData(annotation)); } } }
private static boolean stopInheritedScope(Class<?> cls) { Injector injector = Act.app().injector(); for (Annotation anno : cls.getAnnotations()) { if (injector.isInheritedScopeStopper(anno.annotationType())) { return true; } } return false; }
} else if (injector.isQualifier(cls)) { qualifiers.add(anno); annotations.put(anno.annotationType(), anno); transformers.add(anno); } else { if (injector.isPostConstructProcessor(cls)) { postProcessors.add(anno); annotations.put(cls, anno);
private void resolveTypeAnnotations(Injector injector) { for (Annotation annotation : rawType().getAnnotations()) { resolveScope(annotation, injector); Class<? extends Annotation> annoType = annotation.annotationType(); if (annoType == Named.class) { name = ((Named) annotation).value(); } else if (injector.isQualifier(annoType)) { qualifiers.add(annotation); } allAnnotations.put(annotation.annotationType(), annotation); storeTagAnnotation(annotation); } }
private static boolean stopInheritedScope(Class<?> cls) { Injector injector = Act.app().injector(); for (Annotation anno : cls.getAnnotations()) { if (injector.isInheritedScopeStopper(anno.annotationType())) { return true; } } return false; }
} else if (injector.isQualifier(cls)) { qualifiers.add(anno); annotations.put(anno.annotationType(), anno); transformers.add(anno); } else { if (injector.isPostConstructProcessor(cls)) { postProcessors.add(anno); annotations.put(cls, anno);
private void resolveTypeAnnotations(Injector injector) { for (Annotation annotation : rawType().getAnnotations()) { resolveScope(annotation, injector); Class<? extends Annotation> annoType = annotation.annotationType(); if (annoType == Named.class) { name = ((Named) annotation).value(); } else if (injector.isQualifier(annoType)) { qualifiers.add(annotation); } allAnnotations.put(annotation.annotationType(), annotation); storeTagAnnotation(annotation); } }
private void resolveScope(Annotation annotation, Injector injector) { if (stopInheritedScope) { return; } Class<? extends Annotation> annoClass = annotation.annotationType(); if (injector.isInheritedScopeStopper(annoClass)) { stopInheritedScope = true; scope = null; } else if (injector.isScope(annoClass)) { if (null != scope) { Class<? extends Annotation> newScope = injector.scopeByAlias(annoClass); if (newScope != scope) { throw new InjectException("Incompatible scope annotation found: %s", this); } } else { scope = injector.scopeByAlias(annoClass); // scope annotaton is a decorator for inject library usage, it // can't add scope annotation into annoData and make it // enter the equals and hashCode calculation, //annoData.add(new AnnoData(annotation)); } } }
@Override public T get() { return injector.get(clazz); }
protected StringValueResolver lookupResolver(BeanSpec spec, Class runtimeType) { StringValueResolver resolver = null; Param param = spec.getAnnotation(Param.class); if (null != param) { Class<? extends StringValueResolver> resolverClass = param.resolverClass(); if (Param.DEFAULT_RESOLVER.class != resolverClass) { resolver = injector.get(resolverClass); } } if (null == resolver) { resolver = resolverManager.resolver(runtimeType, spec); } return resolver; }
protected StringValueResolver lookupResolver(BeanSpec spec, Class runtimeType) { StringValueResolver resolver = null; Param param = spec.getAnnotation(Param.class); if (null != param) { Class<? extends StringValueResolver> resolverClass = param.resolverClass(); if (Param.DEFAULT_RESOLVER.class != resolverClass) { resolver = injector.get(resolverClass); } } if (null == resolver) { resolver = resolverManager.resolver(runtimeType, spec); } return resolver; }
logger.warn("Config[%s] field type[%s] not recognized", key, spec); } else { Collection col = (Collection) injector.get(spec.rawType()); String[] sa = val.toString().split(","); for (String s : sa) {
logger.warn("Config[%s] field type[%s] not recognized", key, spec); } else { Collection col = (Collection) injector.get(spec.rawType()); String[] sa = val.toString().split(","); for (String s : sa) {