APIdia Launch Partner
Top Description Fields Constructors Methods
java.beans

public Class FeatureDescriptor

extends Object
Class Inheritance
Known Direct Subclasses
java.beans.MethodDescriptor, java.beans.ParameterDescriptor, java.beans.PropertyDescriptor, java.beans.BeanDescriptor, java.beans.EventSetDescriptor
Imports
com.sun.beans.TypeResolver, java.lang.ref.Reference, .WeakReference, .SoftReference, java.lang.reflect.Method, java.util.Enumeration, .Hashtable, .Map.Entry

The FeatureDescriptor class is the common baseclass for PropertyDescriptor, EventSetDescriptor, and MethodDescriptor, etc.

It supports some common information that can be set and retrieved for any of the introspection descriptors.

In addition it provides an extension mechanism so that arbitrary attribute/value pairs can be associated with a design feature.

Since
1.1

Field Summary

Modifier and TypeField and Description
private Reference<? extends Class<?>>
private String
private boolean
private boolean
private String
private boolean
private String
private Hashtable<String, Object>
private static final String

Constructor Summary

AccessConstructor and Description
public
FeatureDescriptor()

Constructs a FeatureDescriptor.

pack-priv
FeatureDescriptor(FeatureDescriptor
The first (lower priority) MethodDescriptor
x
,
FeatureDescriptor
The second (higher priority) MethodDescriptor
y
)

Package-private constructor, Merge information from two FeatureDescriptors.

pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
addTable(Hashtable<String, Object>
the attribute table with new values
table
)

Copies all values from the specified attribute table.

pack-priv void
pack-priv static void
appendTo(StringBuilder sb, String name, Reference<?> reference)

pack-priv static void
pack-priv static void
appendTo(StringBuilder sb, String name, boolean value)

public Enumeration<String>

Returns:

An enumeration of the locale-independent names of any attributes that have been registered with setValue.
attributeNames
()

Gets an enumeration of the locale-independent names of this feature.

pack-priv Class<?>
public String

Returns:

The localized display name for the property/method/event. This defaults to the same as its programmatic name from getName.
getDisplayName
()

Gets the localized display name of this feature.

public String

Returns:

The programmatic name of the property/method/event
getName
()

Gets the programmatic name of this feature.

pack-priv static Class<?>[]

Returns:

an array of classes identifying the parameter types of the method
getParameterTypes
(Class<?>
the class that contains the method in the hierarchy
base
,
Method
the object that represents the method
method
)

Resolves the parameter types of the method.

pack-priv static Class<?>

Returns:

a class identifying the return type of the method
getReturnType
(Class<?>
the class that contains the method in the hierarchy
base
,
Method
the object that represents the method
method
)

Resolves the return type of the method.

public String

Returns:

A localized short description associated with this property/method/event. This defaults to be the display name.
getShortDescription
()

Gets the short description of this feature.

pack-priv static <T> Reference<T>

Returns:

a new soft reference or null if object is null
getSoftReference
(T object)

Creates a new soft reference that refers to the given object.

private Hashtable<String, Object>

Returns:

the initialized attribute table
getTable
()

Returns the initialized attribute table.

public Object

Returns:

The value of the attribute. May be null if the attribute is unknown.
getValue
(String
The locale-independent name of the attribute
attributeName
)

Retrieve a named attribute with this feature.

pack-priv static <T> Reference<T>

Returns:

a new weak reference or null if object is null
getWeakReference
(T object)

Creates a new weak reference that refers to the given object.

public boolean

Returns:

True if this feature is intended for use by experts only.
isExpert
()

The "expert" flag is used to distinguish between those features that are intended for expert users from those that are intended for normal users.

public boolean

Returns:

True if this feature should be hidden from human users.
isHidden
()

The "hidden" flag is used to identify features that are intended only for tool use, and which should not be exposed to humans.

public boolean

Returns:

True if this feature should be preferentially shown to human users.
isPreferred
()

The "preferred" flag is used to identify features that are particularly important for presenting to humans.

pack-priv boolean

Returns:

true if the feature is transient, false otherwise
isTransient
()

Indicates whether the feature is transient.

pack-priv void
setClass0(Class<?> cls)

public void
setDisplayName(String
The localized display name for the property/method/event.
displayName
)

Sets the localized display name of this feature.

public void
setExpert(boolean
True if this feature is intended for use by experts only.
expert
)

The "expert" flag is used to distinguish between features that are intended for expert users from those that are intended for normal users.

public void
setHidden(boolean
True if this feature should be hidden from human users.
hidden
)

The "hidden" flag is used to identify features that are intended only for tool use, and which should not be exposed to humans.

public void
setName(String
The programmatic name of the property/method/event
name
)

Sets the programmatic name of this feature.

public void
setPreferred(boolean
True if this feature should be preferentially shown to human users.
preferred
)

The "preferred" flag is used to identify features that are particularly important for presenting to humans.

public void
setShortDescription(String
A (localized) short description to be associated with this property/method/event.
text
)

You can associate a short descriptive string with a feature.

pack-priv void
setTransient(Transient
the annotation of the element of the feature
annotation
)

Sets the "transient" attribute according to the annotation.

public void
setValue(String
The locale-independent name of the attribute
attributeName
,
Object
The value.
value
)

Associate a named attribute with this feature.

public String

Returns:

a string representation of the object
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

classRefback to summary
private Reference<? extends Class<?>> classRef
displayNameback to summary
private String displayName
expertback to summary
private boolean expert
hiddenback to summary
private boolean hidden
nameback to summary
private String name
preferredback to summary
private boolean preferred
shortDescriptionback to summary
private String shortDescription
tableback to summary
private Hashtable<String, Object> table
TRANSIENTback to summary
private static final String TRANSIENT

Constructor Detail

FeatureDescriptorback to summary
public FeatureDescriptor()

Constructs a FeatureDescriptor.

FeatureDescriptorback to summary
pack-priv FeatureDescriptor(FeatureDescriptor x, FeatureDescriptor y)

Package-private constructor, Merge information from two FeatureDescriptors. The merged hidden and expert flags are formed by or-ing the values. In the event of other conflicts, the second argument (y) is given priority over the first argument (x).

Parameters
x:FeatureDescriptor

The first (lower priority) MethodDescriptor

y:FeatureDescriptor

The second (higher priority) MethodDescriptor

FeatureDescriptorback to summary
pack-priv FeatureDescriptor(FeatureDescriptor old)

Method Detail

addTableback to summary
private void addTable(Hashtable<String, Object> table)

Copies all values from the specified attribute table. If some attribute is exist its value should be overridden.

Parameters
table:Hashtable<String, Object>

the attribute table with new values

appendToback to summary
pack-priv void appendTo(StringBuilder sb)
appendToback to summary
pack-priv static void appendTo(StringBuilder sb, String name, Reference<?> reference)
appendToback to summary
pack-priv static void appendTo(StringBuilder sb, String name, Object value)
appendToback to summary
pack-priv static void appendTo(StringBuilder sb, String name, boolean value)
attributeNamesback to summary
public Enumeration<String> attributeNames()

Gets an enumeration of the locale-independent names of this feature.

Returns:Enumeration<String>

An enumeration of the locale-independent names of any attributes that have been registered with setValue.

getClass0back to summary
pack-priv Class<?> getClass0()
getDisplayNameback to summary
public String getDisplayName()

Gets the localized display name of this feature.

Returns:String

The localized display name for the property/method/event. This defaults to the same as its programmatic name from getName.

getNameback to summary
public String getName()

Gets the programmatic name of this feature.

Returns:String

The programmatic name of the property/method/event

getParameterTypesback to summary
pack-priv static Class<?>[] getParameterTypes(Class<?> base, Method method)

Resolves the parameter types of the method.

Parameters
base:Class<?>

the class that contains the method in the hierarchy

method:Method

the object that represents the method

Returns:Class<?>[]

an array of classes identifying the parameter types of the method

See Also
Method#getGenericParameterTypes, Method#getParameterTypes
getReturnTypeback to summary
pack-priv static Class<?> getReturnType(Class<?> base, Method method)

Resolves the return type of the method.

Parameters
base:Class<?>

the class that contains the method in the hierarchy

method:Method

the object that represents the method

Returns:Class<?>

a class identifying the return type of the method

See Also
Method#getGenericReturnType, Method#getReturnType
getShortDescriptionback to summary
public String getShortDescription()

Gets the short description of this feature.

Returns:String

A localized short description associated with this property/method/event. This defaults to be the display name.

getSoftReferenceback to summary
pack-priv static <T> Reference<T> getSoftReference(T object)

Creates a new soft reference that refers to the given object.

Returns:Reference<T>

a new soft reference or null if object is null

See Also
SoftReference
getTableback to summary
private Hashtable<String, Object> getTable()

Returns the initialized attribute table.

Returns:Hashtable<String, Object>

the initialized attribute table

getValueback to summary
public Object getValue(String attributeName)

Retrieve a named attribute with this feature.

Parameters
attributeName:String

The locale-independent name of the attribute

Returns:Object

The value of the attribute. May be null if the attribute is unknown.

getWeakReferenceback to summary
pack-priv static <T> Reference<T> getWeakReference(T object)

Creates a new weak reference that refers to the given object.

Returns:Reference<T>

a new weak reference or null if object is null

See Also
WeakReference
isExpertback to summary
public boolean isExpert()

The "expert" flag is used to distinguish between those features that are intended for expert users from those that are intended for normal users.

Returns:boolean

True if this feature is intended for use by experts only.

isHiddenback to summary
public boolean isHidden()

The "hidden" flag is used to identify features that are intended only for tool use, and which should not be exposed to humans.

Returns:boolean

True if this feature should be hidden from human users.

isPreferredback to summary
public boolean isPreferred()

The "preferred" flag is used to identify features that are particularly important for presenting to humans.

Returns:boolean

True if this feature should be preferentially shown to human users.

Since
1.2
isTransientback to summary
pack-priv boolean isTransient()

Indicates whether the feature is transient.

Returns:boolean

true if the feature is transient, false otherwise

setClass0back to summary
pack-priv void setClass0(Class<?> cls)
setDisplayNameback to summary
public void setDisplayName(String displayName)

Sets the localized display name of this feature.

Parameters
displayName:String

The localized display name for the property/method/event.

setExpertback to summary
public void setExpert(boolean expert)

The "expert" flag is used to distinguish between features that are intended for expert users from those that are intended for normal users.

Parameters
expert:boolean

True if this feature is intended for use by experts only.

setHiddenback to summary
public void setHidden(boolean hidden)

The "hidden" flag is used to identify features that are intended only for tool use, and which should not be exposed to humans.

Parameters
hidden:boolean

True if this feature should be hidden from human users.

setNameback to summary
public void setName(String name)

Sets the programmatic name of this feature.

Parameters
name:String

The programmatic name of the property/method/event

setPreferredback to summary
public void setPreferred(boolean preferred)

The "preferred" flag is used to identify features that are particularly important for presenting to humans.

Parameters
preferred:boolean

True if this feature should be preferentially shown to human users.

Since
1.2
setShortDescriptionback to summary
public void setShortDescription(String text)

You can associate a short descriptive string with a feature. Normally these descriptive strings should be less than about 40 characters.

Parameters
text:String

A (localized) short description to be associated with this property/method/event.

setTransientback to summary
pack-priv void setTransient(Transient annotation)

Sets the "transient" attribute according to the annotation. If the "transient" attribute is already set it should not be changed.

Parameters
annotation:Transient

the annotation of the element of the feature

setValueback to summary
public void setValue(String attributeName, Object value)

Associate a named attribute with this feature.

Parameters
attributeName:String

The locale-independent name of the attribute

value:Object

The value.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
Since
1.7