author | jjg |
Mon, 22 Aug 2016 16:32:40 -0700 | |
changeset 40587 | 1c355ea550ed |
parent 35426 | 374342e56a56 |
child 42000 | 8b7412f7eecd |
permissions | -rw-r--r-- |
10 | 1 |
/* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
25874
diff
changeset
|
2 |
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
25874
diff
changeset
|
26 |
package jdk.javadoc.internal.doclets.toolkit.builders; |
10 | 27 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
25874
diff
changeset
|
28 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
40587 | 29 |
import jdk.javadoc.internal.doclets.toolkit.DocletException; |
10 | 30 |
|
31 |
/** |
|
32 |
* The superclass for all member builders. Member builders are only executed |
|
33 |
* within Class Builders. They essentially build sub-components. For example, |
|
34 |
* method documentation is a sub-component of class documentation. |
|
35 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
36 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
37 |
* If you write code that depends on this, you do so at your own risk. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
38 |
* This code and its internal interfaces are subject to change or |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
39 |
* deletion without notice.</b> |
10 | 40 |
* |
41 |
* @author Jamie Ho |
|
42 |
*/ |
|
43 |
public abstract class AbstractMemberBuilder extends AbstractBuilder { |
|
44 |
||
45 |
/** |
|
46 |
* Construct a SubBuilder. |
|
40587 | 47 |
* @param context a context object, providing information used in this run |
10 | 48 |
* of the doclet. |
49 |
*/ |
|
14542 | 50 |
public AbstractMemberBuilder(Context context) { |
51 |
super(context); |
|
10 | 52 |
} |
53 |
||
54 |
/** |
|
55 |
* This method is not supported by sub-builders. |
|
56 |
* |
|
40587 | 57 |
* @throws AssertionError always |
10 | 58 |
*/ |
40587 | 59 |
@Override |
60 |
public void build() { |
|
61 |
// You may not call the build method in a subbuilder. |
|
62 |
throw new AssertionError(); |
|
10 | 63 |
} |
64 |
||
65 |
||
66 |
/** |
|
40587 | 67 |
* Builds the sub component if there is anything to document. |
10 | 68 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
69 |
* @param node the XML element that specifies which components to document. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
70 |
* @param contentTree content tree to which the documentation will be added |
40587 | 71 |
* @throws DocletException if there is a problem while building the documentation |
10 | 72 |
*/ |
5855 | 73 |
@Override |
40587 | 74 |
public void build(XMLNode node, Content contentTree) throws DocletException { |
10 | 75 |
if (hasMembersToDocument()) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
76 |
super.build(node, contentTree); |
10 | 77 |
} |
78 |
} |
|
79 |
||
80 |
/** |
|
40587 | 81 |
* Returns true if this subbuilder has anything to document. |
10 | 82 |
* |
40587 | 83 |
* @return true if this subbuilder has anything to document |
10 | 84 |
*/ |
85 |
public abstract boolean hasMembersToDocument(); |
|
86 |
} |