Annotation Type CompoundParmType


@Retention(RUNTIME) @Target(TYPE) public @interface CompoundParmType
Annotation denoting that a class can be the value parameter of a Map or the type of a variable denoting a group of parameters. The corresponding map will be annotated by the @KeyedCompoundParm annotation. For example,
    @CompoundParmType
    class MapValue {
       @PrimitiveParm("size")
       int size = 10;
       @PrimitiveParm("base")
       int base = 0;
    }

    @FactoryParmManager("OurFactoryParmManager")
    public class OurFactory extends ... {
       @KeyedParm("map")
       Map<OurNamedObject,MapValue> hashmap = new HashMap<>();
       ...
    }
 
This will define factory parameters whose names are "map.size" and "map.base" that will be initialized using a method whose name is "set" that has three arguments.

Additional elements can be provided for CompoundParmType in order to specify resource bundles used for tips, labels, and parameter documentation for the class being annotated. The resource bundles are defined by property files that use annotation value elements as keys. Annotations that provide such keys are PrimitiveParm, KeyedPrimitiveParm CompoundParm, and KeyedCompoundParm.

For a string associated with a key in a label or tip resource bundle to contain HTML constructs, the string must start with <html> and end with </html>. For the HTML case when the lsnof program is used, each <br> element will be replaced with a space for these two resource bundles, and the </html> and </html> elements will be removed from the start and end of the string respectively. Strings associated with parameter-documentation resource bundles are assumed to be HTML fragments with one additional element. These can be inserted as-is into HTML documents and must be formatted so that they can fit between a <DIV> element and a matching </DIV>. The additional element is named JDOC and its contents use the same convention as the Javadoc @link directive. The class name and optional method or field will be turned into a link to the corresponding API documentation.

In some cases, the parameter name consists of those provided by multiple annotations, with a delimiter ("." by default) separating each component. It is worth noting that the simulation and animation classes in the BZDev class library, when used with a scripting environment, assume that the delimiter will be ".".

For example, property files will use the parameter name "size" and "base" as keys in the annotation shown above.

See Also:
  • Element Details

    • tipResourceBundle

      String tipResourceBundle
      The class name for a resource bundle for tips. The name must be either a simple name, a qualified class name starting with "*." or a fully-qualified name whose package component either matches the package of the class being annotated or starts with the package of the class being annotated but followed by a package component named "lpack". The '*." form is meant to suggest a wildcard in which the '*' will be replaced with the package name of the class being annotated. If no value is provided or the value is an empty string, a tip resource bundle is not configured.
      Returns:
      the class name
      Default:
      ""
    • labelResourceBundle

      String labelResourceBundle
      The class name for a resource bundle for labels. The name must be either a simple name, a qualified class name starting with "*." or a fully-qualified name whose package component either matches the package of the class being annotated or starts with the package of the class being annotated but followed by a package component named "lpack". The '*." form is meant to suggest a wildcard in which the '*' will be replaced with the package name of the class being annotated. If no value is provided or the value is an empty string, a label resource bundle is not configured.
      Returns:
      the class name
      Default:
      ""
    • docResourceBundle

      String docResourceBundle
      The class name for a resource bundle for parameter documentation. The name must be either a simple name, a qualified class name starting with "*." or a fully-qualified name whose package component either matches the package of the class being annotated or starts with the package of the class being annotated but followed by a package component named "lpack". The '*." form is meant to suggest a wildcard in which the '*' will be replaced with the package name of the class being annotated. If no value is provided or the value is an empty string, a label resource bundle is not configured.
      Returns:
      the class name
      Default:
      ""