All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.samples.dips.context.AuthorContextDip
java.lang.Object
|
+----com.ibm.beans.dip.SimpleDip
|
+----com.ibm.beans.samples.dips.context.AuthorContextDip
- public final class AuthorContextDip
- extends SimpleDip
- implements Dip, ContextElement, Serializable, DipPropertyChangeListener
The AuthorContext allows a user or application assembly expert to put an author
name on an instance of a bean. The update policy provides the assembly specialist
with a way to identify when the authorship of an instance changes.
-
AuthorContextDip()
- Constructs an AuthorContextDip.
-
addAuthor(String)
- Adds an author's name to the list of authors.
-
createImplementation(Object)
- Creates the dip implementation, and provides the dip access to the
dippable bean.
-
createPropertyChangeListener(Object, String[])
- Returns an array of PropertyChangeListeners describing the method to
call after the dipped bean's property change method is called.
-
getAuthors()
- Get the names of the author, a convenience method, equivalent to
getContextElement.
-
getContextElement()
- Gets the names of the authors as the context element.
-
getContextElementName()
- Gets the name of the Context element.
-
getUpdatePolicy()
- Gets the update policy for the context element.
-
propertyChange(PropertyChangeEvent)
- Checks to see if the property changed is in the
context update policy.
-
retrieveDip()
- Provides the framework with access to the dip.
-
setAuthors(Vector)
- Sets the names of the authors, a convenience method, equivalent to
setContextElement.
-
setContextElement(Object)
- Sets the names of the authors as the context element.
-
setUpdatePolicy(ContextUpdatePolicy)
- Sets the update policy for the context element.
-
typeName()
- Returns the dip type name as a String.
AuthorContextDip
public AuthorContextDip()
- Constructs an AuthorContextDip.
getAuthors
public Vector getAuthors()
- Get the names of the author, a convenience method, equivalent to
getContextElement.
- Returns:
- A vector of strings representing the names of the authors.
addAuthor
public void addAuthor(String name)
- Adds an author's name to the list of authors.
- Parameters:
- name - A String representing the name of the author to be added.
setAuthors
public void setAuthors(Vector names)
- Sets the names of the authors, a convenience method, equivalent to
setContextElement.
- Parameters:
- names - A Vector of Strings representing the names of the authors.
getContextElement
public Object getContextElement()
- Gets the names of the authors as the context element.
- Returns:
- An object representing the names of the author.
setContextElement
public void setContextElement(Object o)
- Sets the names of the authors as the context element.
- Parameters:
- o - An object which is a String representing the names of the authors.
getContextElementName
public String getContextElementName()
- Gets the name of the Context element.
- Returns:
- A String that identifies the kind of context.
getUpdatePolicy
public ContextUpdatePolicy getUpdatePolicy()
- Gets the update policy for the context element.
- Returns:
- A context policy update object
setUpdatePolicy
public void setUpdatePolicy(ContextUpdatePolicy up)
- Sets the update policy for the context element.
- Parameters:
- up - The context policy update object for this element.
typeName
public final String typeName()
- Returns the dip type name as a String.
- Returns:
- The type name of the dip.
- Overrides:
- typeName in class SimpleDip
createImplementation
public Object createImplementation(Object obj) throws DipRejectAdditionException
- Creates the dip implementation, and provides the dip access to the
dippable bean.
- Parameters:
- obj - The bean being dipped.
- Throws: DipRejectAdditionException
- This exception is thrown if
the dip rejects being added to the bean. Author context
does not throw this exception.
- Overrides:
- createImplementation in class SimpleDip
createPropertyChangeListener
public DipPropertyChangeListener[] createPropertyChangeListener(Object imp,
String methods[]) throws DipRejectAdditionException
- Returns an array of PropertyChangeListeners describing the method to
call after the dipped bean's property change method is called.
For context dips this returns the list of PropertyChangeListeners that
correspond to the update policy.
- Parameters:
- imp - This is the implementation returned from createImplementation
- methods[] - This is the array of event methods in the dippable bean.
- Returns:
- The array of PropertyChangeListeners is a one-to-one mapping
with the methods[] input parameter. This means
PropertyChangeListener[i] will be used with methods[i], and
the length of the two arrays are equal.
- Throws: DipRejectAdditionException
- This exception is thrown if
the dip rejects being added to the bean. Author context
does not throw this exception.
- Overrides:
- createPropertyChangeListener in class SimpleDip
retrieveDip
public Dip retrieveDip()
- Provides the framework with access to the dip.
- Returns:
- A reference to this instance.
- Overrides:
- retrieveDip in class SimpleDip
propertyChange
public synchronized void propertyChange(PropertyChangeEvent evt)
- Checks to see if the property changed is in the
context update policy. If it is, it invokes an author dialog.
The author dialog allows the user to attach a new author to
an instance of a bean.
- Parameters:
- evt - The PropertyChangeEvent that the dip heard. This is
checked against the properties registered in the context
update policy.
All Packages Class Hierarchy This Package Previous Next Index