A class that "Describes" the different aspects of a field in a given class that can be handled via S.im.pl
Inheritance: DescriptorBase
        public void DeserializationPostHook(Object e, FieldDescriptor fd)
        {
            if (!(e is Metadata)) return;

            if (fd != null && !(fd is MetadataFieldDescriptor))
                Debug.WriteLine("deserializationPostHook(): call with non-metadata field descriptor! probably this is a mistake!");
            else
                _currentMMStack.Pop();
        }
        public void DeserializationPreHook(Object e, FieldDescriptor fd)
        {
            var deserializedMetadata = e as Metadata;
            if (deserializedMetadata == null) return;

            if (_currentMMStack.Count == 0)
            {
                MetaMetadataCompositeField deserializationMM	= deserializedMetadata.MetaMetadata;
            //					MetaMetadataCompositeField metaMetadata				= semanticsSessionScope.getMetaMetadataRepository().getByClass(InformationComposition.class);
            //					if (metaMetadata != null && metaMetadata.bindMetaMetadataToMetadata(deserializationMM))
            //					{
            //						metaMetadata = (MetaMetadata) deserializationMM;
            //					}
            //					else
            //					{
            //						deserializedMetadata.setMetaMetadata(metaMetadata);
            //					}
                _currentMMStack.Push(deserializationMM);
            }
            else if (fd is MetadataFieldDescriptor)
            {
                MetadataFieldDescriptor mfd 				= (MetadataFieldDescriptor) fd;
                String mmName								= mfd.MmName;
                MetaMetadataNestedField currentMM			= _currentMMStack.Peek();
                MetaMetadataNestedField childMMNested		= (MetaMetadataNestedField) currentMM.LookupChild(mmName);
                MetaMetadataCompositeField childMMComposite = null;
                if (childMMNested.IsPolymorphicInherently)
                {
                    String tagName = deserializedMetadata.MetadataClassDescriptor.TagName;
                    childMMComposite	= _semanticsSessionScope.MetaMetadataRepository.GetMMByName(tagName);
                }
                else
                {
                    childMMComposite = childMMNested.GetMetaMetadataCompositeField();
                }
                deserializedMetadata.MetaMetadata = childMMComposite;
                _currentMMStack.Push(childMMComposite);
            }

            if (e is Document)
                ((Document) e).SemanticsSessionScope = _semanticsSessionScope;
        }
 public FieldDescriptor(ClassDescriptor baseClassDescriptor, FieldDescriptor wrappedFD,
                        String wrapperTag)
     : base(wrapperTag, null)
 {
     declaringClassDescriptor = baseClassDescriptor;
     this.wrappedFD = wrappedFD;
     wrappedFD.Wrapper = this;
     type = FieldTypes.Wrapper;
 }
 static FieldDescriptor()
 {
     IGNORED_ELEMENT_FIELD_DESCRIPTOR = new FieldDescriptor("IGNORED");
 }
 public MetaMetadataFieldDescriptor(ClassDescriptor baseClassDescriptor, FieldDescriptor wrappedFD, String wrapperTag)
     : base(baseClassDescriptor, wrappedFD, wrapperTag)
 {
     IsInheritable = true;
 }
 public MetadataFieldDescriptor(MetadataClassDescriptor declaringClassDescriptor, FieldDescriptor wrappedFD, String wrapperTag)
     : base(declaringClassDescriptor, wrappedFD, wrapperTag)
 {
     //MmName = DeriveMmName();
 }
Exemple #7
0
 static FieldDescriptor()
 {
     IGNORED_ELEMENT_FIELD_DESCRIPTOR = new FieldDescriptor("IGNORED");
 }