|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.escot.OnDemandFeatureSupport
This is a utility class that may be used by beans which are ExplicitFeatureProviders that need to duplicate features when they are wired and remove them when they are unwired. You can use an instance of this class as a member field of your bean and delegate wiring listening to it. The bean should implement BeanWiringListener.
| Field Summary | |
protected ExplicitFeatureProvider |
mBean
|
protected com.sun.java.util.collections.HashSet |
mClasses
|
| Constructor Summary | |
OnDemandFeatureSupport(ExplicitFeatureProvider bean)
|
|
OnDemandFeatureSupport(ExplicitFeatureProvider bean,
Class featureClass)
Constructor that specifies the bean and a class of instances that should be duplicated when wired to and removed when unwired. |
|
| Method Summary | |
void |
addFeatureClass(Class featureClass)
Adds a class of instances that should be duplicated when wired and removed when unwired. |
protected void |
expandFeatureSet(EscotFeature targetFeature,
EscotFeature associatedFeature,
Wire wire)
Expands the feature set when a feature belonging to the bean that is an instance of one of the classes designated for expansion, has been wired. |
protected String |
generateWiredFeatureName(EscotFeature targetFeature,
EscotFeature associatedFeature,
Wire wire)
Override this if a feature that has been wired should be renamed. |
protected Object |
newFeature(EscotFeature feat)
Creates a new feature based on the specified feature. |
protected void |
registerFeature(Object feat)
Adds the feature to the registry. |
void |
removeFeatureClass(Class featureClass)
Removes a class of instances that should be duplicated when wired and removed when unwired. |
protected void |
unregisterFeature(Object feat)
Removes the feature from the registry. |
void |
wireAdded(BeanWiringEvent evt)
Invoked when a wire has been added involving the bean. |
void |
wireRemoved(BeanWiringEvent e)
Invoked when a wire has been removed involving the bean. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected ExplicitFeatureProvider mBean
protected com.sun.java.util.collections.HashSet mClasses
| Constructor Detail |
public OnDemandFeatureSupport(ExplicitFeatureProvider bean)
public OnDemandFeatureSupport(ExplicitFeatureProvider bean,
Class featureClass)
| Method Detail |
public void addFeatureClass(Class featureClass)
public void removeFeatureClass(Class featureClass)
public void wireAdded(BeanWiringEvent evt)
expandFeatureSet
to expand the number of features.wireAdded in interface BeanWiringListenerpublic void wireRemoved(BeanWiringEvent e)
unregisterFeature.wireRemoved in interface BeanWiringListener
protected void expandFeatureSet(EscotFeature targetFeature,
EscotFeature associatedFeature,
Wire wire)
generateWiredFeatureName,
creates a duplicate feature
by calling newFeature, and adds it to the
registry by calling registerFeature.
protected String generateWiredFeatureName(EscotFeature targetFeature,
EscotFeature associatedFeature,
Wire wire)
protected Object newFeature(EscotFeature feat)
throws InstantiationException,
IllegalAccessException
protected void registerFeature(Object feat)
protected void unregisterFeature(Object feat)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||