wt.adapter.attribute
Class AttributeHelper

java.lang.Object
  extended bywt.adapter.attribute.AttributeHelper
All Implemented Interfaces:
Externalizable, Serializable

public class AttributeHelper
extends Object
implements Externalizable

The AttributeHelper class is a facade class designed to allow classes in other packages easy access to the functionality in the wt.adapter.attribute package. It uses the AttributeDelegates to read and write attributes on modeld Windchill classes.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static ObjectPropertyValue propertyValueHelper
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
 
Constructor Summary
AttributeHelper()
           
 
Method Summary
 Object assignValues(Object object, Hashtable values, Locale locale)
          Assigns the values contained in the Hashtable to the object.
 Object assignValues(Object object, Hashtable values, Locale locale, Properties props)
          Assigns the values contained in the Hashtable to the object.
 Object createObject(String className)
          Creates an instance of the specified class, using the Windchill -style factory method.
 Object createObject(String className, Hashtable values, Locale locale)
          Creates an instance of the specified class, using the Hashtable of values to initialize its attributes.
 Object createObject(String className, Hashtable values, Locale locale, Properties props)
          Creates an instance of the specified class, using the Hashtable of values to initialize its attributes.
 String[] getAllAttributeNames(String className)
          Return the names of all the attributes available for the specified class.
 String getDefinedAs(PropertyDescriptor propertyDescriptor)
           
 String[] getLocalizedNames(String className, String[] attributeNames, Locale locale)
           
 String getLowerLimit(PropertyDescriptor propertyDescriptor)
          Return the string representation for lower limit specified for the attribute.
 String getObjectPropertyValueString(Object object, String attributeName, Locale locale)
          Return a string representation of the value of the attribute for the specified object.
 String getObjectPropertyValueString(Object object, String attributeName, Locale locale, Properties props)
          Return a string representation of the value of the attribute for the specified object.
 PropertyDescriptor getPropertyDescriptor(String className, String attributeName)
           
protected  ObjectPropertyValue getPropertyValueHelper()
           
protected  String getSimpleName(String fullClassName)
           
 String getUpperLimit(PropertyDescriptor propertyDescriptor)
          Return the string representation for upper limit specified for the attribute.
 boolean isRequired(PropertyDescriptor propertyDescriptor)
           
 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(AttributeHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 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

propertyValueHelper

private static ObjectPropertyValue propertyValueHelper
Constructor Detail

AttributeHelper

public AttributeHelper()
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(AttributeHelper 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

assignValues

public Object assignValues(Object object,
                           Hashtable values,
                           Locale locale)
                    throws WTException
Assigns the values contained in the Hashtable to the object. Assumes the keys in the Hashtable are attribute names, and the values are String values valid for use which the appropriate AttributeDelegate class for the datatype of the attribute.

Supported API: false

Parameters:
object -
values -
locale -
Returns:
Object
Throws:
WTException

assignValues

public Object assignValues(Object object,
                           Hashtable values,
                           Locale locale,
                           Properties props)
                    throws WTException
Assigns the values contained in the Hashtable to the object. Assumes the keys in the Hashtable are attribute names, and the values are String values valid for use which the appropriate AttributeDelegate class for the datatype of the attribute.

Supported API: false

Parameters:
object -
values -
locale -
props -
Returns:
Object
Throws:
WTException

createObject

public Object createObject(String className,
                           Hashtable values,
                           Locale locale)
                    throws WTException
Creates an instance of the specified class, using the Hashtable of values to initialize its attributes.

Supported API: false

Parameters:
className -
values -
locale -
Returns:
Object
Throws:
WTException

createObject

public Object createObject(String className,
                           Hashtable values,
                           Locale locale,
                           Properties props)
                    throws WTException
Creates an instance of the specified class, using the Hashtable of values to initialize its attributes.

Supported API: false

Parameters:
className -
values -
locale -
props -
Returns:
Object
Throws:
WTException

createObject

public Object createObject(String className)
                    throws WTException
Creates an instance of the specified class, using the Windchill -style factory method.

Supported API: false

Parameters:
className -
Returns:
Object
Throws:
WTException

getAllAttributeNames

public String[] getAllAttributeNames(String className)
                              throws WTException
Return the names of all the attributes available for the specified class.

Supported API: false

Parameters:
className -
Returns:
String[]
Throws:
WTException

getObjectPropertyValueString

public String getObjectPropertyValueString(Object object,
                                           String attributeName,
                                           Locale locale)
                                    throws WTException,
                                           WTIntrospectionException
Return a string representation of the value of the attribute for the specified object.

Supported API: false

Parameters:
object -
attributeName -
locale -
Returns:
String
Throws:
WTException
WTIntrospectionException

getObjectPropertyValueString

public String getObjectPropertyValueString(Object object,
                                           String attributeName,
                                           Locale locale,
                                           Properties props)
                                    throws WTException,
                                           WTIntrospectionException
Return a string representation of the value of the attribute for the specified object.

Supported API: false

Parameters:
object -
attributeName -
locale -
props -
Returns:
String
Throws:
WTException
WTIntrospectionException

getSimpleName

protected String getSimpleName(String fullClassName)

getPropertyValueHelper

protected ObjectPropertyValue getPropertyValueHelper()

getLocalizedNames

public String[] getLocalizedNames(String className,
                                  String[] attributeNames,
                                  Locale locale)
                           throws WTException
Throws:
WTException

getDefinedAs

public String getDefinedAs(PropertyDescriptor propertyDescriptor)

isRequired

public boolean isRequired(PropertyDescriptor propertyDescriptor)

getUpperLimit

public String getUpperLimit(PropertyDescriptor propertyDescriptor)
Return the string representation for upper limit specified for the attribute. If nothing is specified, return "0".

Supported API: false

Parameters:
propertyDescriptor - PropertyDescriptor for the attribute
Returns:
String
See Also:
WTIntrospector.UPPER_LIMIT

getLowerLimit

public String getLowerLimit(PropertyDescriptor propertyDescriptor)
Return the string representation for lower limit specified for the attribute. If nothing is specified, return "0".

Supported API: false

Parameters:
propertyDescriptor - PropertyDescriptor for the attribute
Returns:
String
See Also:
WTIntrospector.LOWER_LIMIT

getPropertyDescriptor

public PropertyDescriptor getPropertyDescriptor(String className,
                                                String attributeName)
                                         throws WTException
Throws:
WTException