© 2002 BEA Systems, Inc.


com.bea.p13n.property
Class AbstractHierarchicalEntity

java.lang.Object
  |
  +--com.bea.p13n.property.AbstractConfigurableEntity
        |
        +--com.bea.p13n.property.AbstractHierarchicalEntity

public abstract class AbstractHierarchicalEntity
extends AbstractConfigurableEntity
implements HierarchicalEntity

Lightweight implementation of HierarchicalEntity. Like AbstractConfigurableEntity, this does not provide any persistence for property values, and does not use property sets to validate property values or retrieve default property values. It provides successor functionality by storing references to its successor objects, rather than using the id's like the EJB implementation does. Any lightweight objects that require HierarchicalEntity functionality should extend this class.

See Also:
Serialized Form

Fields inherited from class com.bea.p13n.property.AbstractConfigurableEntity
CE_METHOD_CACHE, instanceClass, PREFIX_GET, PREFIX_SET, propertyCache, textFormatter
 
Constructor Summary
AbstractHierarchicalEntity()
           
 
Method Summary
protected  java.lang.Object getImplicitProperty(java.lang.String propertySet, java.lang.String propertyName)
          Override ConfigurableEntity.getImplicitProperty to do a successor search if the property was not found in this entity
protected  java.lang.Object getImplicitProperty(java.lang.String propertySet, java.lang.String propertyName, ConfigurableEntity explicitSuccessor)
           
 java.lang.Object getProperty(java.lang.String propertySet, java.lang.String propertyName, ConfigurableEntity successor)
          Retrieve the value associated with the named key in the specified property set.
 java.lang.String getPropertyAsString(java.lang.String propertySet, java.lang.String propertyName, ConfigurableEntity successor)
          Convenience method to return the property as a String.
 java.lang.Object getPropertyNoDefault(java.lang.String propertySet, java.lang.String propertyName, ConfigurableEntity successor)
          Retrieve the value associated with the property in the specified property set, but does not return a default value from the property's PropertyDefinition if the property does not exist for the entity or in the hierarchy of successors.
 ConfigurableEntity getSuccessor(java.lang.String propertySet)
          Retrieve the successor for the specified property set.
 void removeSuccessor(java.lang.String propertySet)
          Remove the successor for the specified propertySet.
 void setSuccessor(java.lang.String propertySet, ConfigurableEntity successor)
          This sets the successor for this object.
 
Methods inherited from class com.bea.p13n.property.AbstractConfigurableEntity
createMapKey, getCachedProperty, getExplicitProperty, getExplicitSetter, getJndiName, getPkString, getProperty, getPropertyAsString, getPropertyCache, getPropertyNoDefault, getUniqueId, hasExplicitGetter, hasExplicitSetter, removeExplicitProperty, removeProperty, setExplicitProperty, setProperty, upcaseFirst
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractHierarchicalEntity

public AbstractHierarchicalEntity()
Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String propertySet,
                                    java.lang.String propertyName,
                                    ConfigurableEntity successor)
                             throws java.rmi.RemoteException
Retrieve the value associated with the named key in the specified property set. If the entity does not have a value defined for that property, the property will be searched * in the successor hiearchy using the explicit successor first and then the successor for the specified scope, and finally the entity's default successor. If this search does not return a value, the default value from the property set will be returned.
Specified by:
getProperty in interface HierarchicalEntity

Parameters:
propertySet - The name of the property set
propertyName - The name of the property to retrieve.
successor - The explicit successor to use for sucessor hiearchy search if the entity does not have the property defined.

getPropertyAsString

public java.lang.String getPropertyAsString(java.lang.String propertySet,
                                            java.lang.String propertyName,
                                            ConfigurableEntity successor)
                                     throws java.rmi.RemoteException
Convenience method to return the property as a String. Follows the same search order as the getProperty method.
Specified by:
getPropertyAsString in interface HierarchicalEntity

Parameters:
propertySet - The name of the property set
propertyName - The name of the property to retrieve.
successor - The explicit successor to use for sucessor hiearchy search if the entity does not have the property defined.

getPropertyNoDefault

public java.lang.Object getPropertyNoDefault(java.lang.String propertySet,
                                             java.lang.String propertyName,
                                             ConfigurableEntity successor)
                                      throws java.rmi.RemoteException
Retrieve the value associated with the property in the specified property set, but does not return a default value from the property's PropertyDefinition if the property does not exist for the entity or in the hierarchy of successors. This method is used by the implementation of the getProperty methods so that the search in the successor hierarchy does not return a default value from the PropertySet.
Specified by:
getPropertyNoDefault in interface HierarchicalEntity

Parameters:
propertySet - The name of the property set
propertyName - The name of the property to retrieve.
successor - The explicit successor to use for sucessor hiearchy search if the entity does not have the property defined.

getImplicitProperty

protected java.lang.Object getImplicitProperty(java.lang.String propertySet,
                                               java.lang.String propertyName)
                                        throws java.rmi.RemoteException
Override ConfigurableEntity.getImplicitProperty to do a successor search if the property was not found in this entity

Parameters:
propertySet - The name of the property set
propertyName - The name of the property to retrieve.
Overrides:
getImplicitProperty in class AbstractConfigurableEntity

getImplicitProperty

protected java.lang.Object getImplicitProperty(java.lang.String propertySet,
                                               java.lang.String propertyName,
                                               ConfigurableEntity explicitSuccessor)
                                        throws java.rmi.RemoteException


getSuccessor

public ConfigurableEntity getSuccessor(java.lang.String propertySet)
                                throws java.rmi.RemoteException
Retrieve the successor for the specified property set.
Specified by:
getSuccessor in interface HierarchicalEntity

Parameters:
propertySet - The name of the property set

removeSuccessor

public void removeSuccessor(java.lang.String propertySet)
                     throws java.rmi.RemoteException
Remove the successor for the specified propertySet.
Specified by:
removeSuccessor in interface HierarchicalEntity


setSuccessor

public void setSuccessor(java.lang.String propertySet,
                         ConfigurableEntity successor)
                  throws java.rmi.RemoteException
This sets the successor for this object. This is used when resolving the getProperty.
Specified by:
setSuccessor in interface HierarchicalEntity

Parameters:
successor -  

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved