View Javadoc

1   /*
2   * E-nspire Gemini.
3   * A Java and AspectJ based framework that enables transparent 
4   * bidirectional relationships between Plain Old Java Objects.
5   * 
6   * Copyright (C) 2005 Dragan Djuric
7   * 
8   * This program is free software; you can redistribute it and/or
9   * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  * 
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21  * 
22  * Contact the author at dragand@dev.java.net
23  */
24  package com.enspire.gemini;
25  
26  /***
27   * A JavaBean property wrapper that updates its opposite property. 
28   * This kind of property most often represents a relationship end
29   * with multiplicity greater than 1.
30   *
31   * @author Dragan Djuric <dragand@dev.java.net>
32   * since 1.0
33   **/
34  public interface BidirectionalProperty {
35  
36      /***
37       * Gets the owner of this object.
38       * @return the owner
39       */
40      Object getOwner();
41  
42      /***
43       * Sets the owner of this object.
44       * @param owner new value
45       */
46      void setOwner(Object owner);
47      
48      /***
49       * Gets the updater of the another end of the represented relationship.
50       *
51       * @return relationshipUpdater the updater of the another end of the represented relationship
52       */
53      RelationshipUpdater getRelationshipUpdater();
54      
55      /***
56       * Sets the updater of the another end of the represented relationship.
57       *
58       * @param relationshipUpdater the updater of the another end of the represented relationship
59       */
60      void setRelationshipUpdater(RelationshipUpdater relationshipUpdater);
61      
62      /***
63       * Gets the name of the opposite property.
64       *
65       * @return name the name of the opposite property
66       */
67      String getOppositeName();
68      
69      /***
70       * Sets the name of the opposite property.
71       *
72       * @param name the name of the opposite property
73       */
74      void setOppositeName(String propertyName);
75      
76      /***
77       * Gets the value (e.g. the wrapped object) of the property.
78       *
79       * @return value
80       */
81      Object getPropertyValue();
82      
83      /***
84       * Sets the value (e.g. the wrapped object) of the property.
85       *
86       * @param value
87       */
88      void setPropertyValue(Object propertyValue);
89  }