aoqi@0: /* aoqi@0: * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: /* aoqi@0: * @test aoqi@0: * @bug 7021614 aoqi@0: * @summary extend com.sun.source API to support parsing javadoc comments aoqi@0: * @build DocCommentTester aoqi@0: * @run main DocCommentTester AttrTest.java aoqi@0: */ aoqi@0: aoqi@0: class AttrTest { aoqi@0: /** aoqi@0: * foo aoqi@0: */ aoqi@0: void unquoted_attr() { } aoqi@0: /* aoqi@0: DocComment[DOC_COMMENT, pos:1 aoqi@0: firstSentence: 3 aoqi@0: StartElement[START_ELEMENT, pos:1 aoqi@0: name:a aoqi@0: attributes: 1 aoqi@0: Attribute[ATTRIBUTE, pos:4 aoqi@0: name: name aoqi@0: vkind: UNQUOTED aoqi@0: value: 1 aoqi@0: Text[TEXT, pos:9, unquoted] aoqi@0: ] aoqi@0: ] aoqi@0: Text[TEXT, pos:18, foo] aoqi@0: EndElement[END_ELEMENT, pos:21, a] aoqi@0: body: empty aoqi@0: block tags: empty aoqi@0: ] aoqi@0: */ aoqi@0: aoqi@0: /** aoqi@0: * foo aoqi@0: */ aoqi@0: void double_quoted_attr() { } aoqi@0: /* aoqi@0: DocComment[DOC_COMMENT, pos:1 aoqi@0: firstSentence: 3 aoqi@0: StartElement[START_ELEMENT, pos:1 aoqi@0: name:a aoqi@0: attributes: 1 aoqi@0: Attribute[ATTRIBUTE, pos:4 aoqi@0: name: name aoqi@0: vkind: DOUBLE aoqi@0: value: 1 aoqi@0: Text[TEXT, pos:10, double_quoted] aoqi@0: ] aoqi@0: ] aoqi@0: Text[TEXT, pos:25, foo] aoqi@0: EndElement[END_ELEMENT, pos:28, a] aoqi@0: body: empty aoqi@0: block tags: empty aoqi@0: ] aoqi@0: */ aoqi@0: aoqi@0: /** aoqi@0: * foo aoqi@0: */ aoqi@0: void single_quoted_attr() { } aoqi@0: /* aoqi@0: DocComment[DOC_COMMENT, pos:1 aoqi@0: firstSentence: 3 aoqi@0: StartElement[START_ELEMENT, pos:1 aoqi@0: name:a aoqi@0: attributes: 1 aoqi@0: Attribute[ATTRIBUTE, pos:4 aoqi@0: name: name aoqi@0: vkind: SINGLE aoqi@0: value: 1 aoqi@0: Text[TEXT, pos:10, single_quoted] aoqi@0: ] aoqi@0: ] aoqi@0: Text[TEXT, pos:25, foo] aoqi@0: EndElement[END_ELEMENT, pos:28, a] aoqi@0: body: empty aoqi@0: block tags: empty aoqi@0: ] aoqi@0: */ aoqi@0: aoqi@0: /** aoqi@0: *
aoqi@0: */ aoqi@0: void numeric_attr() { } aoqi@0: /* aoqi@0: DocComment[DOC_COMMENT, pos:1 aoqi@0: firstSentence: 1 aoqi@0: StartElement[START_ELEMENT, pos:1 aoqi@0: name:hr aoqi@0: attributes: 1 aoqi@0: Attribute[ATTRIBUTE, pos:5 aoqi@0: name: size aoqi@0: vkind: DOUBLE aoqi@0: value: 1 aoqi@0: Text[TEXT, pos:11, 3] aoqi@0: ] aoqi@0: ] aoqi@0: body: empty aoqi@0: block tags: empty aoqi@0: ] aoqi@0: */ aoqi@0: aoqi@0: /** aoqi@0: * aoqi@0: */ aoqi@0: void docRoot_attr() { } aoqi@0: /* aoqi@0: DocComment[DOC_COMMENT, pos:1 aoqi@0: firstSentence: 1 aoqi@0: StartElement[START_ELEMENT, pos:1 aoqi@0: name:a aoqi@0: attributes: 1 aoqi@0: Attribute[ATTRIBUTE, pos:4 aoqi@0: name: href aoqi@0: vkind: DOUBLE aoqi@0: value: 2 aoqi@0: DocRoot[DOC_ROOT, pos:10] aoqi@0: Text[TEXT, pos:20, /index.html] aoqi@0: ] aoqi@0: ] aoqi@0: body: empty aoqi@0: block tags: empty aoqi@0: ] aoqi@0: */ aoqi@0: aoqi@0: /** aoqi@0: * aoqi@0: */ aoqi@0: void entity_attr() { } aoqi@0: /* aoqi@0: DocComment[DOC_COMMENT, pos:1 aoqi@0: firstSentence: 1 aoqi@0: StartElement[START_ELEMENT, pos:1 aoqi@0: name:a aoqi@0: attributes: 1 aoqi@0: Attribute[ATTRIBUTE, pos:4 aoqi@0: name: name aoqi@0: vkind: DOUBLE aoqi@0: value: 3 aoqi@0: Text[TEXT, pos:10, abc] aoqi@0: Entity[ENTITY, pos:13, quot] aoqi@0: Text[TEXT, pos:19, def] aoqi@0: ] aoqi@0: ] aoqi@0: body: empty aoqi@0: block tags: empty aoqi@0: ] aoqi@0: */ aoqi@0: aoqi@0: /** aoqi@0: *
aoqi@0: */ aoqi@0: void no_value_attr() { } aoqi@0: /* aoqi@0: DocComment[DOC_COMMENT, pos:1 aoqi@0: firstSentence: 1 aoqi@0: StartElement[START_ELEMENT, pos:1 aoqi@0: name:hr aoqi@0: attributes: 1 aoqi@0: Attribute[ATTRIBUTE, pos:5 aoqi@0: name: noshade aoqi@0: vkind: EMPTY aoqi@0: value: null aoqi@0: ] aoqi@0: ] aoqi@0: body: empty aoqi@0: block tags: empty aoqi@0: ] aoqi@0: */ aoqi@0: aoqi@0: /** aoqi@0: * abc
aoqi@0: */ aoqi@0: void self_closing_attr_1() { } aoqi@0: /* aoqi@0: DocComment[DOC_COMMENT, pos:1 aoqi@0: firstSentence: 2 aoqi@0: Text[TEXT, pos:1, abc_] aoqi@0: StartElement[START_ELEMENT, pos:5 aoqi@0: name:hr aoqi@0: attributes: 1 aoqi@0: Attribute[ATTRIBUTE, pos:9 aoqi@0: name: size aoqi@0: vkind: SINGLE aoqi@0: value: 1 aoqi@0: Text[TEXT, pos:15, 3] aoqi@0: ] aoqi@0: ] aoqi@0: body: empty aoqi@0: block tags: empty aoqi@0: ] aoqi@0: */ aoqi@0: aoqi@0: /** aoqi@0: * abc
aoqi@0: */ aoqi@0: void self_closing_attr_2() { } aoqi@0: /* aoqi@0: DocComment[DOC_COMMENT, pos:1 aoqi@0: firstSentence: 2 aoqi@0: Text[TEXT, pos:1, abc_] aoqi@0: StartElement[START_ELEMENT, pos:5 aoqi@0: name:hr aoqi@0: attributes: 1 aoqi@0: Attribute[ATTRIBUTE, pos:9 aoqi@0: name: size aoqi@0: vkind: UNQUOTED aoqi@0: value: 1 aoqi@0: Text[TEXT, pos:14, 3] aoqi@0: ] aoqi@0: ] aoqi@0: body: empty aoqi@0: block tags: empty aoqi@0: ] aoqi@0: */ aoqi@0: aoqi@0: /** aoqi@0: * abc