Inheritance: LanguageElement, IEntity
		private void WriteType(TypeBase type)
		{
			if (type is CompositeType)
				WriteCompositeType((CompositeType) type);
			else if (type is EnumType)
				WriteEnum((EnumType) type);
		}
		/// <exception cref="ArgumentNullException">
		/// <paramref name="type"/> is null.
		/// </exception>
		protected SourceFileGenerator(TypeBase type, string rootNamespace)
		{
			if (type == null)
				throw new ArgumentNullException("type");

			this.type = type;
			this.rootNamespace = rootNamespace;
		}
Exemple #3
0
		/// <exception cref="ArgumentNullException">
		/// <paramref name="first"/> is null.-or-
		/// <paramref name="second"/> is null.
		/// </exception>
		protected TypeRelationship(TypeBase first, TypeBase second)
		{
			if (first == null)
				throw new ArgumentNullException("first");
			if (second == null)
				throw new ArgumentNullException("second");

			this.first = first;
			this.second = second;
		}
		/// <exception cref="NullReferenceException">
		/// <paramref name="type"/> is null.
		/// </exception>
		public JavaSourceFileGenerator(TypeBase type, string rootNamespace)
			: base(type, rootNamespace)
		{
		}
		/// <exception cref="ArgumentNullException">
		/// <paramref name="first"/> is null.-or-
		/// <paramref name="second"/> is null.
		/// </exception>
		internal DependencyRelationship(TypeBase first, TypeBase second) : base(first, second)
		{
			Attach();
		}
		/// <exception cref="RelationshipException">
		/// Cannot create nesting relationship.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parentClass"/> is null.-or-
		/// <paramref name="innerClass"/> is null.
		/// </exception>
		internal NestingRelationship(CompositeType parentType, TypeBase innerType)
			: base(parentType, innerType)
		{
			Attach();
		}
Exemple #7
0
		private bool IsNestedAncestor(TypeBase type)
		{
			if (NestingParent != null && NestingParent.IsNestedAncestor(type))
				return true;
			else
				return (type == this);
		}
Exemple #8
0
		/// <exception cref="ArgumentNullException">
		/// <paramref name="first"/> is null.-or-
		/// <paramref name="second"/> is null.
		/// </exception>
		internal Association(TypeBase first, TypeBase second) : base(first, second)
		{
			IsAggregation = false;
			IsComposition = false;
			Direction = Direction.None;
		}
Exemple #9
0
 internal AssociationRelationship(TypeBase first, TypeBase second)
     : base(first, second)
 {
     Attach();
 }
Exemple #10
0
		protected abstract SourceFileGenerator CreateSourceFileGenerator(TypeBase type);
		/// <exception cref="ArgumentNullException">
		/// <paramref name="first"/> is null.-or-
		/// <paramref name="second"/> is null.
		/// </exception>
		internal AssociationRelationship(TypeBase first, TypeBase second, AssociationType type)
			: base(first, second)
		{
			this.associationType = type;
			Attach();
		}
		/// <exception cref="ArgumentNullException">
		/// <paramref name="first"/> or <paramref name="second"/> is null.
		/// </exception>
		internal AssociationRelationship(TypeBase first, TypeBase second)
			: base(first, second)
		{
			Attach();
		}
		public AssociationRelationship Clone(TypeBase first, TypeBase second)
		{
			AssociationRelationship association = new AssociationRelationship(first, second);
			association.CopyFrom(this);
			return association;
		}
Exemple #14
0
		protected override void CopyFrom(TypeBase type)
		{
			base.CopyFrom(type);

			CompositeType compositeType = (CompositeType) type;
			fields.Clear();
			fields.Capacity = compositeType.fields.Capacity;
			operations.Clear();
			operations.Capacity = compositeType.operations.Capacity;

			foreach (Field field in compositeType.fields)
			{
				AddField(field.Clone(this));
			}
			foreach (Operation operation in compositeType.operations)
			{
				AddOperation(operation.Clone(this));
			}
		}
Exemple #15
0
		internal void RemoveNestedChild(TypeBase type)
		{
			if (type != null && nestedChilds.Remove(type))
				Changed();
		}
 protected TypeRelationship(TypeBase first, TypeBase second)
 {
     First  = first ?? throw new ArgumentNullException("first");
     Second = second ?? throw new ArgumentNullException("second");
 }
Exemple #17
0
		protected override void CopyFrom(TypeBase type)
		{
			base.CopyFrom(type);

			DelegateType delegateType = (DelegateType) type;
			returnType = delegateType.returnType;
			argumentList = delegateType.argumentList.Clone();
		}
Exemple #18
0
 protected virtual void CopyFrom(TypeBase type)
 {
     name   = type.name;
     access = type.access;
 }
Exemple #19
0
 /// <exception cref="RelationException">
 /// Cannot create nesting relationship.
 /// </exception>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="parentClass"/> is null.-or-
 /// <paramref name="innerClass"/> is null.
 /// </exception>
 internal NestingRelation(CompositeType parentType, TypeBase innerType)
     : base(parentType, innerType)
 {
     Attach();
 }
		protected override SourceFileGenerator CreateSourceFileGenerator(TypeBase type)
		{
			return new JavaSourceFileGenerator(type, RootNamespace);
		}
Exemple #21
0
		/// <exception cref="ArgumentNullException">
		/// <paramref name="type"/> is null.
		/// </exception>
		public static Image GetImage(TypeBase type)
		{
			if (type == null)
				throw new ArgumentNullException("type");

			return GetImage(type.EntityType, type.AccessModifier);
		}
Exemple #22
0
		protected override void CopyFrom(TypeBase type)
		{
			base.CopyFrom(type);
			ClassType classType = (ClassType) type;
			modifier = classType.modifier;
		}
Exemple #23
0
 /// <exception cref="RelationshipException">
 /// Cannot create nesting relationship.
 /// </exception>
 internal NestingRelationship(CompositeType parentType, TypeBase innerType) :
     base(parentType, innerType)
 {
     RelationshipType = RelationshipType.Nesting;
     Attach();
 }
Exemple #24
0
		protected virtual void CopyFrom(TypeBase type)
		{
			name = type.name;
			access = type.access;
		}
Exemple #25
0
 /// <exception cref="ArgumentNullException">
 /// <paramref name="first"/> is null.-or-
 /// <paramref name="second"/> is null.
 /// </exception>
 internal DependencyRelationship(TypeBase first, TypeBase second) : base(first, second)
 {
     Attach();
 }
		public NestingRelationship Clone(CompositeType parentType, TypeBase innerType)
		{
			NestingRelationship nesting = new NestingRelationship(parentType, innerType);
			nesting.CopyFrom(this);
			return nesting;
		}
Exemple #27
0
 /// <exception cref="ArgumentNullException">
 /// <paramref name="first"/> is null.-or-
 /// <paramref name="second"/> is null.
 /// </exception>
 internal Dependency(TypeBase first, TypeBase second) : base(first, second)
 {
 }
		public DependencyRelationship Clone(TypeBase first, TypeBase second)
		{
			DependencyRelationship dependency = new DependencyRelationship(first, second);
			dependency.CopyFrom(this);
			return dependency;
		}
Exemple #29
0
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="first" /> is null.-or-
 ///     <paramref name="second" /> is null.
 /// </exception>
 internal AssociationRelationship(TypeBase first, TypeBase second, AssociationType type)
     : base(first, second)
 {
     associationType = type;
     Attach();
 }
Exemple #30
0
		protected override void CopyFrom(TypeBase type)
		{
			base.CopyFrom(type);

			EnumType enumType = (EnumType) type;
			values.Clear();
			values.Capacity = enumType.values.Capacity;
			foreach (EnumValue value in enumType.values)
			{
				values.Add(value.Clone());
			}
		}
Exemple #31
0
		internal void AddNestedChild(TypeBase type)
		{
			if (type != null && !nestedChilds.Contains(type))
			{
				nestedChilds.Add(type);
				Changed();
			}
		}