@Documented
@Retention(value=RUNTIME)
@Target(value={java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER})
public @interface Description
@Description(resourceKey="myapp.resources.TestMXBean.description",
resourceBundleBaseName="myapp.resources.MBeanResources")
public interface TestMXBean {
@Description(resourceKey="myapp.resources.TestMXBean.threshold.description",
resourceBundleBaseName="myapp.resources.MBeanResources" )
public int getthreshold();
@Description(resourceKey="myapp.resources.TestMXBean.reset.description",
resourceBundleBaseName="myapp.resources.MBeanResources")
public int reset(
@Description(resourceKey="myapp.resources.TestMXBean.reset.id.description",
resourceBundleBaseName="myapp.resources.MBeanResources",
displayNameKey="myapp.resources.TestMXBean.reset.id.displayName.description")
int id);
}
If an attribute is read/write, and therefore exposes both a getter and setter method,
then it should only annotate one of those two methods.Modifier and Type | Fields and Description |
---|---|
static java.lang.String |
DESCRIPTION_DISPLAY_NAME_KEY |
static java.lang.String |
DESCRIPTION_RESOURCE_BUNDLE_BASE_NAME |
static java.lang.String |
DESCRIPTION_RESOURCE_KEY |
Modifier and Type | Required Element and Description |
---|---|
java.lang.String |
resourceKey
Contains the name of the resource key.
|
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String |
displayNameKey
Contains the name of the key for displayName.
|
java.lang.String |
resourceBundleBaseName
Contains the fully qualified name for the resource bundle that
contains the resource specified using the resourceKey.
|
public static final java.lang.String DESCRIPTION_RESOURCE_BUNDLE_BASE_NAME
@DescriptorKey(value="descriptionResourceKey") public abstract java.lang.String resourceKey
"myapp.resources.TestMXBean.reset.description
@DescriptorKey(value="descriptionDisplayNameKey") public abstract java.lang.String displayNameKey
"myapp.resources.TestMXBean.reset.displayName.description
@DescriptorKey(value="descriptionResourceBundleBaseName") public abstract java.lang.String resourceBundleBaseName
myapp.resources.MBeanResources
If the annotation doesn't apply to the MBean interface, then
the resourceBundleBaseName can be omitted, in which case the
resource bundle defined at the MBean interface level will be used.