Exemplo n.º 1
0
        public MappingReflector(
            ITypeDiscoveryService typeDiscoveryService,
            IClassIDProvider classIDProvider,
            IMemberInformationNameResolver nameResolver,
            IPropertyMetadataProvider propertyMetadataProvider,
            IDomainModelConstraintProvider domainModelConstraintProvider,
            IDomainObjectCreator domainObjectCreator)
        {
            ArgumentUtility.CheckNotNull("typeDiscoveryService", typeDiscoveryService);
            ArgumentUtility.CheckNotNull("classIDProvider", classIDProvider);
            ArgumentUtility.CheckNotNull("propertyMetadataProvider", propertyMetadataProvider);
            ArgumentUtility.CheckNotNull("domainModelConstraintProvider", domainModelConstraintProvider);
            ArgumentUtility.CheckNotNull("nameResolver", nameResolver);
            ArgumentUtility.CheckNotNull("domainObjectCreator", domainObjectCreator);

            _typeDiscoveryService          = typeDiscoveryService;
            _classIDProvider               = classIDProvider;
            _propertyMetadataProvider      = propertyMetadataProvider;
            _domainModelConstraintProvider = domainModelConstraintProvider;
            _nameResolver         = nameResolver;
            _mappingObjectFactory = new ReflectionBasedMappingObjectFactory(
                _nameResolver,
                _classIDProvider,
                _propertyMetadataProvider,
                _domainModelConstraintProvider,
                domainObjectCreator);
        }
Exemplo n.º 2
0
        public ClassReflector(
            Type type,
            IMappingObjectFactory mappingObjectFactory,
            IMemberInformationNameResolver nameResolver,
            IClassIDProvider classIDProvider,
            IPropertyMetadataProvider propertyMetadataProvider,
            IDomainModelConstraintProvider domainModelConstraintProvider,
            IDomainObjectCreator instanceCreator)
        {
            ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("type", type, typeof(DomainObject));
            ArgumentUtility.CheckNotNull("mappingObjectFactory", mappingObjectFactory);
            ArgumentUtility.CheckNotNull("nameResolver", nameResolver);
            ArgumentUtility.CheckNotNull("classIDProvider", classIDProvider);
            ArgumentUtility.CheckNotNull("propertyMetadataProvider", propertyMetadataProvider);
            ArgumentUtility.CheckNotNull("domainModelConstraintProvider", domainModelConstraintProvider);
            ArgumentUtility.CheckNotNull("instanceCreator", instanceCreator);

            _type = type;
            _mappingObjectFactory          = mappingObjectFactory;
            _nameResolver                  = nameResolver;
            _classIDProvider               = classIDProvider;
            _propertyMetadataProvider      = propertyMetadataProvider;
            _domainModelConstraintProvider = domainModelConstraintProvider;
            _instanceCreator               = instanceCreator;
        }
Exemplo n.º 3
0
 public RdbmsRelationEndPointReflector(
     ClassDefinition classDefinition,
     IPropertyInformation propertyInfo,
     IMemberInformationNameResolver nameResolver,
     IPropertyMetadataProvider propertyMetadataProvider,
     IDomainModelConstraintProvider domainModelConstraintProvider)
     : base(classDefinition, propertyInfo, nameResolver, propertyMetadataProvider, domainModelConstraintProvider)
 {
 }
 public static BindableDomainObjectPropertyReflector Create(
     IPropertyInformation propertyInfo,
     BindableObjectProvider businessObjectProvider,
     IDomainModelConstraintProvider domainModelConstraintProvider,
     IDefaultValueStrategy defaultValueStrategy)
 {
     return(ObjectFactory.Create <BindableDomainObjectPropertyReflector> (
                true,
                ParamList.Create(propertyInfo, businessObjectProvider, domainModelConstraintProvider, defaultValueStrategy)));
 }
 protected BindableDomainObjectPropertyReflector(
     IPropertyInformation propertyInfo,
     BindableObjectProvider businessObjectProvider,
     IDomainModelConstraintProvider domainModelConstraintProvider,
     IDefaultValueStrategy defaultValueStrategy)
     : this(propertyInfo,
            businessObjectProvider,
            domainModelConstraintProvider,
            defaultValueStrategy,
            SafeServiceLocator.Current.GetInstance <IBindablePropertyReadAccessStrategy>(),
            SafeServiceLocator.Current.GetInstance <IBindablePropertyWriteAccessStrategy>(),
            SafeServiceLocator.Current.GetInstance <BindableObjectGlobalizationService>())
 {
 }
Exemplo n.º 6
0
        public PropertyReflector(
            ClassDefinition classDefinition,
            IPropertyInformation propertyInfo,
            IMemberInformationNameResolver nameResolver,
            IPropertyMetadataProvider propertyMetadataProvider,
            IDomainModelConstraintProvider domainModelConstraintProvider)
            : base(propertyInfo, nameResolver, propertyMetadataProvider)
        {
            ArgumentUtility.CheckNotNull("classDefinition", classDefinition);
            ArgumentUtility.CheckNotNull("domainModelConstraintProvider", domainModelConstraintProvider);

            _classDefinition = classDefinition;
            _domainModelConstraintProvider = domainModelConstraintProvider;
        }
Exemplo n.º 7
0
        public PropertyFinder(
            Type type,
            ClassDefinition classDefinition,
            bool includeBaseProperties,
            bool includeMixinProperties,
            IMemberInformationNameResolver nameResolver,
            IPersistentMixinFinder persistentMixinFinder,
            IPropertyMetadataProvider propertyMetadataProvider,
            IDomainModelConstraintProvider domainModelConstraintProvider)
            : base(type, includeBaseProperties, includeMixinProperties, nameResolver, persistentMixinFinder, propertyMetadataProvider)
        {
            ArgumentUtility.CheckNotNull("classDefinition", classDefinition);

            _classDefinition = classDefinition;
            _domainModelConstraintProvider = domainModelConstraintProvider;
        }
Exemplo n.º 8
0
        public ReflectionBasedMappingObjectFactory(
            IMemberInformationNameResolver nameResolver,
            IClassIDProvider classIDProvider,
            IPropertyMetadataProvider propertyMetadataProvider,
            IDomainModelConstraintProvider domainModelConstraintProvider,
            IDomainObjectCreator instanceCreator)
        {
            ArgumentUtility.CheckNotNull("nameResolver", nameResolver);
            ArgumentUtility.CheckNotNull("classIDProvider", classIDProvider);
            ArgumentUtility.CheckNotNull("propertyMetadataProvider", propertyMetadataProvider);
            ArgumentUtility.CheckNotNull("domainModelConstraintProvider", domainModelConstraintProvider);
            ArgumentUtility.CheckNotNull("instanceCreator", instanceCreator);

            _nameResolver                  = nameResolver;
            _classIDProvider               = classIDProvider;
            _propertyMetadataProvider      = propertyMetadataProvider;
            _domainModelConstraintProvider = domainModelConstraintProvider;
            _instanceCreator               = instanceCreator;
        }
        public BindableDomainObjectPropertyReflector(
            IPropertyInformation propertyInfo,
            BindableObjectProvider businessObjectProvider,
            IDomainModelConstraintProvider domainModelConstraintProvider,
            IDefaultValueStrategy defaultValueStrategy,
            IBindablePropertyReadAccessStrategy bindablePropertyReadAccessStrategy,
            IBindablePropertyWriteAccessStrategy bindablePropertyWriteAccessStrategy,
            BindableObjectGlobalizationService bindableObjectGlobalizationService)
            : base(
                propertyInfo,
                businessObjectProvider,
                defaultValueStrategy,
                bindablePropertyReadAccessStrategy,
                bindablePropertyWriteAccessStrategy,
                bindableObjectGlobalizationService)
        {
            ArgumentUtility.CheckNotNull("businessObjectProvider", businessObjectProvider);
            ArgumentUtility.CheckNotNull("domainModelConstraintProvider", domainModelConstraintProvider);

            _domainModelConstraintProvider = domainModelConstraintProvider;
        }
Exemplo n.º 10
0
        protected PropertyReflector CreatePropertyReflector <T> (string property, IDomainModelConstraintProvider domainModelConstraintProvider)
        {
            ArgumentUtility.CheckNotNullOrEmpty("property", property);

            Type            type         = typeof(T);
            var             propertyInfo = PropertyInfoAdapter.Create(type.GetProperty(property, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic));
            ClassDefinition classDefinition;

            if (ReflectionUtility.IsDomainObject(type))
            {
                classDefinition = ClassDefinitionObjectMother.CreateClassDefinition(classType: type, isAbstract: true);
            }
            else
            {
                classDefinition = ClassDefinitionObjectMother.CreateClassDefinition(classType: type, isAbstract: false);
            }

            return(new PropertyReflector(
                       classDefinition,
                       propertyInfo,
                       Configuration.NameResolver,
                       PropertyMetadataProvider,
                       domainModelConstraintProvider));
        }