FileDocCategorySizeDatePackage
FeatureDescriptor.javaAPI DocAndroid 1.5 API5490Wed May 06 22:41:54 BST 2009java.beans

FeatureDescriptor

public class FeatureDescriptor extends Object
Common base class for Descriptors.

Fields Summary
private Map
values
boolean
preferred
boolean
hidden
boolean
expert
String
shortDescription
String
name
String
displayName
Constructors Summary
public FeatureDescriptor()

Constructs an instance.

        this.values = new HashMap<String, Object>();
    
Methods Summary
public java.util.EnumerationattributeNames()

Enumerates the attribute names.

return
An instance of {@link Enumeration}.

        // Create a new list, so that the references are copied
        return Collections.enumeration(new LinkedList<String>(values.keySet()));
    
public java.lang.StringgetDisplayName()

Gets the display name or {@link #getName()} if not set.

return
The display name.

        return displayName == null ? getName() : displayName;
    
public java.lang.StringgetName()

Gets the name.

return
The name.

        return name;
    
public java.lang.StringgetShortDescription()

Gets the short description or {@link #getDisplayName()} if not set.

return
The description.

        return shortDescription == null ? getDisplayName() : shortDescription;
    
public java.lang.ObjectgetValue(java.lang.String attributeName)

Gets the value associated with the named attribute.

param
attributeName The name of the attribute to get a value for.
return
The attribute's value.

        Object result = null;
        if (attributeName != null) {
            result = values.get(attributeName);
        }
        return result;
    
public booleanisExpert()

Indicates if this feature is an expert feature.

return
true if hidden, false otherwise.

        return expert;
    
public booleanisHidden()

Indicates if this feature is hidden.

return
true if hidden, false otherwise.

        return hidden;
    
public booleanisPreferred()

Indicates if this feature is preferred.

return
true if preferred, false otherwise.

        return preferred;
    
public voidsetDisplayName(java.lang.String displayName)

Sets the display name.

param
displayName The display name to set.

        this.displayName = displayName;
    
public voidsetExpert(boolean expert)

Sets the expert indicator.

param
expert true if expert, false otherwise.

        this.expert = expert;
    
public voidsetHidden(boolean hidden)

Sets the hidden indicator.

param
hidden true if hidden, false otherwise.

        this.hidden = hidden;
    
public voidsetName(java.lang.String name)

Sets the name.

param
name The name to set.

        this.name = name;
    
public voidsetPreferred(boolean preferred)

Sets the preferred indicator.

param
preferred true if preferred, false otherwise.

        this.preferred = preferred;
    
public voidsetShortDescription(java.lang.String text)

Sets the short description.

param
text The description to set.

        this.shortDescription = text;
    
public voidsetValue(java.lang.String attributeName, java.lang.Object value)

Sets the value for the named attribute.

param
attributeName The name of the attribute to set a value with.
param
value The value to set.

        if (attributeName == null || value == null) {
            throw new NullPointerException();
        }
        values.put(attributeName, value);