public class DataDescriptor
extends java.lang.Object
implements java.io.Serializable
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.
Constructor and Description |
---|
DataDescriptor(java.lang.String name,
java.lang.Class c,
java.lang.String desc)
Constructs a DataDescriptor with only the required fields.
|
DataDescriptor(java.lang.String name,
java.lang.Class c,
java.lang.String desc,
java.lang.Object def,
java.lang.Object[] leg,
java.lang.Object[] val)
Constructs a DataDescriptor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.Object |
getDefault()
Returns a default value for this parameter.
|
java.lang.String |
getDescription()
Returns a description of the parameter.
|
java.lang.Object[] |
getLegalValueChoices()
Lists the legal values for the described parameter.
|
java.lang.String |
getName()
Returns the name of the described parameter.
|
java.lang.String |
getType()
Returns The fully-qualified class name of the described parameter.
|
java.lang.Object[] |
getValueChoices()
Lists possible values for the described parameter.
|
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. |
java.lang.String |
toString()
Returns a string representation of this descriptor.
|
public DataDescriptor(java.lang.String name, java.lang.Class c, java.lang.String desc)
It may be constructed to describe any serializable reference data type.
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 describedjava.lang.IllegalArgumentException
- if the parameter conditions are violatedpublic DataDescriptor(java.lang.String name, java.lang.Class c, java.lang.String desc, java.lang.Object def, java.lang.Object[] leg, java.lang.Object[] val) throws java.io.IOException
It may be constructed to describe any serializable reference data type.
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 describeddef
- 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.java.lang.IllegalArgumentException
- if the parameter conditions are violatedjava.io.IOException
- If a problem occurs during serialization of def, leg, val
.public java.lang.String getName()
public java.lang.String getType()
public java.lang.String getDescription()
public java.lang.Object getDefault() throws java.lang.ClassNotFoundException, java.io.IOException
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.
java.lang.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 classjava.io.IOException
- if problem is encountered while deserializing.public java.lang.Object[] getLegalValueChoices() throws java.lang.ClassNotFoundException, java.io.IOException
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.
java.lang.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 classjava.io.IOException
- If problem is encountered while deserializingpublic java.lang.Object[] getValueChoices() throws java.lang.ClassNotFoundException, java.io.IOException
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.
java.lang.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 classjava.io.IOException
- If problem is encountered while deserializingpublic boolean isOpenData()
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
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2000-2019 TIBCO Inc. All Rights Reserved.