Class ClassInfo

java.lang.Object
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:
  • Method Details

    • 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.
    • hashCode

      public int hashCode()
      Return hashcode that is consistent with equals implementation.

      Supported API: true
      Overrides:
      hashCode in class Object
      Returns:
      hashCode of classname.
    • getAttributeValueSet

      public Object[] getAttributeValueSet(String name) throws 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:
      WTIntrospectionException
    • getBusinessClass

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

      Supported API: true
      Returns:
      The business class described by this info instance.
      Throws:
      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 WTIntrospectionException
      Gets the instantiable class represented by this info instance.

      Supported API: true
      Returns:
      The instantiable class described by this info instance.
      Throws:
      WTIntrospectionException
    • getDescendentInfos

      public ClassInfo[] getDescendentInfos() throws 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 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
      WTIntrospectionException
    • getDisplayName

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

      Supported API: true
      Returns:
      The display name string.
      See Also:
    • 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 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:
      WTIntrospectionException
    • getOtherSideRole

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

      Supported API: true
      Returns:
      a RoleDesciptor that can be navigated
      Throws:
      WTIntrospection - Exception
      WTIntrospectionException
      See Also:
      • #getOtherSideRoles(String,LinkInfo)
    • getOtherSideRole

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

      Supported API: true
      Returns:
      a RoleDesciptor that can be navigated
      Throws:
      WTIntrospection - Exception
      WTIntrospectionException
    • getOtherSideRoles

      public RoleDescriptor[] getOtherSideRoles() throws 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 that can be navigated
      Throws:
      WTIntrospection - Exception
      WTIntrospectionException
    • getParentClassInfo

      public ClassInfo getParentClassInfo() throws 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:
      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 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:
      WTIntrospectionException
    • getPropertyDescriptor

      public PropertyDescriptor getPropertyDescriptor(String name) throws 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 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 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 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:
      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
    • getDataType

      public DataType getDataType() throws WTIntrospectionException
      Gets the DataType of the class. If an explicit assignment has not been made for a class, a default assignment algorithm is applied. The default case will inherit from parents, based on a priority algorithm that defaults toward the USER end of the spectrum. If no parents have an explicit type, the default value will be return, except for concrete classes, which will default to USER.

      Supported API: true
      Returns:
      DataType the datatype of the class, which indicates who owns the data in the table
      Throws:
      WTIntrospectionException
    • isSuperclassOf

      public boolean isSuperclassOf(ClassInfo classInfo) throws 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:
      WTIntrospectionException
      See Also:
    • getAttributeColumnDescriptors

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

      Supported API: true
      Returns:
      ColumnDescriptor[]
      Throws:
      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.