4.4.2.2. Interface

<interface> is a child element of <java_package> and defines the generation of a Java Interface.

Usage

The name attribute is mandatory and defines the name of the interface.

Listing 4.28 <interface/> example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<code_instruction>
        ...

        <interface>
                name=""
                visibility=""
                code instruction base

                <generic></generic>
                <apicommentline></apicommentline>
                <devcommentline></devcommentline>
                <import></import>
                <annotation></annotation>
                <inherits
                    condition=""
                    foreach="package|object|field"
                    package="">
                </inherits>
                <field></field>
                <method></method>
        </interface>

        ...
</code_instruction>

Fields

Table 4.22 attributes of <interface/>

Name

Details

name

The name of the java interface that is made

visibility

Visibility of this interface. In practice this is always public

code instruction base

Loupe S Code instruction base.

Sub elements

Table 4.23 sub elements of <interface/>

Name

Details

Number

generic

Makes the interface generic (java 1.5 or higher).

0 or 1

apicommentline

Javadoc for this interface.

0 or 1

devcommentline

Commentary that is attached to this interface.

0 or 1

import

All library elements specified as ‘import’ are translated in the interface as import statements.

0 or more

annotation

Annotation defined for the interface.

0 or more

inherits

The interface from which this interface is derived.

0 or more

field

Those fields contained in this interface. Only static fields are added to the interface. When an field is non-static, only the getters and setters of this attribute are created (depending on the access attribute (rw|ro|wo)). This is a handy way to establish the getters and setters in an interface quickly.

0 or more

method

Methods contained in this interface.

0 or more