kokuwaio / esh-constants-maven-plugin

A Maven plugin that generates a Java constants class from the content of the ESH-INF folder. Very useful for e.g. OpenHAB binding development.
Apache License 2.0
4 stars 2 forks source link

Add JavaDoc to CID_ constants #19

Open dmfs opened 2 years ago

dmfs commented 2 years ago

In order to get some support from the IDE when working with CID_* constants, as a user of this plugin I'd like to have the content of some of the <channel> child elements and attributes in the JavaDoc of the constant.

For instance, given a channel like this:

<channel id="powerIn" typeId="power">
  <label>Consumed Power</label>
  <description>This is the power that the …</description>
</channel>

and a channel type like this:

<channel-type id="power">
    <item-type>Number:Power</item-type>
    <label>Active Power</label>
    <state readOnly="true" pattern="%d %unit%"/>
</channel-type>

The constant could look like this:

/**
 * <h1>Consumed Power (Active Power)</h1>
 * This is the power that the …
 * <p>
 * Type: Number:Power
*/
public static final String CID_POWERIN = "powerIn";