wt.clients.gui
Class ChangeIdentityTaskLogic

java.lang.Object
  extended bywt.clients.gui.ChangeIdentityTaskLogic

public class ChangeIdentityTaskLogic
extends Object

Class ChangeIdentityTaskLogic provides static methods which provide the task logic for changing the identity of an Identified object.

See Also:
Identified

Field Summary
static String NAME
          Defined constant used to specify the Name attribute of an Identified object
static String NUMBER
          Defined constant used to specify the Number attribute of an Identified object
 
Constructor Summary
ChangeIdentityTaskLogic()
           
 
Method Summary
static String getAttribute(Identified identified_obj, String attribute)
          Method getAttribute retrieves the value of the attribute specified by the given String name from the given Identified object.
protected static PropertyDescriptor getObjectPropertyDescriptor(Identified identified_obj, String attribute)
          Utility method to retrieve PropertyDescriptor of modelled attributes on Persistable objects.
protected static PropertyDescriptor getPropertyDescriptor(Identified identified_obj, String attribute)
           
protected static PropertyDescriptor getReadPropertyDescriptor(Identified identified_obj, String attribute)
           
static boolean hasAttribute(Identified identified_obj, String attribute)
          Method hasAttribute determines if the given Identified object has an attribute with the given name.
static Identified setAttribute(Identified identified_obj, String attribute, String value)
          Method setAttribute attempts to set the attribute value specified by the given name on the given object to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
Defined constant used to specify the Name attribute of an Identified object

See Also:
Constant Field Values

NUMBER

public static final String NUMBER
Defined constant used to specify the Number attribute of an Identified object

See Also:
Constant Field Values
Constructor Detail

ChangeIdentityTaskLogic

public ChangeIdentityTaskLogic()
Method Detail

hasAttribute

public static boolean hasAttribute(Identified identified_obj,
                                   String attribute)
                            throws WTIntrospectionException,
                                   WTException
Method hasAttribute determines if the given Identified object has an attribute with the given name.

Parameters:
identified_obj - the Identified object to check for the given attribute
attribute - the String name of the attribute to check for in the given object
Returns:
true if the given object has an attribute of the given name
Throws:
WTIntrospectionException - if an error occurs while ` looking for the given attribute name in the given Identified object
WTException - if an error occurs while looking for the given attribute name in the given Identified object
See Also:
Identified

setAttribute

public static Identified setAttribute(Identified identified_obj,
                                      String attribute,
                                      String value)
                               throws WTIntrospectionException,
                                      WTException
Method setAttribute attempts to set the attribute value specified by the given name on the given object to the given value. This method assumes that the attribute specified by the given name takes a String value. Introspection is used to attempt to retrieve the appropriate setter method and invoke it. The updated Identified object is returned.

Parameters:
attribute - the String name of the attribute whose value is to be set
value - the String value used to set the attribute specified by the given name on the given object
Returns:
the updated Identified object
Throws:
WTIntrospectionException - if an error occurs attempting to invoke the setter method for the given attribute on the given object
WTException - if an error occurs attempting to invoke the setter method for the given attribute on the given object
See Also:
getAttribute(wt.fc.Identified, java.lang.String)

getAttribute

public static String getAttribute(Identified identified_obj,
                                  String attribute)
                           throws WTIntrospectionException,
                                  WTException
Method getAttribute retrieves the value of the attribute specified by the given String name from the given Identified object. Introspection is used to attempt to retrieve the appropriate getter method and invoke it.

Parameters:
identified_obj - the Identified object on which to retrieve the given attribute
attribute - the String name of the attribute whose value is to be retrieved
Returns:
the String value corresponding to the given attribute
Throws:
WTIntrospectionException - if an error occurs attempting to find the appropriate getter method and invoke it
WTException - if an error occurs invoking the getter method for the given attribute name
See Also:
Identified, setAttribute(wt.fc.Identified, java.lang.String, java.lang.String)

getPropertyDescriptor

protected static PropertyDescriptor getPropertyDescriptor(Identified identified_obj,
                                                          String attribute)
                                                   throws WTIntrospectionException,
                                                          WTException
Throws:
WTIntrospectionException
WTException

getReadPropertyDescriptor

protected static PropertyDescriptor getReadPropertyDescriptor(Identified identified_obj,
                                                              String attribute)
                                                       throws WTIntrospectionException,
                                                              WTException
Throws:
WTIntrospectionException
WTException

getObjectPropertyDescriptor

protected static PropertyDescriptor getObjectPropertyDescriptor(Identified identified_obj,
                                                                String attribute)
                                                         throws WTIntrospectionException,
                                                                WTException
Utility method to retrieve PropertyDescriptor of modelled attributes on Persistable objects. Note that this method gets the PropertyDescriptor of attributes directly on the Identified object and not on the IdentificationObject.

Throws:
WTIntrospectionException
WTException