jp.gr.javacons.jim
クラス DataReferencer

java.lang.Object
  |
  +--jp.gr.javacons.jim.DataReferencer

public class DataReferencer
extends Object
implements DataReferenceMaintainer, Serializable

DataReferencer is the class of the object that is held as a property of a JIM GUI Bean and has the function of automatically establishing a reference relationship between the GUI Bean object and the DataHolder object to be referred. The process of establishing the reference relationship includes the following.

・ Acquisition of a reference to the DataHolder object from the DataReferencer object

・ Listener registration from the JIM GUI Bean to the DataHolder object

By acquiring a reference to the DataHolder object, a JIM GUI Bean is able to make update processing requests directly to the DataHolder object. By listener registration, events are informed to the JIM GUI Bean side corresponding to changes in the DataHolder object.

If the information to identify the DataHolder object (dataHolderName of the DataHolder object and dataProviderName of the DataProvider object which holds and maintains the DataHolder object) to which the DataReferencer object is to refer has been set, then at the time the DataReferencer object and the DataHolder object become available, the Manager object behaves as a mediator and automatically maintains the relationship between them.

In addition, the DataReferencerEditor is provided in the JIM framework for editing the property that holds the DataReferencer object. At design-time the application developer can specify the DataHolder object within the properties of the DataReferencer object in the JIM GUI Bean.

A JIM GUI Bean that holds a DataReferencer object(s) must implement the DataReferencerOwner interface.

Note) With component programming using JavaBeans, some methods in the container (applet) should use source code to describe the various relationships of the listener registration between Beans in the container. With the JIM framework, only the dataHolderName of the DataHolder object to be referred to and the dataProviderName of the DataProvider object that holds the DataHolder object need to be set in the DataReferencer object held in a Bean. Special source code to establish the relationship between the DataHolder object and the JIM GUI Bean is not necessary.

A JIM GUI Bean must implement a mechanism to reproduce the relationship in the setter method for the property holding the DataReferencer object and also in the addNotify method. It must also implement a mechanism to dissolve the relationship in the removeNotify method. The implementation examples are described in Section 8., "JIM GUI Bean".

関連項目:
直列化された形式

コンストラクタの概要
DataReferencer(DataReferencerOwner owner)
          This creates a DataReferencer object using a DataReferencerOwner object (JIM GUI Bean) as an argument.
DataReferencer(String dataProviderName, String dataHolderName)
          This creates a DataReferencer object using dataProviderName and dataHolderName as arguments.
 
メソッドの概要
 void addedAsDataReferenceMaintainer()
          This acquires the DataHolder object to be referred to using the character string information maintained by the DataReferencer to identify the DataHolder.
 void connect(DataReferencerOwner jimGUI)
          This registers this DataReferencer object with the Manager object.
 void dataHolderAvailable(DataProvider dp, DataHolder[] dhs)
          This processes the reference relationship when the reference object is included in the arguments and no reference relationship has been established yet.
 void dataHolderRenamed(DataProvider dp, DataHolder dh, String newName, String oldName)
          If oldName corresponds to the character string that identifies a DataHolder object to be referred to and the reference relation has already been established, the character string is changed to newName.
 void dataHolderRevoked(DataProvider dp, DataHolder[] dhs)
          When the objects with a reference relationship are included in the arguments, this will dissolve the relationship.
 void dataProviderAvailable(DataProvider dp, DataHolder[] dhs)
          This processes the reference relationship when the reference object is included in the arguments and no reference relationship has been established yet.
 void dataProviderRenamed(DataProvider dp, String newName, String oldName)
          If oldName corresponds to the character string that identifies the DataProvider object that holds the DataHolder object to be referred to and the reference relation has already been established, the character string is changed to newName.
 void dataProviderRevoked(DataProvider dp, DataHolder[] dhs)
          When the objects with a reference relationship are included in the arguments, this will dissolve the relationship.
 void disconnect(DataReferencerOwner jimGUI)
          This deregisters this DataReferencer object from the Manager object.
 DataHolder getDataHolder()
          This returns the DataHolder object that has a reference relationship.
 String getDataHolderName()
          This returns the dataHolderName of the DataHolder object that should be referred to.
 String getDataProviderName()
          This returns the dataProviderName of the DataProvider object that holds the DataHolder object to be referred to.
 Class[][] getReferableDataHolderTypeInfo()
          This queries the owner of this DataReferencer object as to what DataHolder types can be referred to.
 void removedAsDataReferenceMaintainer()
          The reference relation to the DataHolder object(s) is released.
 void setDataHolderID(String dataProviderName, String dataHolderName)
           
 String toString()
           
 
クラス java.lang.Object から継承したメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

DataReferencer

public DataReferencer(String dataProviderName,
                      String dataHolderName)
This creates a DataReferencer object using dataProviderName and dataHolderName as arguments.

dataProviderName

This character string information identifies the DataProvider object that holds the DataHolder object to be referred to. A null or empty string can be used to put it into a state with no reference to any DataHolder object.

dataHolderName

This character string information identifies the DataHolder object to be referred to. A null or empty string can be used to put it into a state with no reference to a DataHolder object.


DataReferencer

public DataReferencer(DataReferencerOwner owner)
This creates a DataReferencer object using a DataReferencerOwner object (JIM GUI Bean) as an argument.
メソッドの詳細

addedAsDataReferenceMaintainer

public void addedAsDataReferenceMaintainer()
This acquires the DataHolder object to be referred to using the character string information maintained by the DataReferencer to identify the DataHolder. Processing of the reference relationship to the DataHolder object is also performed. If not acquired, the processing is not performed.
定義:
インタフェース DataReferenceMaintainer 内の addedAsDataReferenceMaintainer

connect

public void connect(DataReferencerOwner jimGUI)
This registers this DataReferencer object with the Manager object. After registration, the Manager object invokes the addedAsDataReferenceMaintainer method. If this connect method has already been invoked and pefromed this action, then no action takes place.

dataHolderAvailable

public void dataHolderAvailable(DataProvider dp,
                                DataHolder[] dhs)
This processes the reference relationship when the reference object is included in the arguments and no reference relationship has been established yet.

Note) When Beans such as DataProvider Beans and JIM GUI Beans are recreated when starting the runtime application (applet), listener registration from a GUI Bean to a DataHolder object needs to be recreated. Specifically, even if either of the DataHolder object or DataReferencer object is reproduced in advance, the listener registration should be recreated correctly with the DataHolder object.

When a DataProvider Bean is recreated and becomes available, the Manager object calls the dataProviderAvailable method of the DataRefefencer object with the arguments of the DataProvider object and the DataHolder objects which is held by the DataProvider object if the DataReferencer object has already been created.

When a DataHolder object is added to a DataProvider object which has already been available, the Manager object calls the the dataHolderAvailable method of the DataReferencer object if it has already been recreated with a JIM GUI Bean.

定義:
インタフェース DataReferenceMaintainer 内の dataHolderAvailable

dataHolderRenamed

public void dataHolderRenamed(DataProvider dp,
                              DataHolder dh,
                              String newName,
                              String oldName)
If oldName corresponds to the character string that identifies a DataHolder object to be referred to and the reference relation has already been established, the character string is changed to newName. Otherwise if the character string which identifies the DataHolder object corresponds to newName and no reference relation has yet been established, an attempt is made to acquire the DataHolder object for reference to, and to establish the reference relation.

This method is invoked when there is a change in the dataHolderName of the DataHolder object of the second argument, which is held by the DataProvider object of the first argument registered with the Manager object.

定義:
インタフェース DataReferenceMaintainer 内の dataHolderRenamed

dataHolderRevoked

public void dataHolderRevoked(DataProvider dp,
                              DataHolder[] dhs)
When the objects with a reference relationship are included in the arguments, this will dissolve the relationship.
定義:
インタフェース DataReferenceMaintainer 内の dataHolderRevoked

dataProviderAvailable

public void dataProviderAvailable(DataProvider dp,
                                  DataHolder[] dhs)
This processes the reference relationship when the reference object is included in the arguments and no reference relationship has been established yet.

Note) When Beans such as DataProvider Beans and JIM GUI Beans are recreated when starting the runtime application (applet), listener registration from a GUI Bean to a DataHolder object needs to be recreated. Specifically, even if either of the DataHolder object or DataReferencer object is reproduced in advance, the listener registration should be recreated correctly with the DataHolder object.

When a DataProvider Bean is recreated and becomes available, the Manager object calls the dataProviderAvailable method of the DataRefefencer object with the arguments of the DataProvider object and the DataHolder objects which is held by the DataProvider object if the DataReferencer object has already been created.

When a DataHolder object is added to a DataProvider object which has already been available, the Manager object calls the the dataHolderAvailable method of the DataReferencer object if it has already been recreated with a JIM GUI Bean.

定義:
インタフェース DataReferenceMaintainer 内の dataProviderAvailable

dataProviderRenamed

public void dataProviderRenamed(DataProvider dp,
                                String newName,
                                String oldName)
If oldName corresponds to the character string that identifies the DataProvider object that holds the DataHolder object to be referred to and the reference relation has already been established, the character string is changed to newName. Otherwise if the character string which identifies the DataProvider object corresponds to newName and no reference relation has yet been established, an attempt is made to acquire the DataHolder object for reference to, and to establish the reference relation.

This method is invoked when there is a change in the dataProviderName of the DataProvider object of the first argument, which has been registered with the Manager object.

定義:
インタフェース DataReferenceMaintainer 内の dataProviderRenamed

dataProviderRevoked

public void dataProviderRevoked(DataProvider dp,
                                DataHolder[] dhs)
When the objects with a reference relationship are included in the arguments, this will dissolve the relationship.
定義:
インタフェース DataReferenceMaintainer 内の dataProviderRevoked

disconnect

public void disconnect(DataReferencerOwner jimGUI)
This deregisters this DataReferencer object from the Manager object. After deregistration, the Manager object invokes the removedAsDataReferenceMaintainer method.

getDataHolder

public DataHolder getDataHolder()
This returns the DataHolder object that has a reference relationship. Null is returned if no reference relationship exists.

getDataHolderName

public String getDataHolderName()
This returns the dataHolderName of the DataHolder object that should be referred to. If the dataHolderName has not been set, a null or empty string is returned.

getDataProviderName

public String getDataProviderName()
This returns the dataProviderName of the DataProvider object that holds the DataHolder object to be referred to. If the dataProviderName has not been set, a null or empty string is returned.

getReferableDataHolderTypeInfo

public Class[][] getReferableDataHolderTypeInfo()
This queries the owner of this DataReferencer object as to what DataHolder types can be referred to. The return value is an array (Class[][]) of which each element is also an array where the first element is the Class object which represents the class of the DataHolder object. The second and subsequent elements are the Class objects for the value classes of the DataHolder object. If the Class object of the value class is defined as fixed by the getValueClass method of a DataHolder subclass, the Class objects after the second element can be omitted. The Class objects above can include abstract classes.

removedAsDataReferenceMaintainer

public void removedAsDataReferenceMaintainer()
Description copied from interface: DataReferenceMaintainer
The reference relation to the DataHolder object(s) is released.

This method is invoked at deregistration from the Manager object.

定義:
インタフェース DataReferenceMaintainer 内の removedAsDataReferenceMaintainer

setDataHolderID

public void setDataHolderID(String dataProviderName,
                            String dataHolderName)

toString

public String toString()
オーバーライド:
クラス Object 内の toString