public AnnotatedType(Type type, IAnnotations annotations) { Type = type; Annotations = annotations; _fieldsLazy = new Lazy <IEnumerable <IAnnotatedField> >(GetFields); _methodsLazy = new Lazy <IEnumerable <IAnnotatedMethod> >(GetMethods); _propertiesLazy = new Lazy <IEnumerable <IAnnotatedProperty> >(GetProperties); _constructorsLazy = new Lazy <IEnumerable <IAnnotatedConstructor> >(GetConstructors); }
public EventObserverMethod(IWeldComponent component, ParameterInfo parameter, IAnnotations annotations) { Component = component; _parameter = parameter; _annotations = annotations; _eventType = parameter.ParameterType; IsConcrete = _eventType.ContainsGenericParameters; _method = new InjectableMethod(component, (MethodInfo)parameter.Member, parameter); NextNonLinearValidatables = _method.LinearValidatables.Union(_method.NonLinearValidatables); }
protected AbstractInjectionPoint(IComponent declaringComponent, MemberInfo member, Type type, IAnnotations annotations) { DeclaringComponent = declaringComponent; Member = member; ComponentType = type; Annotations = annotations; IsCacheable = IsCacheableType(type); Unwraps = annotations.OfType <UnwrapAttribute>().Any(); _lazyComponents = new Lazy <IComponent>(ResolveComponents); _lazyInjectPlan = new Lazy <InjectPlan>(() => BuildInjectPlan(Component)); _lazyGetValuePlan = new Lazy <BuildPlan>(BuildGetValuePlan); }
private AbstractComponent(Type type, IAnnotations annotations, WeldComponentManager manager) { Annotations = annotations; var qualifierSet = new HashSet <IQualifier>(Annotations.OfType <IQualifier>()); if (qualifierSet.All(x => (x is AnyAttribute))) { qualifierSet.Add(DefaultAttribute.Instance); } Type = type; Manager = manager; Scope = annotations.OfType <ScopeAttribute>().Select(x => x.GetType()).FirstOrDefault() ?? typeof(DependentAttribute); IsProxyRequired = typeof(NormalScopeAttribute).IsAssignableFrom(Scope) && !Annotations.OfType <UnwrapAttribute>().Any(); _lazyBuildPlan = new Lazy <BuildPlan>(GetBuildPlan); IsConditionalOnMissing = Annotations.OfType <ConditionalOnMissingComponentAttribute>().Any(); }
protected AbstractProducer(IWeldComponent declaringComponent, MemberInfo member, Type returnType, IAnnotations annotations, WeldComponentManager manager) : base(Formatters.Member(member), returnType, annotations, manager) { _containsGenericParameters = GenericUtils.MemberContainsGenericArguments(member); DeclaringComponent = declaringComponent; }
private FieldInjectionPoint(IComponent declaringComponent, FieldInfo field, IAnnotations annotations) : base(declaringComponent, field, field.FieldType, annotations) { _field = field; }
public ProducerProperty(IWeldComponent component, PropertyInfo property, IAnnotations annotations, WeldComponentManager manager) : base(component, property, property.PropertyType, annotations, manager) { _property = property; }
private ProducerField(IWeldComponent component, FieldInfo field, IAnnotations annotations, WeldComponentManager manager) : base(component, field, field.FieldType, annotations, manager) { _field = field; }
public InstanceComponent(Type baseType, IAnnotations annotations, WeldComponentManager manager, IWeldComponent[] components) : base("", typeof(Instance <>).MakeGenericType(baseType), annotations, manager) { _baseType = baseType; _components = components; }
protected AbstractComponent(string idSuffix, Type type, IAnnotations annotations, WeldComponentManager manager) : this(type, annotations, manager) { _id = new ComponentIdentifier(string.Format("{0}-{1}-{2}", manager.Id, GetType().Name, idSuffix)); }
protected AbstractComponent(ComponentIdentifier id, Type type, IAnnotations annotations, WeldComponentManager manager) : this(type, annotations, manager) { _id = id; }
public void SetAnnotations(IAnnotations annotations) { AnnotatedType = new AnnotatedType(AnnotatedType.Type, annotations); }
private PropertyInjectionPoint(IComponent declaringComponent, PropertyInfo property, IAnnotations annotations) : base(declaringComponent, property, property.PropertyType, annotations) { _property = property; }
public MethodParameterInjectionPoint(IComponent declaringComponent, ParameterInfo paramInfo, IAnnotations annotations) : base(declaringComponent, paramInfo.Member, paramInfo.ParameterType, annotations) { _param = paramInfo; IsConstructor = _param.Member is ConstructorInfo; }
public ProducerMethod(IWeldComponent declaringComponent, MethodInfo method, IAnnotations annotations, WeldComponentManager manager) : base(declaringComponent, method, method.ReturnType, annotations, manager) { _method = new InjectableMethod(declaringComponent, method, null); }