|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bea.p13n.property.AbstractConfigurableEntity
public abstract class AbstractConfigurableEntity
Abstract base class for ConfigurableEntity implementations. This class provides the basic CE functionality, including explicit properties, but does not persist properties in any way. It also does not use Property Sets for property validation or default value retrieval. Any classes that wish to use the ConfigurableEntity functionality in a lightweight object should extend this.
Field Summary | |
---|---|
protected static String |
CE_METHOD_CACHE
cache name for CE explicit methods |
protected Class |
instanceClass
The actual implementation class of this entity |
protected static String |
PREFIX_GET
prefix to find accessor methods via reflection |
protected static String |
PREFIX_SET
prefix to find mutator methods via reflection |
protected EntityPropertyCache |
propertyCache
internal store of properties |
protected static com.bea.p13n.i18n.PropertyExceptionTextFormatter |
textFormatter
Exception class |
Fields inherited from interface com.bea.p13n.property.ConfigurableEntity |
---|
RESERVED_PROPERTY_SET |
Constructor Summary | |
---|---|
AbstractConfigurableEntity()
|
Method Summary | |
---|---|
static PropertyMapKey |
createMapKey(String propertySet,
String propertyName)
Helper function that will allocate a PropertyMapKey from a property set name and property name. |
Object |
getCachedProperty(String propertySet,
String propertyName)
Retrieve the value associated with the key from the object cache |
protected Object |
getExplicitProperty(String propertyName)
Find and invoke the explicit accessor method for the given property in the implementation class of the entity. |
protected Method |
getExplicitSetter(String propertyName,
Object value)
Search for a setter method for the given property name and value object. |
protected Object |
getImplicitProperty(String propertySet,
String propertyName)
Look for a value for the given property in the standard database tables. |
String |
getJndiName()
Retrieve the jndi name for an entity. |
String |
getPkString()
Retrieve the pk string for an entity. |
Object |
getProperty(String propertySet,
String propertyName)
Retrieve the value that was persisted for this entity for the given property, within the given property set. |
String |
getPropertyAsString(String propertySet,
String propertyName)
Convenience method to return a property as a String. |
EntityPropertyCache |
getPropertyCache()
Allocate the property map and load it using the EntityPropertyManager. |
Object |
getPropertyNoDefault(String propertySet,
String propertyName)
Retrieve the value associated with the named key in the specified property set, but does not return a default value from the property's PropertyDefinition if a value was not persisted for this entity. |
long |
getUniqueId()
Retrieve the unique identifier generated for this ConfigurableEntity. |
protected boolean |
hasExplicitGetter(String propertyName)
Determine if an explicit getter method exists for the given property in the implementation class of the entity. |
protected boolean |
hasExplicitSetter(String propertyName,
Object value)
Determine if an explicit setter method exists for the given property in the implementation class of the entity. |
protected void |
removeExplicitProperty(String propertyName,
Object prototypeValue)
|
Object |
removeProperty(String propertySet,
String propertyName)
Remove the property associated with the named key in the specified property set. |
protected void |
setExplicitProperty(String propertyName,
Object value)
Set a property on the entity using the explicit set |
void |
setProperty(String propertySet,
String propertyName,
Object value)
Associate the specified value with the named key in the specified property set. |
protected String |
upcaseFirst(String s)
Make the first letter of the string upper cased. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String PREFIX_SET
protected static final String PREFIX_GET
protected Class instanceClass
protected transient EntityPropertyCache propertyCache
protected static final com.bea.p13n.i18n.PropertyExceptionTextFormatter textFormatter
protected static final String CE_METHOD_CACHE
Constructor Detail |
---|
public AbstractConfigurableEntity()
Method Detail |
---|
public Object getProperty(String propertySet, String propertyName) throws RemoteException
getProperty
in interface ConfigurableEntity
propertySet
- The name of the property set to look inpropertyName
- The name of the property to retrieve.
RemoteException
public String getPropertyAsString(String propertySet, String propertyName) throws RemoteException
getPropertyAsString
in interface ConfigurableEntity
propertySet
- The name of the property set to look inpropertyName
- The name of the property to retrieve.
RemoteException
public Object getPropertyNoDefault(String propertySet, String propertyName) throws RemoteException
getPropertyNoDefault
in interface ConfigurableEntity
propertySet
- The name of the property setpropertyName
- The name of the property to retrieve.
RemoteException
public void setProperty(String propertySet, String propertyName, Object value) throws PropertyValidationException, RemoteException
setProperty
in interface ConfigurableEntity
propertySet
- The name of the property set.propertyName
- The name of the property to assignvalue
- The value to associate with the property name
PropertyValidationException
- If the property value does not match the PropertyDefinition for this property set
RemoteException
public Object removeProperty(String propertySet, String propertyName) throws RemoteException
NOTE: if an explicit setter method is found for this property, this method will set the value to null.
removeProperty
in interface ConfigurableEntity
propertySet
- The name of the property set.propertyName
- The name of the property to remove.
RemoteException
public long getUniqueId() throws RemoteException
getUniqueId
in interface ConfigurableEntity
RemoteException
public String getPkString() throws RemoteException
getPkString
in interface ConfigurableEntity
RemoteException
public String getJndiName() throws RemoteException
getJndiName
in interface ConfigurableEntity
RemoteException
protected Object getImplicitProperty(String propertySet, String propertyName) throws RemoteException
propertySet
- the property set to look inpropertyName
- the name of the property
RemoteException
public Object getCachedProperty(String propertySet, String propertyName) throws RemoteException
propertySet
- The property set to look inpropertyName
- The name of the property
RemoteException
protected boolean hasExplicitGetter(String propertyName)
propertyName
- the name of the property to look for
protected Object getExplicitProperty(String propertyName)
propertyName
- the name of the property to look for
protected Method getExplicitSetter(String propertyName, Object value)
protected boolean hasExplicitSetter(String propertyName, Object value)
propertyName
- the name of the property to look forvalue
- a value that represents the property type to look for
protected void setExplicitProperty(String propertyName, Object value)
propertyName
- the name of the property to setvalue
- the value to pass to the mutator methodprotected void removeExplicitProperty(String propertyName, Object prototypeValue)
public EntityPropertyCache getPropertyCache() throws RemoteException
RemoteException
public static PropertyMapKey createMapKey(String propertySet, String propertyName)
propertySet
- the property set name to usepropertyName
- the property name to use
protected final String upcaseFirst(String s)
s
- the string to process
|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |