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; }
/// <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(); }
private bool IsNestedAncestor(TypeBase type) { if (NestingParent != null && NestingParent.IsNestedAncestor(type)) return true; else return (type == this); }
/// <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; }
internal AssociationRelationship(TypeBase first, TypeBase second) : base(first, second) { Attach(); }
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; }
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)); } }
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"); }
protected override void CopyFrom(TypeBase type) { base.CopyFrom(type); DelegateType delegateType = (DelegateType) type; returnType = delegateType.returnType; argumentList = delegateType.argumentList.Clone(); }
protected virtual void CopyFrom(TypeBase type) { name = type.name; access = type.access; }
/// <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); }
/// <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); }
protected override void CopyFrom(TypeBase type) { base.CopyFrom(type); ClassType classType = (ClassType) type; modifier = classType.modifier; }
/// <exception cref="RelationshipException"> /// Cannot create nesting relationship. /// </exception> internal NestingRelationship(CompositeType parentType, TypeBase innerType) : base(parentType, innerType) { RelationshipType = RelationshipType.Nesting; Attach(); }
public NestingRelationship Clone(CompositeType parentType, TypeBase innerType) { NestingRelationship nesting = new NestingRelationship(parentType, innerType); nesting.CopyFrom(this); return nesting; }
/// <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; }
/// <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(); }
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()); } }
internal void AddNestedChild(TypeBase type) { if (type != null && !nestedChilds.Contains(type)) { nestedChilds.Add(type); Changed(); } }