Esempio n. 1
0
        public virtual bool Accept(Net.Vpc.Upa.Entity entity) /* throws Net.Vpc.Upa.Exceptions.UPAException */
        {
            object source = entity.GetEntityDescriptor().GetSource();

            if (rootClass != null && (source == null || !rootClass.IsAssignableFrom(source.GetType())))
            {
                return(false);
            }
            Net.Vpc.Upa.EntityShield v = entity.GetShield();
            if (IsAcceptCloneable() && !v.IsCloneSupported())
            {
                return(false);
            }
            if (IsRejectCloneable() && v.IsCloneSupported())
            {
                return(false);
            }
            if (IsAcceptKeyEditable() && !v.IsKeyEditionSupported())
            {
                return(false);
            }
            if (IsRejectKeyEditable() && v.IsKeyEditionSupported())
            {
                return(false);
            }
            if (IsAcceptRenamable() && !v.IsRenameSupported())
            {
                return(false);
            }
            if (IsRejectRenamable() && v.IsRenameSupported())
            {
                return(false);
            }
            if (IsAcceptClear() && !v.IsClearSupported())
            {
                return(false);
            }
            if (IsRejectClear() && v.IsClearSupported())
            {
                return(false);
            }
            if (IsAcceptDeletable() && !v.IsDeleteSupported())
            {
                return(false);
            }
            if (IsRejectDeletable() && v.IsDeleteSupported())
            {
                return(false);
            }
            try {
                if (IsAcceptEmpty() && !entity.IsEmpty())
                {
                    return(false);
                }
            } catch (Net.Vpc.Upa.Exceptions.UPAException e) {
                return(false);
            }
            try {
                if (IsRejectEmpty() && entity.IsEmpty())
                {
                    return(false);
                }
            } catch (Net.Vpc.Upa.Exceptions.UPAException e) {
                return(false);
            }
            if (IsAcceptPersistable() && !v.IsPersistSupported())
            {
                return(false);
            }
            if (IsRejectPersistable() && v.IsPersistSupported())
            {
                return(false);
            }
            if (IsAcceptNavigatable() && !v.IsNavigateSupported())
            {
                return(false);
            }
            if (IsRejectNavigatable() && v.IsNavigateSupported())
            {
                return(false);
            }
            //        if(isAcceptPrintable() && !v.isPrintSupported()){
            //            return false;
            //        }
            //        if(isRejectPrintable() && v.isPrintSupported()){
            //            return false;
            //        }
            if (IsAcceptKeyGeneratable() && !v.IsGeneratedId())
            {
                return(false);
            }
            if (IsRejectKeyGeneratable() && v.IsGeneratedId())
            {
                return(false);
            }
            if (IsAcceptSystem() && !v.IsSystem())
            {
                return(false);
            }
            if (IsRejectSystem() && v.IsSystem())
            {
                return(false);
            }
            if (IsAcceptPrivate() && !v.IsPrivate())
            {
                return(false);
            }
            if (IsRejectPrivate() && v.IsPrivate())
            {
                return(false);
            }
            if (IsAcceptTransient() && !v.IsTransient())
            {
                return(false);
            }
            if (IsRejectTransient() && v.IsTransient())
            {
                return(false);
            }
            if (IsAcceptUpdatable() && !v.IsUpdateSupported())
            {
                return(false);
            }
            if (IsRejectUpdatable() && v.IsUpdateSupported())
            {
                return(false);
            }
            if (IsAcceptValidatable() && !v.IsUpdateFormulaSupported())
            {
                return(false);
            }
            if (IsRejectValidatable() && v.IsUpdateFormulaSupported())
            {
                return(false);
            }
            return(true);
        }