External annotation files
When you generate the external library files, pure function annotations can be automatically created in the resources/extannotations folder. You can have one external annotation file per package.
You can copy an external annotation file into the reference folder of the library to edit it, or create a new external annotation file in this same folder.
External annotation file format
External annotation files contain a <root> element and at least one
<item> element, as shown in the following example:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<item name="org.apache.commons.math3.complex.Complex org.apache.commons.math3.complex.ComplexField getField()">
<annotation name="ilog.rules.bom.annotations.NotBusiness"/>
</item>
</root>
<item> element
The <item> element can represent a class, a class member (field, method, or
constructor), or a parameter. It contains a name attribute.
The following table describes the format to use for each type of item:
| Item type | name format and example |
|---|---|
| Class | name="<class name>"The class name is the name of
the class as returned by For example: <item
name="stuff.Customer"> |
| Field | name="<class name>
<canonical name of the field type>
<field name>"The canonical name of a class is the name of the
class as returned by For example: <item name="stuff.Customer java.lang.String name"> |
| Constructor | name="<class name>
<short class name>(<canonical name of the parameter
types>)"The short class name is the class name without the namespace. Each parameter type is separated by a comma and a space (' For example: <item name="stuff.Customer
Customer(java.lang.String)"> |
| Method | name="<class name>
<method return type>
<method name>(<canonical name of the parameter
types>)"Each parameter type is separated by a comma and a space (' For example: <item name="stuff.Customer void addAge(int,
java.lang.String)"> |
| Constructor parameter | name="<constructor information>
<number of parameters>"
For example: <item name="stuff.Customer Customer(java.lang.String)
0"> |
| Method parameter | name="<method information>
<number of parameters>"
For example: <item name="stuff.Customer void addAge(int,java.lang.String)
1"> |
<annotation> element
The <annotation> element represents an annotation. It contains a
name attribute. The value of the name attribute is the canonical
name of the annotation type.
| Annotation type | Example | Comments |
|---|---|---|
| Annotation without parameters | <annotation name="ilog.rules.bom.annotations.NotBusiness"/> |
|
| Annotation with parameters |
|
Each The |
| Nested annotation |
|
The <val> parent element contains a list of
<annotation> elements. |