AbstractHierarchicalEntity Class

com.bea.p13n.property
AbstractHierarchicalEntity Class

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.


Hierarchy
Object
  AbstractConfigurableEntity
    AbstractHierarchicalEntity
All Implemented Interfaces

ConfigurableEntity, HierarchicalEntity, Serializable

Field Summary

   
Fields from  com.bea.p13n.property.AbstractConfigurableEntity
CE_METHOD_CACHE, instanceClass, PREFIX_GET, PREFIX_SET, propertyCache, textFormatter
 
Fields from interface com.bea.p13n.property.ConfigurableEntity
RESERVED_PROPERTY_SET
 
Fields from interface com.bea.p13n.property.HierarchicalEntity
SUCCESSOR
 

Constructor Summary

AbstractHierarchicalEntity()

 

Method Summary

protected Object
getImplicitProperty(String propertySet, String propertyName)
Override ConfigurableEntity.getImplicitProperty to do a successor search if the property was not found in this entity
protected Object
getImplicitProperty(String propertySet, String propertyName, ConfigurableEntity explicitSuccessor)
public Object
getProperty(String propertySet, String propertyName, ConfigurableEntity successor)
Retrieve the value associated with the named key in the specified property set.
public String
getPropertyAsString(String propertySet, String propertyName, ConfigurableEntity successor)
Convenience method to return the property as a String.
public Object
getPropertyNoDefault(String propertySet, 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.
public ConfigurableEntity
getSuccessor(String propertySet)
Retrieve the successor for the specified property set.
public void
removeSuccessor(String propertySet)
Remove the successor for the specified propertySet.
public void
setSuccessor(String propertySet, ConfigurableEntity successor)
This sets the successor for this object.
 
Methods from  com.bea.p13n.property.AbstractConfigurableEntity
createMapKey, getCachedProperty, getExplicitProperty, getExplicitSetter, getJndiName, getPkString, getProperty, getPropertyAsString, getPropertyCache, getPropertyNoDefault, getUniqueId, hasExplicitGetter, hasExplicitSetter, removeExplicitProperty, removeProperty, setExplicitProperty, setProperty, upcaseFirst
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface com.bea.p13n.property.ConfigurableEntity
getJndiName, getPkString, getProperty, getPropertyAsString, getPropertyNoDefault, getUniqueId, removeProperty, setProperty
 
Methods from interface com.bea.p13n.property.HierarchicalEntity
getProperty, getPropertyAsString, getPropertyNoDefault, getSuccessor, removeSuccessor, setSuccessor
 

Constructor Detail

AbstractHierarchicalEntity

public AbstractHierarchicalEntity()
 

Method Detail

getImplicitProperty(String, String) Method

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

Overrides
AbstractConfigurableEntity.getImplicitProperty(String, String)

Parameters

propertySet
The name of the property set
propertyName
The name of the property to retrieve.

Returns

the property value, or null if it was not found

Exceptions

RemoteException

getImplicitProperty(String, String, ConfigurableEntity) Method

protected Object getImplicitProperty(String propertySet, 
                                     String propertyName, 
                                     ConfigurableEntity explicitSuccessor)
throws RemoteException

Exceptions

RemoteException

getProperty(String, String, ConfigurableEntity) Method

public Object getProperty(String propertySet, 
                          String propertyName, 
                          ConfigurableEntity successor)
throws 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.

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.

Exceptions

RemoteException

getPropertyAsString(String, String, ConfigurableEntity) Method

public String getPropertyAsString(String propertySet, 
                                  String propertyName, 
                                  ConfigurableEntity successor)
throws RemoteException
Convenience method to return the property as a String. Follows the same search order as the getProperty method.

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.

Exceptions

RemoteException

getPropertyNoDefault(String, String, ConfigurableEntity) Method

public Object getPropertyNoDefault(String propertySet, 
                                   String propertyName, 
                                   ConfigurableEntity successor)
throws 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.

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.

Exceptions

RemoteException

getSuccessor(String) Method

public ConfigurableEntity getSuccessor(String propertySet)
throws RemoteException
Retrieve the successor for the specified property set.

Parameters

propertySet
The name of the property set

Exceptions

RemoteException

removeSuccessor(String) Method

public void removeSuccessor(String propertySet)
throws RemoteException
Remove the successor for the specified propertySet.

Parameters

propertySet
The name of the property set

Exceptions

RemoteException

setSuccessor(String, ConfigurableEntity) Method

public void setSuccessor(String propertySet, 
                         ConfigurableEntity successor)
throws RemoteException
This sets the successor for this object. This is used when resolving the getProperty.

Exceptions

RemoteException