org.apache.beehive.controls.api.properties
Annotation Type PropertySet


@Inherited
@Retention(value=RUNTIME)
@Target(value=ANNOTATION_TYPE)
public @interface PropertySet

The PropertySet annotation type is used to mark an interface that defines a set of properties that are associated with a Java Control. By convention, property sets are declared as an inner annotation types on the Java Control public interface.

Each member of the annotation type targeted by the PropertySet annotation will define a new property for the control.

Here is a simple example:

 public interface MyControl extends org.apache.beehive.controls.api.Control
 {
     @PropertySet
     public @interface MyProperties
     {
         public String aStringProperty();
         public int anIntProperty();
         ...
       }
 }
 

A Java Control can have multiple property sets associated with it.


Optional Element Summary
 boolean externalConfig
          The externalConfig member defines whether properties in the set will be settable via external configuration.
 boolean hasSetters
          The hasSetters member defines whether properties in the set will have programmatic setter methods.
 boolean optional
          The optional member specifies that this property set may optionally be associated with the control.
 String prefix
          The prefix member defines a prefix that will be used in all property setter/getter methods for properties in the PropertySet.
 

prefix

public abstract String prefix
The prefix member defines a prefix that will be used in all property setter/getter methods for properties in the PropertySet. It is necessary to specify a prefixes when a control interface has multiple property sets that contain properties with the same name.

The following code shows the basic conventions for setter/getter methods on a Java Control Bean:

     public void set<prefix><propertyName>(<propertyType> value);
     public <propertyType> get<prefix><propertyName>();
 
/code> where prefix is the prefix member value, propertyName is the name of the declared property member, and propertyType is the type associated with the declared property member.

Default:
""

externalConfig

public abstract boolean externalConfig
The externalConfig member defines whether properties in the set will be settable via external configuration.

Default:
true

optional

public abstract boolean optional
The optional member specifies that this property set may optionally be associated with the control. Because there is no way to represent an 'unset' property value, optional properties will not expose a getter method to clients; a control implementation class can determine whether a property is/is not set, because the PropertySet query APIs on ControlBeanContext will return null if unset. For properties that are not optional, a PropertySet instance with all default values will be returned if unset.

See Also:
org.apache.beehive.controls.context.ControlBeanContext.getControlPropertySet, org.apache.beehive.controls.context.ControlBeanContext.getMethodPropertySet
Default:
false

hasSetters

public abstract boolean hasSetters
The hasSetters member defines whether properties in the set will have programmatic setter methods.

Default:
true