Skip to content

Descriptor annotation #16

@wsargent

Description

@wsargent

One of the useful things about descriptors is they can specify default values, min and max value and useful metadata on attributes:

It'd be nice to have an annotation that could represent this next to an attribute. There is an immutable descriptor used for sort, but not the general purpose descriptor values.

https://github.com/uklimaschewski/JMXWrapper/blob/master/src/com/udojava/jmx/wrapper/JMXBeanWrapper.java#L567

For example, using the DescriptorKey meta-annotation someone may define a Units("inches") annotation

@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Units {
    @DescriptorKey("units")
    String value();
}

And JMXWrapper could then pick up the annotation on attribute and add it to the descriptor at runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions