wt.introspection
Class ClassInfo

java.lang.Object
  extended by wt.introspection.ClassInfo
All Implemented Interfaces:
Externalizable, Serializable
Direct Known Subclasses:
LinkInfo

public class ClassInfo
extends Object
implements Externalizable

ClassInfo is the class for providing class meta-data There will be an instance of this class for each modeled business class that is installed.

Supported API: true

Extendable: false

See Also:
WTIntrospector, LinkInfo, Serialized Form

Method Summary
 boolean equals(Object obj)
          Compares two objects for equality.
 wt.introspection.ColumnDescriptor[] getAttributeColumnDescriptors(String name)
          Return all the ColumnDescriptor's (if any) associated with the named attribute.
 Object[] getAttributeValueSet(String name)
          Gets the set of valid values for the named attribute.
 Class getBusinessClass()
          Gets the business class represented by this info instance.
 String getClassname()
          Gets the class name of the business class represented by this info instance.
 Class getConcreteClass()
          Gets the instantiable class represented by this info instance.
 DatastoreElementType getDatastoreElementType()
          Gets the DatastoreElementType of the class.
 ClassInfo[] getDescendentInfos()
          Gets an array of ClassInfos of all the descendent classes.
 ClassInfo[] getDirectDescendentInfos()
          Gets the direct descendent class infos.
 String getDisplayName()
          Gets the display name for the class.
 String getDisplayName(Locale locale)
          Gets the display name for the class, for the specified locale.
 String getOpenIcon()
          Gets the fully qualified class name of the resource bundle for the open icon.
 RoleDescriptor getOtherSideRole(String name)
          Gets a named RoleDescriptor, which is opposite of this class.
 RoleDescriptor getOtherSideRole(String name, LinkInfo info)
          Gets a named RoleDescriptor, for a particular association, which is opposite of this class.
 RoleDescriptor[] getOtherSideRoles()
          Gets an array of RoleDescriptors, which are opposite instances of this class, in all of the associations, within which this class can participate.
 ClassInfo getParentClassInfo()
          Gets the parent class info of the business class represented by this info instance.
 String getParentClassname()
          Gets the name of the parent class of the business class represented by this info instance.
 ClassInfo[] getParentInterfaceInfos()
          Gets the parent interface infos for the business class represented by this info instance.
 PropertyDescriptor getPropertyDescriptor(String name)
          Gets a property descriptor for the named attribute of the class.
 PropertyDescriptor[] getPropertyDescriptors()
          Gets the array of property descriptors for the class.
static String getPropertyDisplayName(PropertyDescriptor property, Locale locale)
          Gets the display name for the named property of the class, for the specified locale.
static String getPropertyShortDescription(PropertyDescriptor property, Locale locale)
          Gets the display name for the property of the class, for the specified locale.
 PropertyDescriptor getReadPropertyDescriptor(String name)
          Gets a read-only property descriptor for the named attribute of the class.
 String getStandardIcon()
          Gets the fully qualified class name of the resource bundle for the standard icon.
 Object getValue(String attribute_name)
          Retrieve a named attribute with this feature.
 boolean isConcrete()
          Gets the concrete status of this class.
 boolean isPersistable()
          Gets the persistable status of this class.
 boolean isSuperclassOf(ClassInfo classInfo)
          Answer whether class parents the supplied classInfo.
 LocalizableMessage toDisplayNameMessage()
          Gets an object, which can be used to get a localized message for this class, having the request deferred to time or location where the locale may not be the same as the current locale.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

equals

public boolean equals(Object obj)
Compares two objects for equality. Returns a boolean that indicates whether this object is equivalent to the specified object. This method is used when an object is stored in a hashtable.

Supported API: true

Overrides:
equals in class Object
Parameters:
obj - the Object to compare with
Returns:
true if these Objects are equal; false otherwise.

getAttributeValueSet

public Object[] getAttributeValueSet(String name)
                              throws wt.introspection.WTIntrospectionException
Gets the set of valid values for the named attribute.

Supported API: true

Parameters:
String - the name of the attribute
Returns:
the set of valid values for the attribute
Throws:
wt.introspection.WTIntrospectionException

getBusinessClass

public Class getBusinessClass()
                       throws wt.introspection.WTIntrospectionException
Gets the business class represented by this info instance.

Supported API: true

Returns:
The business class described by this info instance.
Throws:
wt.introspection.WTIntrospectionException

getClassname

public String getClassname()
Gets the class name of the business class represented by this info instance.

Supported API: true

Returns:
The fully qualified name of the business class described by this info instance.

getConcreteClass

public Class getConcreteClass()
                       throws wt.introspection.WTIntrospectionException
Gets the instantiable class represented by this info instance.

Supported API: true

Returns:
The instantiable class described by this info instance.
Throws:
wt.introspection.WTIntrospectionException

getDescendentInfos

public ClassInfo[] getDescendentInfos()
                               throws wt.introspection.WTIntrospectionException
Gets an array of ClassInfos of all the descendent classes.

Supported API: true

Returns:
Array of ClassInfos of all the descendent classes
Throws:
WTIntrospectionException

getDirectDescendentInfos

public ClassInfo[] getDirectDescendentInfos()
                                     throws wt.introspection.WTIntrospectionException
Gets the direct descendent class infos.

Supported API: true

Returns:
Array of Class objects of the direct descendent class infos
Throws:
WTException - to be determined
wt.introspection.WTIntrospectionException

getDisplayName

public String getDisplayName()
Gets the display name for the class.

Supported API: true

Returns:
The display name string.
See Also:
getDisplayName(Locale)

getDisplayName

public String getDisplayName(Locale locale)
Gets the display name for the class, for the specified locale.

Supported API: true

Returns:
The display name string.

getOpenIcon

public String getOpenIcon()
                   throws wt.introspection.WTIntrospectionException
Gets the fully qualified class name of the resource bundle for the open icon.

Supported API: true

Returns:
String the fully qualified class name of the resource bundle for the icon
Throws:
wt.introspection.WTIntrospectionException

getOtherSideRole

public RoleDescriptor getOtherSideRole(String name)
                                throws wt.introspection.WTIntrospectionException
Gets a named RoleDescriptor, which is opposite of this class.

Supported API: true

Returns:
array of RoleDesciptor which can be navigated
Throws:
WTIntrospection - Exception
wt.introspection.WTIntrospectionException
See Also:
#getOtherSideRoles(String,LinkInfo)

getOtherSideRole

public RoleDescriptor getOtherSideRole(String name,
                                       LinkInfo info)
                                throws wt.introspection.WTIntrospectionException
Gets a named RoleDescriptor, for a particular association, which is opposite of this class.

Supported API: true

Returns:
array of RoleDesciptor which can be navigated
Throws:
WTIntrospection - Exception
wt.introspection.WTIntrospectionException

getOtherSideRoles

public RoleDescriptor[] getOtherSideRoles()
                                   throws wt.introspection.WTIntrospectionException
Gets an array of RoleDescriptors, which are opposite instances of this class, in all of the associations, within which this class can participate.

Supported API: true

Returns:
array of RoleDesciptors which can be navigated
Throws:
WTIntrospection - Exception
wt.introspection.WTIntrospectionException

getParentClassInfo

public ClassInfo getParentClassInfo()
                             throws wt.introspection.WTIntrospectionException
Gets the parent class info of the business class represented by this info instance.

Supported API: true

Returns:
The parent class info of the business class described by this info instance.
Throws:
wt.introspection.WTIntrospectionException

getParentClassname

public String getParentClassname()
Gets the name of the parent class of the business class represented by this info instance.

Supported API: true

Returns:
The name of the parent class of the business class described by this info instance.

getParentInterfaceInfos

public ClassInfo[] getParentInterfaceInfos()
                                    throws wt.introspection.WTIntrospectionException
Gets the parent interface infos for the business class represented by this info instance. (Will only include interfaces that were modeled.)

Supported API: true

Returns:
The parent interface infos of the business class described by this info instance.
Throws:
wt.introspection.WTIntrospectionException

getPropertyDescriptor

public PropertyDescriptor getPropertyDescriptor(String name)
                                         throws wt.introspection.WTIntrospectionException
Gets a property descriptor for the named attribute of the class.

Supported API: true

Returns:
PropertyDescriptor for the named attribute
Throws:
WTIntrospectionException - if fails to load class or fails to locate named property

getPropertyDescriptors

public PropertyDescriptor[] getPropertyDescriptors()
                                            throws wt.introspection.WTIntrospectionException
Gets the array of property descriptors for the class.

Supported API: true

Returns:
PropertyDescriptor[] for the class.
Throws:
WTIntrospectionException - if fails to load class or bean info for class

getPropertyDisplayName

public static String getPropertyDisplayName(PropertyDescriptor property,
                                            Locale locale)
Gets the display name for the named property of the class, for the specified locale.

Supported API: true

Returns:
The property's display name string.

getPropertyShortDescription

public static String getPropertyShortDescription(PropertyDescriptor property,
                                                 Locale locale)
Gets the display name for the property of the class, for the specified locale.

Supported API: true

Returns:
The property's display name string.

getReadPropertyDescriptor

public PropertyDescriptor getReadPropertyDescriptor(String name)
                                             throws wt.introspection.WTIntrospectionException
Gets a read-only property descriptor for the named attribute of the class. This method exists as an alternative to getPropertyDescriptor, to avoid the SecurityException that is thrown when reflecting on methods that are not public. That is, when a property has a protected write method (setter).

Supported API: true

Returns:
PropertyDescriptor for the named attribute, which is read-only
Throws:
WTIntrospectionException - if fails to load class or fails to locate named property

getStandardIcon

public String getStandardIcon()
                       throws wt.introspection.WTIntrospectionException
Gets the fully qualified class name of the resource bundle for the standard icon.

Supported API: true

Returns:
String the fully qualified class name of the resource bundle for the icon
Throws:
wt.introspection.WTIntrospectionException

isConcrete

public boolean isConcrete()
Gets the concrete status of this class. NOTE: This does not return concrete status in the strict Java class sense.

Supported API: true

Returns:
true, if this class is concrete AND the class is not a ForeignKeyLink with an abstract role class.

isPersistable

public boolean isPersistable()
Gets the persistable status of this class.

Supported API: true

Returns:
true, if this class is persistable

getDatastoreElementType

public DatastoreElementType getDatastoreElementType()
Gets the DatastoreElementType of the class.

Supported API: true

Returns:
DatastoreElementType the datastore element type of the class

isSuperclassOf

public boolean isSuperclassOf(ClassInfo classInfo)
                       throws wt.introspection.WTIntrospectionException
Answer whether class parents the supplied classInfo. Result is based on the info descendency information to avoid needing class files.

Supported API: true

Returns:
true, if this class is a super class of classInfo
Throws:
wt.introspection.WTIntrospectionException
See Also:
Class, getBusinessClass()

getAttributeColumnDescriptors

public wt.introspection.ColumnDescriptor[] getAttributeColumnDescriptors(String name)
                                                                  throws wt.introspection.WTIntrospectionException
Return all the ColumnDescriptor's (if any) associated with the named attribute.

Supported API: true

Returns:
ColumnDescriptor[]
Throws:
wt.introspection.WTIntrospectionException
See Also:
ColumnDescriptor

toDisplayNameMessage

public LocalizableMessage toDisplayNameMessage()
Gets an object, which can be used to get a localized message for this class, having the request deferred to time or location where the locale may not be the same as the current locale.

Supported API: true

Returns:
A LocalizableMessage instance, for this class.

toString

public String toString()
Returns a string representation of the object.

Supported API: true

Overrides:
toString in class Object
Returns:
a string representation of the object.

getValue

public Object getValue(String attribute_name)
Retrieve a named attribute with this feature.

Supported API: true

Parameters:
attribute_name - - The locale-independent name of the attribute
Returns:
object Return an arbitrary value assigned as an extended property of the class. May be null if the attribute is unknown.