wt.adapter.attribute
Class BasicAttributeDelegate

java.lang.Object
  extended bywt.adapter.attribute.BasicAttributeDelegate
All Implemented Interfaces:
AttributeDelegate, Externalizable, Serializable
Direct Known Subclasses:
BooleanAttributeDelegate, CabinetReferenceAttributeDelegate, CheckoutInfoAttributeDelegate, ClassAttributeDelegate, DefaultAttributeDelegate, DoubleAttributeDelegate, EnumeratedTypeAttributeDelegate, FloatAttributeDelegate, FolderAttributeDelegate, IntegerAttributeDelegate, IterationInfoAttributeDelegate, LifecycleAttributeDelegate, LocalizedMessageAttributeDelegate, LongAttributeDelegate, ObjectReferenceAttributeDelegate, PrincipalAttributeDelegate, QuantityAttributeDelegate, ShortAttributeDelegate, SqlDateAttributeDelegate, StringAttributeDelegate, TeamTemplateAttributeDelegate, TimestampAttributeDelegate, UtilDateAttributeDelegate, VersionInfoAttributeDelegate, ViewAttributeDelegate

public abstract class BasicAttributeDelegate
extends Object
implements AttributeDelegate, Externalizable

Holds convenience methods commonly used by concrete AttributeDelegate classes. Provides a default implementation of the getObjectAttributeValueString() method using the wt.enterprise.ObjectPropertyValue class.

Supported API: false

Extendable: false

See Also:
ObjectPropertyValue, Serialized Form

Field Summary
protected static ObjectPropertyValue adapterProcessor
           
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
 
Constructor Summary
BasicAttributeDelegate()
           
 
Method Summary
static Object getAttributeValue(Object obj, String attributeName)
           
 String getObjectAttributeValueString(Object object, String attribute_name, Locale locale, Properties properties)
          Provide a default implementation to return the String value for the specified attribute on the object.
protected  PropertyDescriptor getPropertyDescriptor(Object object, String attribute_name)
          Return a PropertyDescriptor for the specified attribute for a class.
private static Method getReadMethod(Class c, String attributeName)
           
protected  Object invokeGetterMethod(Object object, PropertyDescriptor pd)
          Use the PropertyDescriptor to invoke the appropriate getter method on the object.
protected  void invokeSetterMethod(Object object, PropertyDescriptor pd, Object value)
          Use the PropertyDescriptor to invoke the appropriate setter method on the object.
 boolean isValueFormatted(Properties properties)
          Returns true if the FORMAT property is set to "true" or is omitted, otherwise returns false.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(BasicAttributeDelegate thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setObjectAttributeValueString(Object object, String attribute_name, String value, Locale locale, Properties properties)
          This is a empty stub implementation.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

adapterProcessor

protected static ObjectPropertyValue adapterProcessor
Constructor Detail

BasicAttributeDelegate

public BasicAttributeDelegate()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(BasicAttributeDelegate thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getPropertyDescriptor

protected PropertyDescriptor getPropertyDescriptor(Object object,
                                                   String attribute_name)
                                            throws WTException
Return a PropertyDescriptor for the specified attribute for a class.

Supported API: false

Parameters:
object -
attribute_name -
Returns:
PropertyDescriptor
Throws:
WTException

invokeGetterMethod

protected Object invokeGetterMethod(Object object,
                                    PropertyDescriptor pd)
                             throws WTException
Use the PropertyDescriptor to invoke the appropriate getter method on the object.

Supported API: false

Parameters:
object -
pd -
Returns:
Object
Throws:
WTException

invokeSetterMethod

protected void invokeSetterMethod(Object object,
                                  PropertyDescriptor pd,
                                  Object value)
                           throws WTException
Use the PropertyDescriptor to invoke the appropriate setter method on the object.

Supported API: false

Parameters:
object -
pd -
value -
Throws:
WTException

getObjectAttributeValueString

public String getObjectAttributeValueString(Object object,
                                            String attribute_name,
                                            Locale locale,
                                            Properties properties)
                                     throws WTException
Provide a default implementation to return the String value for the specified attribute on the object.

Supported API: false

Specified by:
getObjectAttributeValueString in interface AttributeDelegate
Parameters:
object -
attribute_name -
locale -
properties -
Returns:
String
Throws:
WTException

setObjectAttributeValueString

public void setObjectAttributeValueString(Object object,
                                          String attribute_name,
                                          String value,
                                          Locale locale,
                                          Properties properties)
                                   throws WTException
This is a empty stub implementation. The method does not actually set the value of the attribute on the object

Supported API: false

Specified by:
setObjectAttributeValueString in interface AttributeDelegate
Parameters:
object -
attribute_name -
value -
locale -
properties -
Throws:
WTException

isValueFormatted

public boolean isValueFormatted(Properties properties)
Returns true if the FORMAT property is set to "true" or is omitted, otherwise returns false.

Supported API: false

Parameters:
properties -
Returns:
boolean

getAttributeValue

public static Object getAttributeValue(Object obj,
                                       String attributeName)

getReadMethod

private static Method getReadMethod(Class c,
                                    String attributeName)
                             throws Exception
Throws:
Exception