org.progeeks.meta.util
Class CompositeMetaObject

java.lang.Object
  extended by org.progeeks.util.beans.BeanChangeSupport
      extended by org.progeeks.meta.util.CompositeMetaObject
All Implemented Interfaces:
MetaObject, StandardBean

public class CompositeMetaObject
extends BeanChangeSupport
implements MetaObject

Meta-object implementation that provides a composite view of several internal meta-objects each given their own subname.

Version:
$Revision: 1.10 $
Author:
Paul Speed

Constructor Summary
CompositeMetaObject(java.lang.String[] keys, MetaObject[] objects, MetaClass compositeClass)
           
CompositeMetaObject(java.lang.String[] keys, MetaObject[] objects, MetaClass compositeClass, MetaKit kit)
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Overridden to add a listener to the sub-objects when the first change listener is added.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
          Overridden to add a listener to the sub-objects when the first change listener is added.
protected  void addSubObjectListeners()
           
 MetaClass getMetaClass()
          Returns the meta-class associated with this object.
 MetaKit getMetaKit()
          Returns the meta-kit for this meta-object's implementation layer.
 MetaObject getMetaObject(java.lang.String name)
          Returns the composited meta-object for the specified key.
 java.lang.Object getProperty(java.lang.String name)
          Returns the value of the specified property.
 PropertyMutator getPropertyMutator(java.lang.String name)
          Returns a mutator for the specified property.
protected  org.progeeks.meta.util.CompositeMetaObject.ResolvedProperty getResolvedProperty(java.lang.String propertyName, boolean create)
          Returns the meta-object preresolved entry for the specified key, creating one if necessary as per the create flag.
 void propertyChanged(java.lang.String name, java.lang.Object oldValue)
          Notifies listeners that the property value has changed outside of the BeanMetaObject's control.
 void release()
          Releases any internal resources that may be held by the underlying implementation.
 void release(boolean releaseAll)
          Releases any internal resources that may be held by the underlying implementation.
 void setMetaObject(java.lang.String name, MetaObject metaObject)
          Replaces one of the internal meta-objects specified by name with the supplied meta-object.
 void setProperty(java.lang.String name, java.lang.Object value)
          Sets the value of the specified property.
 
Methods inherited from class org.progeeks.util.beans.BeanChangeSupport
clearAllListeners, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, hasListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.progeeks.meta.MetaObject
clearAllListeners, hasListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

CompositeMetaObject

public CompositeMetaObject(java.lang.String[] keys,
                           MetaObject[] objects,
                           MetaClass compositeClass)

CompositeMetaObject

public CompositeMetaObject(java.lang.String[] keys,
                           MetaObject[] objects,
                           MetaClass compositeClass,
                           MetaKit kit)
Method Detail

release

public void release()
Releases any internal resources that may be held by the underlying implementation. This clears the internal data structures but does NOT release the contained meta-objects.

Specified by:
release in interface MetaObject

release

public void release(boolean releaseAll)
Releases any internal resources that may be held by the underlying implementation. If the release all flag is true then the sub-objects will also be released... note: any contained CompositeMetaObjects will not be released completely since their normal release method will be called.


addSubObjectListeners

protected void addSubObjectListeners()

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Overridden to add a listener to the sub-objects when the first change listener is added.

Specified by:
addPropertyChangeListener in interface MetaObject
Specified by:
addPropertyChangeListener in interface StandardBean
Overrides:
addPropertyChangeListener in class BeanChangeSupport

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener l)
Overridden to add a listener to the sub-objects when the first change listener is added.

Specified by:
addPropertyChangeListener in interface MetaObject
Specified by:
addPropertyChangeListener in interface StandardBean
Overrides:
addPropertyChangeListener in class BeanChangeSupport

setMetaObject

public void setMetaObject(java.lang.String name,
                          MetaObject metaObject)
Replaces one of the internal meta-objects specified by name with the supplied meta-object. This is an unsupported operation right now.


getMetaObject

public MetaObject getMetaObject(java.lang.String name)
Returns the composited meta-object for the specified key.


setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Sets the value of the specified property.

Specified by:
setProperty in interface MetaObject

getProperty

public java.lang.Object getProperty(java.lang.String name)
Returns the value of the specified property.

Specified by:
getProperty in interface MetaObject

getPropertyMutator

public PropertyMutator getPropertyMutator(java.lang.String name)
Returns a mutator for the specified property.

Specified by:
getPropertyMutator in interface MetaObject

getMetaClass

public MetaClass getMetaClass()
Returns the meta-class associated with this object.

Specified by:
getMetaClass in interface MetaObject

getMetaKit

public MetaKit getMetaKit()
Returns the meta-kit for this meta-object's implementation layer.

Specified by:
getMetaKit in interface MetaObject

propertyChanged

public void propertyChanged(java.lang.String name,
                            java.lang.Object oldValue)
Notifies listeners that the property value has changed outside of the BeanMetaObject's control.


getResolvedProperty

protected org.progeeks.meta.util.CompositeMetaObject.ResolvedProperty getResolvedProperty(java.lang.String propertyName,
                                                                                          boolean create)
Returns the meta-object preresolved entry for the specified key, creating one if necessary as per the create flag.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.