Annotations

Annotations for properties are defined in smartics-properties-annotations. For an overview of all annotations, please refer to the Javadoc report.

Property Set Annotations

A property set is a Java interface that is annotated with the PropertySet annotation. This annotation is required to mark the interface.

Please note that a library with property sets also should provide a

META-INF/smartics-properties/declaration.xml

If the file is not provided, some documentation features are not available.

This metadata file can be generated with the smartics-properties-maven-plugin.

Also required is the (possibly empty) folder

META-INF/smartics-properties

If this folder is not found, the discovery process may refuse an artifact from being inspected.

Property Annotations

No property annotation is required for simple properties. But if you want to add constraints on a property or override default values like the name of a property, annotations on property level are required.

For an overview of property annotations, please refer to the Javadoc report.

Metadata Accessors

Property Descriptors

To access property meta data add a method to the interface that returns an instance of PropertyDescriptor.

String something();
PropertyDescriptor somethingPropertyDescriptor();

Per convention, this method name starts with the name of the property it provides a descriptor for and has a suffix of PropertyDescriptor. No annotations are required to mark a method as a property descriptor accessor.

Property Keys

A special construct is the property key that uniquely identifies the property. To make this key accessible through the interface, provide a method that returns an instance of PropertyKey.

String something();
PropertyKey somethingPropertyKey();

Per convention, this method name starts with the name of the property it provides a key for and has a suffix of PropertyKey. No annotations are required to mark a method as a property key accessor, but if you do want to mark your method explicitly have a look at PropertyMetaDataMethod.

Please refer to smartics-properties-doc for further examples.