for information about XES schema see these
pages.
Method Declaration and Definition
The method node always occurs under a class node. It is used to declare and/or
define a method of a class.
Unlike variables and classes, method is only used to define a method, a seperate
node 'call' is used to call the method.
Attributes used
- Attribute "name" must always be set in the method node.
- Attribute "type" defines the return type of the method.
- Attribute "array" indicates that the return type is an array.
- Attribute "constructor" indicates that this is a constructor and
therefore wont have a return type.
- Attributes "public" , "private" , "protected",
"static" and "primitive" may optionally be used.
- Attribute "interface" indicates that this is an interface (methods
are declared but not defined);
- Attribute "abstract" indicates that this method does not have
a definition.
Child Elements
Each parameter is defined in a nodeParameter node or nodes, these are grouped
together under a nodeParameterList.
If there are any nodeParameterList nodes then they should be before any other
child nodes (apart possibly from comment
nodes)
If there are any "throws" they are grouped together in a nameList
node which will be the second child immediately after the nodeParameter (assuming
there are no comments)
Other possible child elements of classDef are:
| usage |
java example |
XES example |
| constructor |
public class myClass {
myClass(){
}
}
|
<class name="myClass" public="true">
<method constructor="true" name="myClass">
<parameterList/>
</method>
</class>
|
| protected modifier |
protected myMethod() {
}
|
<method constructor="true" name="myMethod" protected="true">
<parameterList/>
</method>
|
| private modifier |
private myMethod() {
}
|
<method constructor="true" name="myMethod" private="true">
<parameterList/>
</method>
|
| abstract modifier |
abstract myMethod() {
}
|
<method abstract="true" constructor="true" name="myMethod">
<parameterList/>
</method>
|
| static modifier |
static myMethod() {
}
|
<method constructor="true" name="myMethod" static="true">
<parameterList/>
</method>
|
| final modifier |
final myMethod() {
}
|
<method constructor="true" final="true" name="myMethod">
<parameterList/>
</method>
|
| synchronized modifier |
synchronized myMethod() {
}
|
<method constructor="true" name="myMethod" synchronized="true">
<parameterList/>
</method>
|
| native modifier |
native myMethod() {
}
|
<method constructor="true" name="myMethod" native="true">
<parameterList/>
</method>
|
| transient modifier |
transient myMethod() {
}
|
<method constructor="true" name="myMethod" transient="true">
<parameterList/>
</method>
|
| strictfp modifier |
strictfp myMethod() {
}
|
<method constructor="true" name="myMethod" strictfp="true">
<parameterList/>
</method>
|
| native parameter |
myMethod(int i) {
}
|
<method constructor="true" name="myMethod">
<parameterList>
<parameter name="i" type="int"/>
</parameterList>
</method> |
| native parameter |
myMethod(myClass mc){
}
|
<method constructor="true" name="myMethod">
<parameterList>
<parameter name="mc" type="myClass"/>
</parameterList>
</method> |
| native and reference parameter |
myMethod(int i,myClass mc) {
} |
<method constructor="true" name="myMethod">
<parameterList>
<parameter name="i" type="int"/>
<parameter name="mc" type="myClass"/>
</parameterList>
</method> |
| native return type |
int myMethod(){} |
<method name="myMethod" type="int">
<parameterList/>
</method> |
| native return type |
myReturnType myMethod(){} |
<method name="myMethod" type="myReturnType">
<parameterList/>
</method> |
| generics |
public < T > void genericMethod(Stack < T > stack){} |
<method genericsType="T" name="genericMethod" public="true"
type="void">
<parameterList>
<parameter genericsType="T" name="stack" type="Stack"/>
</parameterList>
</method> |
| throw |
public void myMethod() throws myError{} |
<method name="myMethod" public="true" type="void">
<parameterList/>
<nameList elementName="throws" name="myError"/>
</method> |
| multiple throws |
public void myMethod() throws myError1,myError2{} |
<method name="myMethod" public="true" type="void">
<parameterList/>
<nameList elementName="throws" name="myError1,myError2"/>
</method> |
| abstract class |
public abstract class myClass{
public abstract void myMethod();
} |
<class abstract="true" def="true" name="myClass"
public="true">
<method abstract="true" name="myMethod" public="true"
type="void">
<parameterList/>
</method>
</class> |
| |
|
|