Class DataDescriptor

java.lang.Object
COM.TIBCO.hawk.talon.DataDescriptor
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CompositeDataDescriptor

public class DataDescriptor extends Object implements Serializable
Describes a data object which is used as either an argument parameter or return parameter in a MethodDescriptor

Only Serializable reference types may be described.

The data being described by this class and its subclasses is considered to be open data if it is one of the types defined by the OpenData interface.

Note: the aggregate open data types must be described with the corresponding subclasses of this class in order to be treated as open. CompositeData should be described with CompositeDataDescriptor and TabularData should be described with TabularDataDescriptor Using DataDescriptor to describe these types is legal. However, it will result in the isOpenData() method returning false.

The attributes accessed by the methods getDefault(), getLegalValueChoices(), and getValueChoices() may be of a type whose class it not guaranteed to be available on all virtual machines. To insure they can be safely transmitted between virtual machines, they are internally stored in serialized form. As a result, several of the methods of this class throw serialization related exceptions.

See Also:
  • Constructor Details

    • DataDescriptor

      public DataDescriptor(String name, Class c, String desc)
      Constructs a DataDescriptor with only the required fields.

      It may be constructed to describe any serializable reference data type.

      Parameters:
      name - The name of the data parameter being described. It must be a non-null, non-empty alphanumeric string.
      c - A class object representing the class type of the parameter being described. It must represent a reference type that is Serializable.
      desc - A description of the parameter being described
      Throws:
      IllegalArgumentException - if the parameter conditions are violated
    • DataDescriptor

      public DataDescriptor(String name, Class c, String desc, Object def, Object[] leg, Object[] val) throws IOException
      Constructs a DataDescriptor.

      It may be constructed to describe any serializable reference data type.

      Parameters:
      name - The name of the data parameter being described. It must be a non-null, non-empty alphanumeric string.
      c - A class object representing the class type of the parameter being described. It must represent a reference type that is Serializable.
      desc - A description of the parameter being described
      def - A default value that may be used for the parameter. Null indicates that a default is not specified. If non-null, def must be of a type assignable to that represented by the type argument.
      leg - An array of legal values for this parameter. It indicates the only values this parameter may have. Null or empty array indicates that the legal values are not specified. If non-null, the array elements must all be of a type assignable to that represented by the type argument.
      val - An array of possible values for this parameter. Null or empty array indicates that the possible values are not specified. If non-null, the array elements must all be of a type assignable to that represented by the type argument.
      Throws:
      IllegalArgumentException - if the parameter conditions are violated
      IOException - If a problem occurs during serialization of def, leg, val.
  • Method Details

    • getName

      public String getName()
      Returns the name of the described parameter.
      Returns:
      The name of the described parameter.
    • getType

      public String getType()
      Returns The fully-qualified class name of the described parameter.
      Returns:
      The fully-qualified class name of the described parameter.
    • getDescription

      public String getDescription()
      Returns a description of the parameter.
      Returns:
      A description of the parameter.
    • getDefault

      public Object getDefault() throws ClassNotFoundException, IOException
      Returns a default value for this parameter.

      When this class is used to describe a method argument parameter, this value represents a valid default value.

      This value has not been assigned any semantics when this class is used to describe a method return parameter.

      A return of null indicates that no default has been specified.

      The exceptions thrown by this method relate to the fact that this value is internally stored in a serialized form. They normally should not occur when dealing with open-data types.

      Returns:
      A default value for this parameter.
      Throws:
      ClassNotFoundException - If the class represented by getType() can not be found. This will occur when attempting to access this field for a non-open data type without access to the corresponding class
      IOException - if problem is encountered while deserializing.
    • getLegalValueChoices

      public Object[] getLegalValueChoices() throws ClassNotFoundException, IOException
      Lists the legal values for the described parameter.

      When this class is used to describe a method argument parameter, this value represents the list of legal values.

      This value has not been assigned any semantics when this class is used to describe a method return parameter.

      A return of null indicates that the legal values have not been specified.

      The exceptions thrown by this method relate to the fact that this value is internally stored in a serialized form. They normally should not occur when dealing with open-data types.

      Returns:
      Legal values for this parameter
      Throws:
      ClassNotFoundException - If the class represented by getType() can not be found. This will occur when attempting to access this field for a non-open data type without access to the corresponding class
      IOException - If problem is encountered while deserializing
    • getValueChoices

      public Object[] getValueChoices() throws ClassNotFoundException, IOException
      Lists possible values for the described parameter. Note, this does not imply that these are the only values this parameter may take on.

      When this class is used to describe a method argument parameter, this value represents a list of possible values.

      This value has not been assigned any semantics when this class is used to describe a method return parameter.

      A return of null indicates that the possible values have not been specified.

      The exceptions thrown by this method relate to the fact that this value is internally stored in a serialized form. They normally should not occur when dealing with open-data types.

      Returns:
      Possible values for this parameter.
      Throws:
      ClassNotFoundException - If the class represented by getType() can not be found. This will occur when attempting to access this field for a non-open data type without access to the corresponding class
      IOException - If problem is encountered while deserializing
    • isOpenData

      public boolean isOpenData()
      Returns true if the data object being described is typed (see getType()) to be one of the non-aggregate open data types defined in the OpenData interface.

      In order for the aggregate open data types CompositeData and TabularData to be treated as open data, they must be described by their corresponding descriptor classes CompositeDataDescriptor and TabularDataDescriptor

      See Also:
    • toString

      public String toString()
      Returns a string representation of this descriptor.
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object