org.carrot2.util.attribute
Annotation Type Attribute


@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface Attribute

Denotes fields whose values should be bound (set or collected) by AttributeBinder. A field marked with Attribute will be referred to as an attribute. In order for a type to have any of its attributes bound, the type must be annotated with Bindable. Otherwise, the Attribute annotations will be ignored.

Attributes denoted by Attribute must also be marked with one or both of Input or Output, which define the direction of binding. Attribute fields can also be marked with some extra domain-specific annotations that can then be used to selectively bind only some of a Bindable's attributes (see AttributeBinder for more details).


Optional Element Summary
 boolean inherit
          If true, inherit attribute documentation from another attribute (field).
 String key
          The unique identifier of this attribute.
 

key

public abstract String key
The unique identifier of this attribute. The identifier is used as the key when providing and collecting attribute values though the AttributeBinder.set(Object, java.util.Map, Class...) method. If the key is not provided, the attribute will have its key composed of the prefix defined by the Bindable annotation on the enclosing class (see Bindable.prefix()) followed by a dot (.) and the name of the attribute field as returned by Field.getName().

Default:
""

inherit

public abstract boolean inherit
If true, inherit attribute documentation from another attribute (field). Used in conjunction with Bindable.inherit(). The key() of this attribute must match exactly one of the inherited attributes.

See Also:
Bindable.inherit()
Default:
false


Copyright (c) Dawid Weiss, Stanislaw Osinski