Beispiel #1
0
		public virtual void Write(Transaction trans, ClassMetadata clazz, ByteArrayBuffer
			 writer)
		{
			writer.WriteShortString(trans, clazz.NameToWrite());
			int intFormerlyKnownAsMetaClassID = 0;
			writer.WriteInt(intFormerlyKnownAsMetaClassID);
			writer.WriteIDOf(trans, clazz._ancestor);
			WriteIndex(trans, clazz, writer);
			writer.WriteInt(clazz.DeclaredAspectCount());
			clazz.TraverseDeclaredAspects(new _IProcedure4_39(this, trans, clazz, writer));
		}
Beispiel #2
0
		public virtual void CheckClassHasFields(ClassMetadata classMetadata)
		{
			if (classMetadata.AspectsAreNull() || classMetadata.DeclaredAspectCount() == 0)
			{
				string name = classMetadata.GetName();
				string[] ignoredPackages = new string[] { "java.util." };
				for (int i = 0; i < ignoredPackages.Length; i++)
				{
					if (name.IndexOf(ignoredPackages[i]) == 0)
					{
						return;
					}
				}
				if (IsDb4oClass(classMetadata))
				{
					return;
				}
				OnDiagnostic(new ClassHasNoFields(name));
			}
		}
Beispiel #3
0
		public virtual void Defrag(ClassMetadata classMetadata, LatinStringIO sio, DefragmentContextImpl
			 context, int classIndexID)
		{
			ReadName(sio, context.SourceBuffer());
			ReadName(sio, context.TargetBuffer());
			int metaClassID = 0;
			context.WriteInt(metaClassID);
			// ancestor ID
			context.CopyID();
			context.WriteInt((classMetadata.HasClassIndex() ? IndexIDForWriting(classIndexID)
				 : 0));
			int aspectCount = context.ReadInt();
			if (aspectCount > classMetadata.DeclaredAspectCount())
			{
				throw new InvalidOperationException();
			}
			IntByRef processedAspectCount = new IntByRef(0);
			classMetadata.TraverseDeclaredAspects(new _IProcedure4_136(this, processedAspectCount
				, aspectCount, classMetadata, sio, context));
		}
Beispiel #4
0
 public int DeclaredAspectCount(ClassMetadata classMetadata
     )
 {
     return classMetadata.DeclaredAspectCount();
 }