01: package javaparser;
02:
03: public final class AnnotationMemberNode extends ParserTreeNode {
04: String type;
05: String name;
06:
07: public AnnotationMemberNode(
08: RAWParserTreeNode annotationTypeMemberDeclaration) {
09: super ("annotationMember");
10: this .setStartPosFrom(CCTreeUtils
11: .getFirstSubchild(annotationTypeMemberDeclaration));
12: this .setEndPosFrom(CCTreeUtils
13: .getLastSubchild(annotationTypeMemberDeclaration));
14: // modifiers, type, name, (, ), ;
15: if (annotationTypeMemberDeclaration.getChildCount() > 1) {
16: type = CCTreeUtils
17: .getImageOfAllSubElements(annotationTypeMemberDeclaration
18: .getChildNodeAt(1));
19: }
20: if (annotationTypeMemberDeclaration.getChildCount() > 2) {
21: name = CCTreeUtils
22: .getImageOfAllSubElements(annotationTypeMemberDeclaration
23: .getChildNodeAt(2));
24: }
25: // args ???
26: }
27:
28: @Override
29: public String toString() {
30: return type + " " + name + "()";
31: }
32:
33: /** Call this to help GC !
34: */
35: @Override
36: public void terminate() {
37: super.terminate();
38:
39: name = null;
40: type = null;
41: }
42: }
|