classT(#id, #parent, 'name', [#def_1,...])

Represents the class or interface declaration. Every interface declaration is accompanied by the additional fact: interfaceT(#id).
Every annotation declaration is accompanied by an interfaceT(#id) and an annotationT(#id) fact.
If it is an abstract class, there will be an additional modifierT(Class, 'abstract') fact.

Renamed in JT 2.8: Up to 2.8.0 it was defined as classDefT.
Changed in JT 2.6: Now 'owner' referst to a compilationUnitT instead of a packageT. See notes on Changes JTranformer 2.5 -> 2.6.

Arguments

#id: id
the unique ID assigned to this fact.

#parent: execT, compilationUnitT, classT, newClassT
ID of the element that contains this class declaration.

'name': atom
the class name, without a package. In the case of anonymous classes, a globally unique name: ANONYMOUS$<UN>, where <UN> is a unique number.

[#def_1,…]: annotationMemberT, classT, fieldT, methodT, constructorT, classInitializerT
list of IDs for other facts representing the methods or fields, and inner classes. These fields and methods are the members (not necessarily public!) of the class.

Sample Java Source

class HelloWorld  { //corresponding code line to classT
 
   ...
}

Its PEF Representation

classT(#id, #parentElement, 'HelloWorld', [#members ...]).

AST Specification

ast_node_def('Java',classT,[
     ast_arg(id,      mult(1,1,no ), id,  [classT]), % <-- convention!!!
     ast_arg(parent,  mult(1,1,no ), id,  [execT, compilationUnitT, classT, newClassT]),
     ast_arg(name,    mult(1,1,no ), attr,[atom]),
     ast_arg(defs,    mult(0,*,ord), id,  [annotationMemberT, classT, fieldT, methodT, constructorT, classInitializerT])
]).
Last modified: 2014/04/12 06:06
 
*