< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java

Print this page

        

@@ -28,10 +28,11 @@
 import java.text.BreakIterator;
 import java.util.HashMap;
 import java.util.Map;
 
 import com.sun.source.doctree.AttributeTree.ValueKind;
+import com.sun.source.doctree.DocTree;
 import com.sun.tools.javac.parser.DocCommentParser.TagParser.Kind;
 import com.sun.tools.javac.parser.Tokens.Comment;
 import com.sun.tools.javac.parser.Tokens.TokenKind;
 import com.sun.tools.javac.tree.DCTree;
 import com.sun.tools.javac.tree.DCTree.DCAttribute;

@@ -1232,10 +1233,16 @@
                     nextChar();
                     return m.at(pos).newLiteralTree((DCText) text);
                 }
             },
 
+            // {@getter text}
+            new AccessorParser(DCTree.Kind.GETTER),
+
+            // {@getter text}
+            new AccessorParser(DCTree.Kind.SETTER),
+
             // @param parameter-name description
             new TagParser(Kind.BLOCK, DCTree.Kind.PARAM) {
                 public DCTree parse(int pos) throws ParseException {
                     skipWhitespace();
 

@@ -1437,6 +1444,16 @@
         for (TagParser p: parsers)
             tagParsers.put(names.fromString(p.getTreeKind().tagName), p);
 
     }
 
+    class AccessorParser extends TagParser {
+        AccessorParser(DocTree.Kind kind) {
+            super(Kind.BLOCK, kind, true);
+        }
+
+        public DCTree parse(int pos) throws ParseException {
+            List<DCTree> desc = blockContent();
+            return m.at(pos).newAccessorTree(treeKind, desc);
+        }
+    }
 }
< prev index next >