1
2
3
4
5
6 package org.codehaus.modello.test.features;
7
8
9
10
11
12 import org.codehaus.modello.test.features.other.PackageNameFeature;
13 import org.codehaus.modello.test.features.other.SubInterfaceInPackage;
14
15
16
17
18
19
20 @SuppressWarnings( "all" )
21 public class BidiInList
22 implements java.io.Serializable
23 {
24
25
26
27
28
29
30
31
32 private AssociationFeatures parent;
33
34
35
36
37
38
39
40
41
42
43
44 public void breakAssociationFeaturesAssociation( AssociationFeatures associationFeatures )
45 {
46 if ( this.parent != associationFeatures )
47 {
48 throw new IllegalStateException( "associationFeatures isn't associated." );
49 }
50
51 this.parent = null;
52 }
53
54
55
56
57
58
59 public void createAssociationFeaturesAssociation( AssociationFeatures associationFeatures )
60 {
61 if ( this.parent != null )
62 {
63 breakAssociationFeaturesAssociation( this.parent );
64 }
65
66 this.parent = associationFeatures;
67 }
68
69
70
71
72
73
74 public AssociationFeatures getParent()
75 {
76 return this.parent;
77 }
78
79
80
81
82
83
84 public void setParent( AssociationFeatures parent )
85 {
86 if ( this.parent != null )
87 {
88 this.parent.breakBidiInListAssociation( this );
89 }
90
91 this.parent = parent;
92
93 if ( parent != null )
94 {
95 this.parent.createBidiInListAssociation( this );
96 }
97 }
98
99 }