annotationMemberT(#id, #parent, #type, 'name', #default)

Represents a member (=field) of an annotation class. ( Java 5 Syntax Element)

Attributes

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

#parent: classT
the annotation class containing this member. It is a class with property annotationTypeT.

#type: Type reference
the type of the member.

'name': atom
the name of the member.

#default: AnnotationExpression, null
the optional default value (can be 'null').

Sample Java Source

public @interface ThisAnnotation {
	String value();
}

Its PEF Representation

classT(#AnnotationType, #CompilationUnit, 'ThisAnnotation', [#AnnotationMember]),
modifierT(#AnnotationType, 'public'),
extendsT(#AnnotationType, #AnnotationClass),
annotationTypeT(#AnnotationType),
annotationMemberT(#AnnotationMember, #AnnotationType, #TypeRef, 'value', 'null').

AST Specification

 ast_node_def('Java',annotationMemberT,[
     ast_arg(id,     mult(1,1,no ), id,   [id]),
     ast_arg(parent, mult(1,1,no ), id,   [id]), 
     ast_arg(type,   mult(1,1,no ), id,   [typeInst]),
     ast_arg(name,   mult(1,1,no ), attr, [atom]),
     ast_arg(expr,   mult(1,1,no ), id,   [annotationExpressionType,nullType])
]).
research/jtransformer/api/java/pefs/3.0/annotationmembert.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019