Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
8cf30206
D
dragonwell8_langtools
项目概览
openanolis
/
dragonwell8_langtools
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_langtools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8cf30206
编写于
6月 18, 2010
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6961178: Allow doclet.xml to contain XML attributes
Reviewed-by: bpatel
上级
787782d6
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
293 addition
and
420 deletion
+293
-420
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java
...ls/doclets/internal/toolkit/builders/AbstractBuilder.java
+39
-34
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java
...lets/internal/toolkit/builders/AbstractMemberBuilder.java
+3
-3
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java
...lets/internal/toolkit/builders/AnnotationTypeBuilder.java
+14
-29
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java
...toolkit/builders/AnnotationTypeOptionalMemberBuilder.java
+5
-18
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java
...toolkit/builders/AnnotationTypeRequiredMemberBuilder.java
+10
-25
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java
...tools/doclets/internal/toolkit/builders/ClassBuilder.java
+26
-41
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java
...ts/internal/toolkit/builders/ConstantsSummaryBuilder.java
+17
-32
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java
...doclets/internal/toolkit/builders/ConstructorBuilder.java
+10
-27
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java
...oclets/internal/toolkit/builders/EnumConstantBuilder.java
+10
-27
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java
...tools/doclets/internal/toolkit/builders/FieldBuilder.java
+10
-27
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java
...tools/doclets/internal/toolkit/builders/LayoutParser.java
+13
-24
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java
...clets/internal/toolkit/builders/MemberSummaryBuilder.java
+10
-27
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java
...ools/doclets/internal/toolkit/builders/MethodBuilder.java
+11
-27
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java
...lets/internal/toolkit/builders/PackageSummaryBuilder.java
+16
-34
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java
...lets/internal/toolkit/builders/SerializedFormBuilder.java
+30
-45
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/XMLNode.java
.../sun/tools/doclets/internal/toolkit/builders/XMLNode.java
+69
-0
未找到文件。
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java
浏览文件 @
8cf30206
...
...
@@ -92,43 +92,41 @@ public abstract class AbstractBuilder {
public
abstract
void
build
()
throws
IOException
;
/**
* Build the documentation, as specified by the given XML element
s
.
* Build the documentation, as specified by the given XML element.
*
* @param elements the XML elements that specify which components to
* document.
* @param node the XML element that specifies which component to document.
*/
protected
void
build
(
List
<?>
elements
)
{
for
(
int
i
=
0
;
i
<
elements
.
size
();
i
++
)
{
Object
element
=
elements
.
get
(
i
);
String
component
=
(
String
)
((
element
instanceof
String
)
?
element
:
((
List
<?>)
element
).
get
(
0
));
try
{
invokeMethod
(
"build"
+
component
,
element
instanceof
String
?
new
Class
<?>[]
{}
:
new
Class
<?>[]
{
List
.
class
},
element
instanceof
String
?
new
Object
[]
{}
:
new
Object
[]
{((
List
<?>)
element
).
subList
(
1
,
((
List
<?>)
element
).
size
())});
}
catch
(
NoSuchMethodException
e
)
{
e
.
printStackTrace
();
configuration
.
root
.
printError
(
"Unknown element: "
+
component
);
throw
new
DocletAbortException
();
}
catch
(
InvocationTargetException
e
)
{
e
.
getCause
().
printStackTrace
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
configuration
.
root
.
printError
(
"Exception "
+
e
.
getClass
().
getName
()
+
" thrown while processing element: "
+
component
);
throw
new
DocletAbortException
();
}
protected
void
build
(
XMLNode
node
)
{
String
component
=
node
.
name
;
try
{
invokeMethod
(
"build"
+
component
,
new
Class
<?>[]
{
XMLNode
.
class
},
new
Object
[]
{
node
});
}
catch
(
NoSuchMethodException
e
)
{
e
.
printStackTrace
();
configuration
.
root
.
printError
(
"Unknown element: "
+
component
);
throw
new
DocletAbortException
();
}
catch
(
InvocationTargetException
e
)
{
e
.
getCause
().
printStackTrace
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
configuration
.
root
.
printError
(
"Exception "
+
e
.
getClass
().
getName
()
+
" thrown while processing element: "
+
component
);
throw
new
DocletAbortException
();
}
}
/**
* Build the documentation, as specified by the children of the given XML element.
*
* @param node the XML element that specifies which components to document.
*/
protected
void
buildChildren
(
XMLNode
node
)
{
for
(
XMLNode
child:
node
.
children
)
build
(
child
);
}
/**
* Given the name and parameters, invoke the method in the builder. This
* method is required to invoke the appropriate build method as instructed
...
...
@@ -138,7 +136,14 @@ public abstract class AbstractBuilder {
* @param paramClasses the types for each parameter.
* @param params the parameters of the method.
*/
protected
abstract
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
protected
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
;
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java
浏览文件 @
8cf30206
...
...
@@ -27,7 +27,6 @@ package com.sun.tools.doclets.internal.toolkit.builders;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.tools.doclets.internal.toolkit.util.*
;
import
java.util.*
;
/**
* The superclass for all member builders. Member builders are only executed
...
...
@@ -69,9 +68,10 @@ public abstract class AbstractMemberBuilder extends AbstractBuilder {
*
* @param elements {@inheritDoc}
*/
public
void
build
(
List
<?>
elements
)
{
@Override
public
void
build
(
XMLNode
node
)
{
if
(
hasMembersToDocument
())
{
super
.
build
(
elements
);
super
.
build
(
node
);
}
}
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java
浏览文件 @
8cf30206
...
...
@@ -30,7 +30,6 @@ import com.sun.tools.doclets.internal.toolkit.*;
import
com.sun.javadoc.*
;
import
java.io.*
;
import
java.util.*
;
import
java.lang.reflect.*
;
/**
* Builds the summary for a given annotation type.
...
...
@@ -89,20 +88,6 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
return
builder
;
}
/**
* {@inheritDoc}
*/
public
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
/**
* {@inheritDoc}
*/
...
...
@@ -122,8 +107,8 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
*
* @param elements the XML elements that specify how to document a class.
*/
public
void
buildAnnotationTypeDoc
(
List
<?>
elements
)
throws
Exception
{
build
(
elements
);
public
void
buildAnnotationTypeDoc
(
XMLNode
node
)
throws
Exception
{
build
Children
(
node
);
writer
.
close
();
copyDocFiles
();
}
...
...
@@ -154,7 +139,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
/**
* Build the header of the page.
*/
public
void
buildAnnotationTypeHeader
()
{
public
void
buildAnnotationTypeHeader
(
XMLNode
node
)
{
writer
.
writeHeader
(
configuration
.
getText
(
"doclet.AnnotationType"
)
+
" "
+
annotationTypeDoc
.
name
());
}
...
...
@@ -162,14 +147,14 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
/**
* If this class is deprecated, print the appropriate information.
*/
public
void
buildDeprecationInfo
()
{
public
void
buildDeprecationInfo
(
XMLNode
node
)
{
writer
.
writeAnnotationTypeDeprecationInfo
();
}
/**
* Build the signature of the current annotation type.
*/
public
void
buildAnnotationTypeSignature
()
{
public
void
buildAnnotationTypeSignature
(
XMLNode
node
)
{
StringBuffer
modifiers
=
new
StringBuffer
(
annotationTypeDoc
.
modifiers
()
+
" "
);
writer
.
writeAnnotationTypeSignature
(
...
...
@@ -180,14 +165,14 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
/**
* Build the class description.
*/
public
void
buildAnnotationTypeDescription
()
{
public
void
buildAnnotationTypeDescription
(
XMLNode
node
)
{
writer
.
writeAnnotationTypeDescription
();
}
/**
* Build the tag information for the current class.
*/
public
void
buildAnnotationTypeTagInfo
()
{
public
void
buildAnnotationTypeTagInfo
(
XMLNode
node
)
{
writer
.
writeAnnotationTypeTagInfo
();
}
...
...
@@ -197,9 +182,9 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
* @param elements the XML elements that specify how a member summary is
* documented.
*/
public
void
buildMemberSummary
(
List
<?>
elements
)
throws
Exception
{
public
void
buildMemberSummary
(
XMLNode
node
)
throws
Exception
{
configuration
.
getBuilderFactory
().
getMemberSummaryBuilder
(
writer
).
build
(
elements
);
getMemberSummaryBuilder
(
writer
).
build
Children
(
node
);
writer
.
completeMemberSummaryBuild
();
}
...
...
@@ -209,10 +194,10 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
* @param elements the XML elements that specify how a annotation type
* members are documented.
*/
public
void
buildAnnotationTypeOptionalMemberDetails
(
List
<?>
elements
)
public
void
buildAnnotationTypeOptionalMemberDetails
(
XMLNode
node
)
throws
Exception
{
configuration
.
getBuilderFactory
().
getAnnotationTypeOptionalMemberBuilder
(
writer
).
build
(
elements
);
getAnnotationTypeOptionalMemberBuilder
(
writer
).
build
Children
(
node
);
}
/**
...
...
@@ -221,17 +206,17 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
* @param elements the XML elements that specify how a annotation type
* members are documented.
*/
public
void
buildAnnotationTypeRequiredMemberDetails
(
List
<?>
elements
)
public
void
buildAnnotationTypeRequiredMemberDetails
(
XMLNode
node
)
throws
Exception
{
configuration
.
getBuilderFactory
().
getAnnotationTypeRequiredMemberBuilder
(
writer
).
build
(
elements
);
getAnnotationTypeRequiredMemberBuilder
(
writer
).
build
Children
(
node
);
}
/**
* Build the footer of the page.
*/
public
void
buildAnnotationTypeFooter
()
{
public
void
buildAnnotationTypeFooter
(
XMLNode
node
)
{
writer
.
writeFooter
();
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java
浏览文件 @
8cf30206
...
...
@@ -30,7 +30,6 @@ import com.sun.tools.doclets.internal.toolkit.util.*;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.javadoc.*
;
import
java.util.*
;
import
java.lang.reflect.*
;
/**
* Builds documentation for optional annotation type members.
...
...
@@ -85,6 +84,7 @@ public class AnnotationTypeOptionalMemberBuilder extends
/**
* {@inheritDoc}
*/
@Override
public
String
getName
()
{
return
"AnnotationTypeOptionalMemberDetails"
;
}
...
...
@@ -95,34 +95,20 @@ public class AnnotationTypeOptionalMemberBuilder extends
* @param elements the XML elements that specify how to construct this
* documentation.
*/
public
void
buildAnnotationTypeOptionalMember
(
List
<?>
elements
)
{
public
void
buildAnnotationTypeOptionalMember
(
XMLNode
node
)
{
if
(
writer
==
null
)
{
return
;
}
for
(
currentMemberIndex
=
0
;
currentMemberIndex
<
members
.
size
();
currentMemberIndex
++)
{
build
(
elements
);
build
Children
(
node
);
}
}
/**
* {@inheritDoc}
*/
public
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
/**
* Document the default value for this optional member.
*/
public
void
buildDefaultValueInfo
()
{
public
void
buildDefaultValueInfo
(
XMLNode
node
)
{
((
AnnotationTypeOptionalMemberWriter
)
writer
).
writeDefaultValueInfo
(
(
MemberDoc
)
members
.
get
(
currentMemberIndex
));
}
...
...
@@ -130,6 +116,7 @@ public class AnnotationTypeOptionalMemberBuilder extends
/**
* {@inheritDoc}
*/
@Override
public
AnnotationTypeRequiredMemberWriter
getWriter
()
{
return
writer
;
}
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java
浏览文件 @
8cf30206
...
...
@@ -30,7 +30,6 @@ import com.sun.tools.doclets.internal.toolkit.util.*;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.javadoc.*
;
import
java.util.*
;
import
java.lang.reflect.*
;
/**
* Builds documentation for required annotation type members.
...
...
@@ -113,20 +112,6 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
return
"AnnotationTypeRequiredMemberDetails"
;
}
/**
* {@inheritDoc}
*/
public
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
/**
* Returns a list of members that will be documented for the given class.
* This information can be used for doclet specific documentation
...
...
@@ -161,20 +146,20 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
* @param elements the XML elements that specify how to construct this
* documentation.
*/
public
void
buildAnnotationTypeRequiredMember
(
List
<?>
elements
)
{
public
void
buildAnnotationTypeRequiredMember
(
XMLNode
node
)
{
if
(
writer
==
null
)
{
return
;
}
for
(
currentMemberIndex
=
0
;
currentMemberIndex
<
members
.
size
();
currentMemberIndex
++)
{
build
(
elements
);
build
Children
(
node
);
}
}
/**
* Build the overall header.
*/
public
void
buildHeader
()
{
public
void
buildHeader
(
XMLNode
node
)
{
writer
.
writeHeader
(
classDoc
,
configuration
.
getText
(
"doclet.Annotation_Type_Member_Detail"
));
}
...
...
@@ -182,7 +167,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
/**
* Build the header for the individual members.
*/
public
void
buildMemberHeader
()
{
public
void
buildMemberHeader
(
XMLNode
node
)
{
writer
.
writeMemberHeader
((
MemberDoc
)
members
.
get
(
currentMemberIndex
),
currentMemberIndex
==
0
);
...
...
@@ -191,14 +176,14 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
/**
* Build the signature.
*/
public
void
buildSignature
()
{
public
void
buildSignature
(
XMLNode
node
)
{
writer
.
writeSignature
((
MemberDoc
)
members
.
get
(
currentMemberIndex
));
}
/**
* Build the deprecation information.
*/
public
void
buildDeprecationInfo
()
{
public
void
buildDeprecationInfo
(
XMLNode
node
)
{
writer
.
writeDeprecated
((
MemberDoc
)
members
.
get
(
currentMemberIndex
));
}
...
...
@@ -206,7 +191,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
* Build the comments for the member. Do nothing if
* {@link Configuration#nocomment} is set to true.
*/
public
void
buildMemberComments
()
{
public
void
buildMemberComments
(
XMLNode
node
)
{
if
(!
configuration
.
nocomment
){
writer
.
writeComments
((
MemberDoc
)
members
.
get
(
currentMemberIndex
));
}
...
...
@@ -215,21 +200,21 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
/**
* Build the tag information.
*/
public
void
buildTagInfo
()
{
public
void
buildTagInfo
(
XMLNode
node
)
{
writer
.
writeTags
((
MemberDoc
)
members
.
get
(
currentMemberIndex
));
}
/**
* Build the footer for the individual member.
*/
public
void
buildMemberFooter
()
{
public
void
buildMemberFooter
(
XMLNode
node
)
{
writer
.
writeMemberFooter
();
}
/**
* Build the overall footer.
*/
public
void
buildFooter
()
{
public
void
buildFooter
(
XMLNode
node
)
{
writer
.
writeFooter
(
classDoc
);
}
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java
浏览文件 @
8cf30206
...
...
@@ -30,7 +30,6 @@ import com.sun.tools.doclets.internal.toolkit.*;
import
com.sun.javadoc.*
;
import
java.io.*
;
import
java.util.*
;
import
java.lang.reflect.*
;
/**
* Builds the summary for a given class.
...
...
@@ -105,20 +104,6 @@ public class ClassBuilder extends AbstractBuilder {
return
builder
;
}
/**
* {@inheritDoc}
*/
public
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
/**
* {@inheritDoc}
*/
...
...
@@ -138,8 +123,8 @@ public class ClassBuilder extends AbstractBuilder {
*
* @param elements the XML elements that specify how to document a class.
*/
public
void
buildClassDoc
(
List
<?>
elements
)
throws
Exception
{
build
(
elements
);
public
void
buildClassDoc
(
XMLNode
node
)
throws
Exception
{
build
Children
(
node
);
writer
.
close
();
copyDocFiles
();
}
...
...
@@ -169,7 +154,7 @@ public class ClassBuilder extends AbstractBuilder {
/**
* Build the header of the page.
*/
public
void
buildClassHeader
()
{
public
void
buildClassHeader
(
XMLNode
node
)
{
String
key
;
if
(
isInterface
)
{
key
=
"doclet.Interface"
;
...
...
@@ -185,7 +170,7 @@ public class ClassBuilder extends AbstractBuilder {
/**
* Build the class tree documentation.
*/
public
void
buildClassTree
()
{
public
void
buildClassTree
(
XMLNode
node
)
{
writer
.
writeClassTree
();
}
...
...
@@ -193,42 +178,42 @@ public class ClassBuilder extends AbstractBuilder {
* If this is a class, list all interfaces
* implemented by this class.
*/
public
void
buildImplementedInterfacesInfo
()
{
public
void
buildImplementedInterfacesInfo
(
XMLNode
node
)
{
writer
.
writeImplementedInterfacesInfo
();
}
/**
* If this is an interface, list all super interfaces.
*/
public
void
buildSuperInterfacesInfo
()
{
public
void
buildSuperInterfacesInfo
(
XMLNode
node
)
{
writer
.
writeSuperInterfacesInfo
();
}
/**
* List the parameters of this class.
*/
public
void
buildTypeParamInfo
()
{
public
void
buildTypeParamInfo
(
XMLNode
node
)
{
writer
.
writeTypeParamInfo
();
}
/**
* List all the classes extend this one.
*/
public
void
buildSubClassInfo
()
{
public
void
buildSubClassInfo
(
XMLNode
node
)
{
writer
.
writeSubClassInfo
();
}
/**
* List all the interfaces that extend this one.
*/
public
void
buildSubInterfacesInfo
()
{
public
void
buildSubInterfacesInfo
(
XMLNode
node
)
{
writer
.
writeSubInterfacesInfo
();
}
/**
* If this is an interface, list all classes that implement this interface.
*/
public
void
buildInterfaceUsageInfo
()
{
public
void
buildInterfaceUsageInfo
(
XMLNode
node
)
{
writer
.
writeInterfaceUsageInfo
();
}
...
...
@@ -236,21 +221,21 @@ public class ClassBuilder extends AbstractBuilder {
* If this is an inner class or interface, list the enclosing class or
* interface.
*/
public
void
buildNestedClassInfo
()
{
public
void
buildNestedClassInfo
(
XMLNode
node
)
{
writer
.
writeNestedClassInfo
();
}
/**
* If this class is deprecated, print the appropriate information.
*/
public
void
buildDeprecationInfo
()
{
public
void
buildDeprecationInfo
(
XMLNode
node
)
{
writer
.
writeClassDeprecationInfo
();
}
/**
* Build the signature of the current class.
*/
public
void
buildClassSignature
()
{
public
void
buildClassSignature
(
XMLNode
node
)
{
StringBuffer
modifiers
=
new
StringBuffer
(
classDoc
.
modifiers
()
+
" "
);
if
(
isEnum
)
{
modifiers
.
append
(
"enum "
);
...
...
@@ -276,14 +261,14 @@ public class ClassBuilder extends AbstractBuilder {
/**
* Build the class description.
*/
public
void
buildClassDescription
()
{
public
void
buildClassDescription
(
XMLNode
node
)
{
writer
.
writeClassDescription
();
}
/**
* Build the tag information for the current class.
*/
public
void
buildClassTagInfo
()
{
public
void
buildClassTagInfo
(
XMLNode
node
)
{
writer
.
writeClassTagInfo
();
}
...
...
@@ -293,9 +278,9 @@ public class ClassBuilder extends AbstractBuilder {
* @param elements the XML elements that specify how a member summary is
* documented.
*/
public
void
buildMemberSummary
(
List
<?>
elements
)
throws
Exception
{
public
void
buildMemberSummary
(
XMLNode
node
)
throws
Exception
{
configuration
.
getBuilderFactory
().
getMemberSummaryBuilder
(
writer
).
build
(
elements
);
getMemberSummaryBuilder
(
writer
).
build
Children
(
node
);
writer
.
completeMemberSummaryBuild
();
}
...
...
@@ -305,9 +290,9 @@ public class ClassBuilder extends AbstractBuilder {
* @param elements the XML elements that specify how a enum constants are
* documented.
*/
public
void
buildEnumConstantsDetails
(
List
<?>
elements
)
throws
Exception
{
public
void
buildEnumConstantsDetails
(
XMLNode
node
)
throws
Exception
{
configuration
.
getBuilderFactory
().
getEnumConstantsBuilder
(
writer
).
build
(
elements
);
getEnumConstantsBuilder
(
writer
).
build
Children
(
node
);
}
/**
...
...
@@ -315,9 +300,9 @@ public class ClassBuilder extends AbstractBuilder {
*
* @param elements the XML elements that specify how a field is documented.
*/
public
void
buildFieldDetails
(
List
<?>
elements
)
throws
Exception
{
public
void
buildFieldDetails
(
XMLNode
node
)
throws
Exception
{
configuration
.
getBuilderFactory
().
getFieldBuilder
(
writer
).
build
(
elements
);
getFieldBuilder
(
writer
).
build
Children
(
node
);
}
/**
...
...
@@ -326,9 +311,9 @@ public class ClassBuilder extends AbstractBuilder {
* @param elements the XML elements that specify how to document a
* constructor.
*/
public
void
buildConstructorDetails
(
List
<?>
elements
)
throws
Exception
{
public
void
buildConstructorDetails
(
XMLNode
node
)
throws
Exception
{
configuration
.
getBuilderFactory
().
getConstructorBuilder
(
writer
).
build
(
elements
);
getConstructorBuilder
(
writer
).
build
Children
(
node
);
}
/**
...
...
@@ -336,15 +321,15 @@ public class ClassBuilder extends AbstractBuilder {
*
* @param elements the XML elements that specify how a method is documented.
*/
public
void
buildMethodDetails
(
List
<?>
elements
)
throws
Exception
{
public
void
buildMethodDetails
(
XMLNode
node
)
throws
Exception
{
configuration
.
getBuilderFactory
().
getMethodBuilder
(
writer
).
build
(
elements
);
getMethodBuilder
(
writer
).
build
Children
(
node
);
}
/**
* Build the footer of the page.
*/
public
void
buildClassFooter
()
{
public
void
buildClassFooter
(
XMLNode
node
)
{
writer
.
writeFooter
();
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java
浏览文件 @
8cf30206
...
...
@@ -30,7 +30,6 @@ import com.sun.tools.doclets.internal.toolkit.*;
import
com.sun.javadoc.*
;
import
java.io.*
;
import
java.util.*
;
import
java.lang.reflect.*
;
/**
* Builds the Constants Summary Page.
...
...
@@ -106,20 +105,6 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
return
builder
;
}
/**
* {@inheritDoc}
*/
public
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
/**
* {@inheritDoc}
*/
...
...
@@ -144,29 +129,29 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
* @param elements the list of elements describing constant summary
* documentation.
*/
public
void
buildConstantSummary
(
List
<?>
elements
)
throws
Exception
{
build
(
elements
);
public
void
buildConstantSummary
(
XMLNode
node
)
throws
Exception
{
build
Children
(
node
);
writer
.
close
();
}
/**
* Build the header.
*/
public
void
buildHeader
()
{
public
void
buildHeader
(
XMLNode
node
)
{
writer
.
writeHeader
();
}
/**
* Build the footer.
*/
public
void
buildFooter
()
{
public
void
buildFooter
(
XMLNode
node
)
{
writer
.
writeFooter
();
}
/**
* Build the table of contents.
*/
public
void
buildContents
()
{
public
void
buildContents
(
XMLNode
node
)
{
writer
.
writeContentsHeader
();
PackageDoc
[]
packages
=
configuration
.
packages
;
printedPackageHeaders
=
new
HashSet
<
String
>();
...
...
@@ -186,14 +171,14 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
* @param elements the XML elements that represent the components
* of documentation for each package.
*/
public
void
buildConstantSummaries
(
List
<?>
elements
)
{
public
void
buildConstantSummaries
(
XMLNode
node
)
{
PackageDoc
[]
packages
=
configuration
.
packages
;
printedPackageHeaders
=
new
HashSet
<
String
>();
for
(
int
i
=
0
;
i
<
packages
.
length
;
i
++)
{
if
(
hasConstantField
(
packages
[
i
]))
{
currentPackage
=
packages
[
i
];
//Build the documentation for the current package.
build
(
elements
);
build
Children
(
node
);
}
}
}
...
...
@@ -204,8 +189,8 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
* @param elements the list of XML elements that make up package
* documentation.
*/
public
void
buildPackageConstantSummary
(
List
<?>
elements
)
{
build
(
elements
);
public
void
buildPackageConstantSummary
(
XMLNode
node
)
{
build
Children
(
node
);
}
/**
...
...
@@ -214,7 +199,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
* @param elements the list of XML elements that make up the class
* constant summary.
*/
public
void
buildClassConstantSummary
(
List
<?>
elements
)
{
public
void
buildClassConstantSummary
(
XMLNode
node
)
{
ClassDoc
[]
classes
=
currentPackage
.
name
().
length
()
>
0
?
currentPackage
.
allClasses
()
:
configuration
.
classDocCatalog
.
allClasses
(
...
...
@@ -227,14 +212,14 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
}
currentClass
=
classes
[
i
];
//Build the documentation for the current class.
build
(
elements
);
build
Children
(
node
);
}
}
/**
* Build the header for the given class.
*/
public
void
buildPackageHeader
()
{
public
void
buildPackageHeader
(
XMLNode
node
)
{
String
parsedPackageName
=
parsePackageName
(
currentPackage
.
name
());
if
(!
printedPackageHeaders
.
contains
(
parsedPackageName
))
{
writer
.
writePackageName
(
currentPackage
,
...
...
@@ -246,7 +231,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
/**
* Build the header for the given class.
*/
public
void
buildClassHeader
()
{
public
void
buildClassHeader
(
XMLNode
node
)
{
writer
.
writeConstantMembersHeader
(
currentClass
);
}
...
...
@@ -254,14 +239,14 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
* Print summary of constant members in the
* class.
*/
public
void
buildConstantMembers
()
{
new
ConstantFieldBuilder
(
currentClass
).
buildMembersSummary
();
public
void
buildConstantMembers
(
XMLNode
node
)
{
new
ConstantFieldBuilder
(
currentClass
).
buildMembersSummary
(
node
);
}
/**
* Build the footer for the given class.
*/
public
void
buildClassFooter
()
{
public
void
buildClassFooter
(
XMLNode
node
)
{
writer
.
writeConstantMembersFooter
(
currentClass
);
}
...
...
@@ -362,7 +347,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
/**
* Builds the table of constants for a given class.
*/
protected
void
buildMembersSummary
()
{
protected
void
buildMembersSummary
(
XMLNode
node
)
{
List
<
FieldDoc
>
members
=
new
ArrayList
<
FieldDoc
>(
members
());
if
(
members
.
size
()
>
0
)
{
Collections
.
sort
(
members
);
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java
浏览文件 @
8cf30206
...
...
@@ -28,7 +28,6 @@ package com.sun.tools.doclets.internal.toolkit.builders;
import
com.sun.tools.doclets.internal.toolkit.util.*
;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.javadoc.*
;
import
java.lang.reflect.*
;
import
java.util.*
;
/**
...
...
@@ -133,22 +132,6 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
return
constructors
.
size
()
>
0
;
}
/**
* {@inheritDoc}
*/
public
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
/**
* Returns a list of constructors that will be documented for the given class.
* This information can be used for doclet specific documentation
...
...
@@ -175,21 +158,21 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
* @param elements the XML elements that specify how to construct this
* documentation.
*/
public
void
buildConstructorDoc
(
List
<?>
elements
)
{
public
void
buildConstructorDoc
(
XMLNode
node
)
{
if
(
writer
==
null
)
{
return
;
}
for
(
currentMethodIndex
=
0
;
currentMethodIndex
<
constructors
.
size
();
currentMethodIndex
++)
{
build
(
elements
);
build
Children
(
node
);
}
}
/**
* Build the overall header.
*/
public
void
buildHeader
()
{
public
void
buildHeader
(
XMLNode
node
)
{
writer
.
writeHeader
(
classDoc
,
configuration
.
getText
(
"doclet.Constructor_Detail"
));
...
...
@@ -198,7 +181,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
/**
* Build the header for the individual constructor.
*/
public
void
buildConstructorHeader
()
{
public
void
buildConstructorHeader
(
XMLNode
node
)
{
writer
.
writeConstructorHeader
(
(
ConstructorDoc
)
constructors
.
get
(
currentMethodIndex
),
currentMethodIndex
==
0
);
...
...
@@ -207,7 +190,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
/**
* Build the signature.
*/
public
void
buildSignature
()
{
public
void
buildSignature
(
XMLNode
node
)
{
writer
.
writeSignature
(
(
ConstructorDoc
)
constructors
.
get
(
currentMethodIndex
));
}
...
...
@@ -215,7 +198,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
/**
* Build the deprecation information.
*/
public
void
buildDeprecationInfo
()
{
public
void
buildDeprecationInfo
(
XMLNode
node
)
{
writer
.
writeDeprecated
(
(
ConstructorDoc
)
constructors
.
get
(
currentMethodIndex
));
}
...
...
@@ -224,7 +207,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
* Build the comments for the constructor. Do nothing if
* {@link Configuration#nocomment} is set to true.
*/
public
void
buildConstructorComments
()
{
public
void
buildConstructorComments
(
XMLNode
node
)
{
if
(!
configuration
.
nocomment
)
{
writer
.
writeComments
(
(
ConstructorDoc
)
constructors
.
get
(
currentMethodIndex
));
...
...
@@ -234,21 +217,21 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
/**
* Build the tag information.
*/
public
void
buildTagInfo
()
{
public
void
buildTagInfo
(
XMLNode
node
)
{
writer
.
writeTags
((
ConstructorDoc
)
constructors
.
get
(
currentMethodIndex
));
}
/**
* Build the footer for the individual constructor.
*/
public
void
buildConstructorFooter
()
{
public
void
buildConstructorFooter
(
XMLNode
node
)
{
writer
.
writeConstructorFooter
();
}
/**
* Build the overall footer.
*/
public
void
buildFooter
()
{
public
void
buildFooter
(
XMLNode
node
)
{
writer
.
writeFooter
(
classDoc
);
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java
浏览文件 @
8cf30206
...
...
@@ -29,7 +29,6 @@ import com.sun.tools.doclets.internal.toolkit.util.*;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.javadoc.*
;
import
java.util.*
;
import
java.lang.reflect.*
;
/**
* Builds documentation for a enum constants.
...
...
@@ -115,22 +114,6 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
return
"EnumConstantDetails"
;
}
/**
* {@inheritDoc}
*/
public
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
/**
* Returns a list of enum constants that will be documented for the given class.
* This information can be used for doclet specific documentation
...
...
@@ -165,21 +148,21 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
* @param elements the XML elements that specify how to construct this
* documentation.
*/
public
void
buildEnumConstant
(
List
<?>
elements
)
{
public
void
buildEnumConstant
(
XMLNode
node
)
{
if
(
writer
==
null
)
{
return
;
}
for
(
currentEnumConstantsIndex
=
0
;
currentEnumConstantsIndex
<
enumConstants
.
size
();
currentEnumConstantsIndex
++)
{
build
(
elements
);
build
Children
(
node
);
}
}
/**
* Build the overall header.
*/
public
void
buildHeader
()
{
public
void
buildHeader
(
XMLNode
node
)
{
writer
.
writeHeader
(
classDoc
,
configuration
.
getText
(
"doclet.Enum_Constant_Detail"
));
...
...
@@ -188,7 +171,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
/**
* Build the header for the individual enum constants.
*/
public
void
buildEnumConstantHeader
()
{
public
void
buildEnumConstantHeader
(
XMLNode
node
)
{
writer
.
writeEnumConstantHeader
(
(
FieldDoc
)
enumConstants
.
get
(
currentEnumConstantsIndex
),
currentEnumConstantsIndex
==
0
);
...
...
@@ -197,7 +180,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
/**
* Build the signature.
*/
public
void
buildSignature
()
{
public
void
buildSignature
(
XMLNode
node
)
{
writer
.
writeSignature
(
(
FieldDoc
)
enumConstants
.
get
(
currentEnumConstantsIndex
));
}
...
...
@@ -205,7 +188,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
/**
* Build the deprecation information.
*/
public
void
buildDeprecationInfo
()
{
public
void
buildDeprecationInfo
(
XMLNode
node
)
{
writer
.
writeDeprecated
(
(
FieldDoc
)
enumConstants
.
get
(
currentEnumConstantsIndex
));
}
...
...
@@ -214,7 +197,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
* Build the comments for the enum constant. Do nothing if
* {@link Configuration#nocomment} is set to true.
*/
public
void
buildEnumConstantComments
()
{
public
void
buildEnumConstantComments
(
XMLNode
node
)
{
if
(!
configuration
.
nocomment
)
{
writer
.
writeComments
(
(
FieldDoc
)
enumConstants
.
get
(
currentEnumConstantsIndex
));
...
...
@@ -224,7 +207,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
/**
* Build the tag information.
*/
public
void
buildTagInfo
()
{
public
void
buildTagInfo
(
XMLNode
node
)
{
writer
.
writeTags
(
(
FieldDoc
)
enumConstants
.
get
(
currentEnumConstantsIndex
));
}
...
...
@@ -232,14 +215,14 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
/**
* Build the footer for the individual enum constants.
*/
public
void
buildEnumConstantFooter
()
{
public
void
buildEnumConstantFooter
(
XMLNode
node
)
{
writer
.
writeEnumConstantFooter
();
}
/**
* Build the overall footer.
*/
public
void
buildFooter
()
{
public
void
buildFooter
(
XMLNode
node
)
{
writer
.
writeFooter
(
classDoc
);
}
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java
浏览文件 @
8cf30206
...
...
@@ -29,7 +29,6 @@ import com.sun.tools.doclets.internal.toolkit.util.*;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.javadoc.*
;
import
java.util.*
;
import
java.lang.reflect.*
;
/**
* Builds documentation for a field.
...
...
@@ -116,22 +115,6 @@ public class FieldBuilder extends AbstractMemberBuilder {
return
"FieldDetails"
;
}
/**
* {@inheritDoc}
*/
public
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
/**
* Returns a list of fields that will be documented for the given class.
* This information can be used for doclet specific documentation
...
...
@@ -166,21 +149,21 @@ public class FieldBuilder extends AbstractMemberBuilder {
* @param elements the XML elements that specify how to construct this
* documentation.
*/
public
void
buildFieldDoc
(
List
<?>
elements
)
{
public
void
buildFieldDoc
(
XMLNode
node
)
{
if
(
writer
==
null
)
{
return
;
}
for
(
currentFieldIndex
=
0
;
currentFieldIndex
<
fields
.
size
();
currentFieldIndex
++)
{
build
(
elements
);
build
Children
(
node
);
}
}
/**
* Build the overall header.
*/
public
void
buildHeader
()
{
public
void
buildHeader
(
XMLNode
node
)
{
writer
.
writeHeader
(
classDoc
,
configuration
.
getText
(
"doclet.Field_Detail"
));
...
...
@@ -189,7 +172,7 @@ public class FieldBuilder extends AbstractMemberBuilder {
/**
* Build the header for the individual field.
*/
public
void
buildFieldHeader
()
{
public
void
buildFieldHeader
(
XMLNode
node
)
{
writer
.
writeFieldHeader
(
(
FieldDoc
)
fields
.
get
(
currentFieldIndex
),
currentFieldIndex
==
0
);
...
...
@@ -198,14 +181,14 @@ public class FieldBuilder extends AbstractMemberBuilder {
/**
* Build the signature.
*/
public
void
buildSignature
()
{
public
void
buildSignature
(
XMLNode
node
)
{
writer
.
writeSignature
((
FieldDoc
)
fields
.
get
(
currentFieldIndex
));
}
/**
* Build the deprecation information.
*/
public
void
buildDeprecationInfo
()
{
public
void
buildDeprecationInfo
(
XMLNode
node
)
{
writer
.
writeDeprecated
((
FieldDoc
)
fields
.
get
(
currentFieldIndex
));
}
...
...
@@ -213,7 +196,7 @@ public class FieldBuilder extends AbstractMemberBuilder {
* Build the comments for the field. Do nothing if
* {@link Configuration#nocomment} is set to true.
*/
public
void
buildFieldComments
()
{
public
void
buildFieldComments
(
XMLNode
node
)
{
if
(!
configuration
.
nocomment
)
{
writer
.
writeComments
((
FieldDoc
)
fields
.
get
(
currentFieldIndex
));
}
...
...
@@ -222,21 +205,21 @@ public class FieldBuilder extends AbstractMemberBuilder {
/**
* Build the tag information.
*/
public
void
buildTagInfo
()
{
public
void
buildTagInfo
(
XMLNode
node
)
{
writer
.
writeTags
((
FieldDoc
)
fields
.
get
(
currentFieldIndex
));
}
/**
* Build the footer for the individual field.
*/
public
void
buildFieldFooter
()
{
public
void
buildFieldFooter
(
XMLNode
node
)
{
writer
.
writeFieldFooter
();
}
/**
* Build the overall footer.
*/
public
void
buildFooter
()
{
public
void
buildFooter
(
XMLNode
node
)
{
writer
.
writeFooter
(
classDoc
);
}
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java
浏览文件 @
8cf30206
...
...
@@ -45,8 +45,8 @@ public class LayoutParser extends DefaultHandler {
/**
* The map of XML elements that have been parsed.
*/
private
Map
<
String
,
List
<
Object
>
>
xmlElementsMap
;
private
Map
<
String
,
XMLNode
>
xmlElementsMap
;
private
XMLNode
currentNode
;
private
Configuration
configuration
;
private
static
LayoutParser
instance
;
private
String
currentRoot
;
...
...
@@ -56,7 +56,7 @@ public class LayoutParser extends DefaultHandler {
* This class is a singleton.
*/
private
LayoutParser
(
Configuration
configuration
)
{
xmlElementsMap
=
new
HashMap
<
String
,
List
<
Object
>
>();
xmlElementsMap
=
new
HashMap
<
String
,
XMLNode
>();
this
.
configuration
=
configuration
;
}
...
...
@@ -78,20 +78,18 @@ public class LayoutParser extends DefaultHandler {
*
* @return List the list of XML elements parsed.
*/
public
List
<?>
parseXML
(
String
root
)
{
public
XMLNode
parseXML
(
String
root
)
{
if
(
xmlElementsMap
.
containsKey
(
root
))
{
return
xmlElementsMap
.
get
(
root
);
}
try
{
List
<
Object
>
xmlElements
=
new
ArrayList
<
Object
>();
xmlElementsMap
.
put
(
root
,
xmlElements
);
currentRoot
=
root
;
isParsing
=
false
;
SAXParserFactory
factory
=
SAXParserFactory
.
newInstance
();
SAXParser
saxParser
=
factory
.
newSAXParser
();
InputStream
in
=
configuration
.
getBuilderXML
();
saxParser
.
parse
(
in
,
this
);
return
xmlElements
;
return
xmlElements
Map
.
get
(
root
)
;
}
catch
(
Throwable
t
)
{
t
.
printStackTrace
();
throw
new
DocletAbortException
();
...
...
@@ -101,39 +99,30 @@ public class LayoutParser extends DefaultHandler {
/**
* {@inheritDoc}
*/
@Override
public
void
startElement
(
String
namespaceURI
,
String
sName
,
String
qName
,
Attributes
attrs
)
throws
SAXException
{
if
(
isParsing
||
qName
.
equals
(
currentRoot
))
{
isParsing
=
true
;
List
<
Object
>
xmlElements
=
xmlElementsMap
.
get
(
currentRoot
);
xmlElements
.
add
(
qName
);
currentNode
=
new
XMLNode
(
currentNode
,
qName
);
for
(
int
i
=
0
;
i
<
attrs
.
getLength
();
i
++)
currentNode
.
attrs
.
put
(
attrs
.
getLocalName
(
i
),
attrs
.
getValue
(
i
));
if
(
qName
.
equals
(
currentRoot
))
xmlElementsMap
.
put
(
qName
,
currentNode
);
}
}
/**
* {@inheritDoc}
*/
@Override
public
void
endElement
(
String
namespaceURI
,
String
sName
,
String
qName
)
throws
SAXException
{
if
(!
isParsing
)
{
isParsing
=
false
;
return
;
}
List
<
Object
>
xmlElements
=
xmlElementsMap
.
get
(
currentRoot
);
if
(
xmlElements
.
get
(
xmlElements
.
size
()-
1
).
equals
(
qName
))
{
return
;
}
else
{
List
<
Object
>
subElements
=
new
ArrayList
<
Object
>();
int
targetIndex
=
xmlElements
.
indexOf
(
qName
);
int
size
=
xmlElements
.
size
();
for
(
int
i
=
targetIndex
;
i
<
size
;
i
++)
{
subElements
.
add
(
xmlElements
.
get
(
targetIndex
));
xmlElements
.
remove
(
targetIndex
);
}
//Save the sub elements as a list.
xmlElements
.
add
(
subElements
);
}
currentNode
=
currentNode
.
parent
;
isParsing
=
!
qName
.
equals
(
currentRoot
);
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java
浏览文件 @
8cf30206
...
...
@@ -29,7 +29,6 @@ import com.sun.tools.doclets.internal.toolkit.util.*;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.javadoc.*
;
import
java.util.*
;
import
java.lang.reflect.*
;
/**
* Builds the member summary.
...
...
@@ -174,22 +173,6 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
return
visibleMemberMaps
[
type
].
getLeafClassMembers
(
configuration
);
}
/**
* {@inheritDoc}
*/
public
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
/**
* Return true it there are any members to summarize.
*
...
...
@@ -211,7 +194,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
/**
* Build the summary for the enum constants.
*/
public
void
buildEnumConstantsSummary
()
{
public
void
buildEnumConstantsSummary
(
XMLNode
node
)
{
buildSummary
(
memberSummaryWriters
[
VisibleMemberMap
.
ENUM_CONSTANTS
],
visibleMemberMaps
[
VisibleMemberMap
.
ENUM_CONSTANTS
]);
...
...
@@ -220,7 +203,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
/**
* Build the summary for the optional members.
*/
public
void
buildAnnotationTypeOptionalMemberSummary
()
{
public
void
buildAnnotationTypeOptionalMemberSummary
(
XMLNode
node
)
{
buildSummary
(
memberSummaryWriters
[
VisibleMemberMap
.
ANNOTATION_TYPE_MEMBER_OPTIONAL
],
visibleMemberMaps
[
VisibleMemberMap
.
ANNOTATION_TYPE_MEMBER_OPTIONAL
]);
...
...
@@ -229,7 +212,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
/**
* Build the summary for the optional members.
*/
public
void
buildAnnotationTypeRequiredMemberSummary
()
{
public
void
buildAnnotationTypeRequiredMemberSummary
(
XMLNode
node
)
{
buildSummary
(
memberSummaryWriters
[
VisibleMemberMap
.
ANNOTATION_TYPE_MEMBER_REQUIRED
],
visibleMemberMaps
[
VisibleMemberMap
.
ANNOTATION_TYPE_MEMBER_REQUIRED
]);
...
...
@@ -238,7 +221,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
/**
* Build the summary for the fields.
*/
public
void
buildFieldsSummary
()
{
public
void
buildFieldsSummary
(
XMLNode
node
)
{
buildSummary
(
memberSummaryWriters
[
VisibleMemberMap
.
FIELDS
],
visibleMemberMaps
[
VisibleMemberMap
.
FIELDS
]);
...
...
@@ -247,7 +230,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
/**
* Build the inherited summary for the fields.
*/
public
void
buildFieldsInheritedSummary
()
{
public
void
buildFieldsInheritedSummary
(
XMLNode
node
)
{
buildInheritedSummary
(
memberSummaryWriters
[
VisibleMemberMap
.
FIELDS
],
visibleMemberMaps
[
VisibleMemberMap
.
FIELDS
]);
...
...
@@ -256,7 +239,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
/**
* Build the summary for the nested classes.
*/
public
void
buildNestedClassesSummary
()
{
public
void
buildNestedClassesSummary
(
XMLNode
node
)
{
buildSummary
(
memberSummaryWriters
[
VisibleMemberMap
.
INNERCLASSES
],
visibleMemberMaps
[
VisibleMemberMap
.
INNERCLASSES
]);
...
...
@@ -265,7 +248,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
/**
* Build the inherited summary for the nested classes.
*/
public
void
buildNestedClassesInheritedSummary
()
{
public
void
buildNestedClassesInheritedSummary
(
XMLNode
node
)
{
buildInheritedSummary
(
memberSummaryWriters
[
VisibleMemberMap
.
INNERCLASSES
],
visibleMemberMaps
[
VisibleMemberMap
.
INNERCLASSES
]);
...
...
@@ -274,7 +257,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
/**
* Build the method summary.
*/
public
void
buildMethodsSummary
()
{
public
void
buildMethodsSummary
(
XMLNode
node
)
{
buildSummary
(
memberSummaryWriters
[
VisibleMemberMap
.
METHODS
],
visibleMemberMaps
[
VisibleMemberMap
.
METHODS
]);
...
...
@@ -283,7 +266,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
/**
* Build the inherited method summary.
*/
public
void
buildMethodsInheritedSummary
()
{
public
void
buildMethodsInheritedSummary
(
XMLNode
node
)
{
buildInheritedSummary
(
memberSummaryWriters
[
VisibleMemberMap
.
METHODS
],
visibleMemberMaps
[
VisibleMemberMap
.
METHODS
]);
...
...
@@ -292,7 +275,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
/**
* Build the constructor summary.
*/
public
void
buildConstructorsSummary
()
{
public
void
buildConstructorsSummary
(
XMLNode
node
)
{
buildSummary
(
memberSummaryWriters
[
VisibleMemberMap
.
CONSTRUCTORS
],
visibleMemberMaps
[
VisibleMemberMap
.
CONSTRUCTORS
]);
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java
浏览文件 @
8cf30206
...
...
@@ -29,7 +29,7 @@ import com.sun.tools.doclets.internal.toolkit.util.*;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.javadoc.*
;
import
java.util.*
;
import
java.lang.reflect.*
;
/**
* Builds documentation for a method.
*
...
...
@@ -111,22 +111,6 @@ public class MethodBuilder extends AbstractMemberBuilder {
return
"MethodDetails"
;
}
/**
* {@inheritDoc}
*/
public
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
/**
* Returns a list of methods that will be documented for the given class.
* This information can be used for doclet specific documentation
...
...
@@ -158,21 +142,21 @@ public class MethodBuilder extends AbstractMemberBuilder {
/**
* Build the method documentation.
*/
public
void
buildMethodDoc
(
List
<?>
elements
)
{
public
void
buildMethodDoc
(
XMLNode
node
)
{
if
(
writer
==
null
)
{
return
;
}
for
(
currentMethodIndex
=
0
;
currentMethodIndex
<
methods
.
size
();
currentMethodIndex
++)
{
build
(
elements
);
build
Children
(
node
);
}
}
/**
* Build the overall header.
*/
public
void
buildHeader
()
{
public
void
buildHeader
(
XMLNode
node
)
{
writer
.
writeHeader
(
classDoc
,
configuration
.
getText
(
"doclet.Method_Detail"
));
...
...
@@ -181,7 +165,7 @@ public class MethodBuilder extends AbstractMemberBuilder {
/**
* Build the header for the individual method.
*/
public
void
buildMethodHeader
()
{
public
void
buildMethodHeader
(
XMLNode
node
)
{
writer
.
writeMethodHeader
(
(
MethodDoc
)
methods
.
get
(
currentMethodIndex
),
currentMethodIndex
==
0
);
...
...
@@ -190,14 +174,14 @@ public class MethodBuilder extends AbstractMemberBuilder {
/**
* Build the signature.
*/
public
void
buildSignature
()
{
public
void
buildSignature
(
XMLNode
node
)
{
writer
.
writeSignature
((
MethodDoc
)
methods
.
get
(
currentMethodIndex
));
}
/**
* Build the deprecation information.
*/
public
void
buildDeprecationInfo
()
{
public
void
buildDeprecationInfo
(
XMLNode
node
)
{
writer
.
writeDeprecated
((
MethodDoc
)
methods
.
get
(
currentMethodIndex
));
}
...
...
@@ -205,7 +189,7 @@ public class MethodBuilder extends AbstractMemberBuilder {
* Build the comments for the method. Do nothing if
* {@link Configuration#nocomment} is set to true. If this method
*/
public
void
buildMethodComments
()
{
public
void
buildMethodComments
(
XMLNode
node
)
{
if
(!
configuration
.
nocomment
)
{
MethodDoc
method
=
(
MethodDoc
)
methods
.
get
(
currentMethodIndex
);
...
...
@@ -228,21 +212,21 @@ public class MethodBuilder extends AbstractMemberBuilder {
/**
* Build the tag information.
*/
public
void
buildTagInfo
()
{
public
void
buildTagInfo
(
XMLNode
node
)
{
writer
.
writeTags
((
MethodDoc
)
methods
.
get
(
currentMethodIndex
));
}
/**
* Build the footer of the method.
*/
public
void
buildMethodFooter
()
{
public
void
buildMethodFooter
(
XMLNode
node
)
{
writer
.
writeMethodFooter
();
}
/**
* Build the overall footer.
*/
public
void
buildFooter
()
{
public
void
buildFooter
(
XMLNode
node
)
{
writer
.
writeFooter
(
classDoc
);
}
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java
浏览文件 @
8cf30206
...
...
@@ -29,8 +29,6 @@ import com.sun.tools.doclets.internal.toolkit.util.*;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.javadoc.*
;
import
java.io.*
;
import
java.util.*
;
import
java.lang.reflect.*
;
/**
* Builds the summary for a given package.
...
...
@@ -84,22 +82,6 @@ public class PackageSummaryBuilder extends AbstractBuilder {
return
builder
;
}
/**
* {@inheritDoc}
*/
public
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
/**
* Build the package summary.
*/
...
...
@@ -121,8 +103,8 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/**
* Build the package documentation.
*/
public
void
buildPackageDoc
(
List
<?>
elements
)
throws
Exception
{
build
(
elements
);
public
void
buildPackageDoc
(
XMLNode
node
)
throws
Exception
{
build
Children
(
node
);
packageWriter
.
close
();
Util
.
copyDocFiles
(
configuration
,
...
...
@@ -136,14 +118,14 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/**
* Build the header of the summary.
*/
public
void
buildPackageHeader
()
{
public
void
buildPackageHeader
(
XMLNode
node
)
{
packageWriter
.
writePackageHeader
(
Util
.
getPackageName
(
packageDoc
));
}
/**
* Build the description of the summary.
*/
public
void
buildPackageDescription
()
{
public
void
buildPackageDescription
(
XMLNode
node
)
{
if
(
configuration
.
nocomment
)
{
return
;
}
...
...
@@ -153,7 +135,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/**
* Build the tags of the summary.
*/
public
void
buildPackageTags
()
{
public
void
buildPackageTags
(
XMLNode
node
)
{
if
(
configuration
.
nocomment
)
{
return
;
}
...
...
@@ -163,28 +145,28 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/**
* Build the package summary.
*/
public
void
buildSummary
(
List
<?>
elements
)
{
build
(
elements
);
public
void
buildSummary
(
XMLNode
node
)
{
build
Children
(
node
);
}
/**
* Build the overall header.
*/
public
void
buildSummaryHeader
()
{
public
void
buildSummaryHeader
(
XMLNode
node
)
{
packageWriter
.
writeSummaryHeader
();
}
/**
* Build the overall footer.
*/
public
void
buildSummaryFooter
()
{
public
void
buildSummaryFooter
(
XMLNode
node
)
{
packageWriter
.
writeSummaryFooter
();
}
/**
* Build the summary for the classes in this package.
*/
public
void
buildClassSummary
()
{
public
void
buildClassSummary
(
XMLNode
node
)
{
String
classTableSummary
=
configuration
.
getText
(
"doclet.Member_Table_Summary"
,
configuration
.
getText
(
"doclet.Class_Summary"
),
...
...
@@ -209,7 +191,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/**
* Build the summary for the interfaces in this package.
*/
public
void
buildInterfaceSummary
()
{
public
void
buildInterfaceSummary
(
XMLNode
node
)
{
String
interfaceTableSummary
=
configuration
.
getText
(
"doclet.Member_Table_Summary"
,
configuration
.
getText
(
"doclet.Interface_Summary"
),
...
...
@@ -234,7 +216,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/**
* Build the summary for the enums in this package.
*/
public
void
buildAnnotationTypeSummary
()
{
public
void
buildAnnotationTypeSummary
(
XMLNode
node
)
{
String
annotationtypeTableSummary
=
configuration
.
getText
(
"doclet.Member_Table_Summary"
,
configuration
.
getText
(
"doclet.Annotation_Types_Summary"
),
...
...
@@ -259,7 +241,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/**
* Build the summary for the enums in this package.
*/
public
void
buildEnumSummary
()
{
public
void
buildEnumSummary
(
XMLNode
node
)
{
String
enumTableSummary
=
configuration
.
getText
(
"doclet.Member_Table_Summary"
,
configuration
.
getText
(
"doclet.Enum_Summary"
),
...
...
@@ -284,7 +266,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/**
* Build the summary for the exceptions in this package.
*/
public
void
buildExceptionSummary
()
{
public
void
buildExceptionSummary
(
XMLNode
node
)
{
String
exceptionTableSummary
=
configuration
.
getText
(
"doclet.Member_Table_Summary"
,
configuration
.
getText
(
"doclet.Exception_Summary"
),
...
...
@@ -309,7 +291,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/**
* Build the summary for the errors in this package.
*/
public
void
buildErrorSummary
()
{
public
void
buildErrorSummary
(
XMLNode
node
)
{
String
errorTableSummary
=
configuration
.
getText
(
"doclet.Member_Table_Summary"
,
configuration
.
getText
(
"doclet.Error_Summary"
),
...
...
@@ -334,7 +316,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/**
* Build the footer of the summary.
*/
public
void
buildPackageFooter
()
{
public
void
buildPackageFooter
(
XMLNode
node
)
{
packageWriter
.
writePackageFooter
();
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java
浏览文件 @
8cf30206
...
...
@@ -26,7 +26,6 @@
package
com.sun.tools.doclets.internal.toolkit.builders
;
import
java.io.*
;
import
java.lang.reflect.*
;
import
java.util.*
;
import
com.sun.javadoc.*
;
...
...
@@ -132,47 +131,33 @@ public class SerializedFormBuilder extends AbstractBuilder {
/**
* Build the serialized form.
*/
public
void
buildSerializedForm
(
List
<?>
elements
)
throws
Exception
{
build
(
elements
);
public
void
buildSerializedForm
(
XMLNode
node
)
throws
Exception
{
build
Children
(
node
);
writer
.
close
();
}
/**
* {@inheritDoc}
*/
public
void
invokeMethod
(
String
methodName
,
Class
<?>[]
paramClasses
,
Object
[]
params
)
throws
Exception
{
if
(
DEBUG
)
{
configuration
.
root
.
printError
(
"DEBUG: "
+
this
.
getClass
().
getName
()
+
"."
+
methodName
);
}
Method
method
=
this
.
getClass
().
getMethod
(
methodName
,
paramClasses
);
method
.
invoke
(
this
,
params
);
}
/**
* Build the header.
*/
public
void
buildHeader
()
{
public
void
buildHeader
(
XMLNode
node
)
{
writer
.
writeHeader
(
configuration
.
getText
(
"doclet.Serialized_Form"
));
}
/**
* Build the contents.
*/
public
void
buildSerializedFormSummaries
(
List
<?>
elements
)
{
public
void
buildSerializedFormSummaries
(
XMLNode
node
)
{
PackageDoc
[]
packages
=
configuration
.
packages
;
for
(
int
i
=
0
;
i
<
packages
.
length
;
i
++)
{
currentPackage
=
packages
[
i
];
build
(
elements
);
build
Children
(
node
);
}
}
/**
* Build the package serialized for for the current package being processed.
*/
public
void
buildPackageSerializedForm
(
List
<?>
elements
)
{
public
void
buildPackageSerializedForm
(
XMLNode
node
)
{
String
foo
=
currentPackage
.
name
();
ClassDoc
[]
classes
=
currentPackage
.
allClasses
(
false
);
if
(
classes
==
null
||
classes
.
length
==
0
)
{
...
...
@@ -184,14 +169,14 @@ public class SerializedFormBuilder extends AbstractBuilder {
if
(!
serialClassFoundToDocument
(
classes
))
{
return
;
}
build
(
elements
);
build
Children
(
node
);
}
public
void
buildPackageHeader
()
{
public
void
buildPackageHeader
(
XMLNode
node
)
{
writer
.
writePackageHeader
(
Util
.
getPackageName
(
currentPackage
));
}
public
void
buildClassSerializedForm
(
List
<?>
elements
)
{
public
void
buildClassSerializedForm
(
XMLNode
node
)
{
ClassDoc
[]
classes
=
currentPackage
.
allClasses
(
false
);
Arrays
.
sort
(
classes
);
for
(
int
j
=
0
;
j
<
classes
.
length
;
j
++)
{
...
...
@@ -202,19 +187,19 @@ public class SerializedFormBuilder extends AbstractBuilder {
if
(!
serialClassInclude
(
currentClass
))
{
continue
;
}
build
(
elements
);
build
Children
(
node
);
}
}
}
public
void
buildClassHeader
()
{
public
void
buildClassHeader
(
XMLNode
node
)
{
writer
.
writeClassHeader
(
currentClass
);
}
/**
* Build the serial UID information for the given class.
*/
public
void
buildSerialUIDInfo
()
{
public
void
buildSerialUIDInfo
(
XMLNode
node
)
{
FieldDoc
[]
fields
=
currentClass
.
fields
(
false
);
for
(
int
i
=
0
;
i
<
fields
.
length
;
i
++)
{
if
(
fields
[
i
].
name
().
equals
(
"serialVersionUID"
)
&&
...
...
@@ -229,7 +214,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
/**
* Build the footer.
*/
public
void
buildFooter
()
{
public
void
buildFooter
(
XMLNode
node
)
{
writer
.
writeFooter
();
}
...
...
@@ -316,7 +301,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
/**
* Build the method header.
*/
public
void
buildMethodHeader
()
{
public
void
buildMethodHeader
(
XMLNode
node
)
{
if
(
currentClass
.
serializationMethods
().
length
>
0
)
{
methodWriter
.
writeHeader
(
configuration
.
getText
(
"doclet.Serialized_Form_methods"
));
...
...
@@ -333,28 +318,28 @@ public class SerializedFormBuilder extends AbstractBuilder {
/**
* Build the method sub header.
*/
public
void
buildMethodSubHeader
()
{
public
void
buildMethodSubHeader
(
XMLNode
node
)
{
methodWriter
.
writeMemberHeader
((
MethodDoc
)
currentMember
);
}
/**
* Build the deprecated method description.
*/
public
void
buildDeprecatedMethodInfo
()
{
public
void
buildDeprecatedMethodInfo
(
XMLNode
node
)
{
methodWriter
.
writeDeprecatedMemberInfo
((
MethodDoc
)
currentMember
);
}
/**
* Build method tags.
*/
public
void
buildMethodDescription
()
{
public
void
buildMethodDescription
(
XMLNode
node
)
{
methodWriter
.
writeMemberDescription
((
MethodDoc
)
currentMember
);
}
/**
* Build the method tags.
*/
public
void
buildMethodTags
()
{
public
void
buildMethodTags
(
XMLNode
node
)
{
methodWriter
.
writeMemberTags
((
MethodDoc
)
currentMember
);
MethodDoc
method
=
(
MethodDoc
)
currentMember
;
if
(
method
.
name
().
compareTo
(
"writeExternal"
)
==
0
...
...
@@ -370,24 +355,24 @@ public class SerializedFormBuilder extends AbstractBuilder {
/**
* build the information for the method.
*/
public
void
buildMethodInfo
(
List
<?>
elements
)
{
public
void
buildMethodInfo
(
XMLNode
node
)
{
if
(
configuration
.
nocomment
){
return
;
}
build
(
elements
);
build
Children
(
node
);
}
/**
* Build the method footer.
*/
public
void
buildMethodFooter
()
{
public
void
buildMethodFooter
(
XMLNode
node
)
{
methodWriter
.
writeMemberFooter
();
}
/**
* Build the field header.
*/
public
void
buildFieldHeader
()
{
public
void
buildFieldHeader
(
XMLNode
node
)
{
if
(
currentClass
.
serializableFields
().
length
>
0
)
{
buildFieldSerializationOverview
(
currentClass
);
fieldWriter
.
writeHeader
(
configuration
.
getText
(
...
...
@@ -426,7 +411,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
/**
* Build the field sub header.
*/
public
void
buildFieldSubHeader
()
{
public
void
buildFieldSubHeader
(
XMLNode
node
)
{
if
(!
currentClass
.
definesSerializableFields
()
){
FieldDoc
field
=
(
FieldDoc
)
currentMember
;
fieldWriter
.
writeMemberHeader
(
field
.
type
().
asClassDoc
(),
...
...
@@ -437,7 +422,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
/**
* Build the field deprecation information.
*/
public
void
buildFieldDeprecationInfo
()
{
public
void
buildFieldDeprecationInfo
(
XMLNode
node
)
{
if
(!
currentClass
.
definesSerializableFields
())
{
FieldDoc
field
=
(
FieldDoc
)
currentMember
;
fieldWriter
.
writeMemberDeprecatedInfo
(
field
);
...
...
@@ -447,7 +432,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
/**
* Build the field information.
*/
public
void
buildFieldInfo
()
{
public
void
buildFieldInfo
(
XMLNode
node
)
{
if
(
configuration
.
nocomment
){
return
;
}
...
...
@@ -483,7 +468,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
/**
* Build the field sub footer.
*/
public
void
buildFieldSubFooter
()
{
public
void
buildFieldSubFooter
(
XMLNode
node
)
{
if
(!
currentClass
.
definesSerializableFields
())
{
fieldWriter
.
writeMemberFooter
();
}
...
...
@@ -493,12 +478,12 @@ public class SerializedFormBuilder extends AbstractBuilder {
* Build the summaries for the methods that belong to the given
* class.
*/
public
void
buildSerializableMethods
(
List
<?>
elements
)
{
public
void
buildSerializableMethods
(
XMLNode
node
)
{
MemberDoc
[]
members
=
currentClass
.
serializationMethods
();
if
(
members
.
length
>
0
)
{
for
(
int
i
=
0
;
i
<
members
.
length
;
i
++)
{
currentMember
=
members
[
i
];
build
(
elements
);
build
Children
(
node
);
}
}
}
...
...
@@ -507,12 +492,12 @@ public class SerializedFormBuilder extends AbstractBuilder {
* Build the summaries for the fields that belong to the given
* class.
*/
public
void
buildSerializableFields
(
List
<?>
elements
)
{
public
void
buildSerializableFields
(
XMLNode
node
)
{
MemberDoc
[]
members
=
currentClass
.
serializableFields
();
if
(
members
.
length
>
0
)
{
for
(
int
i
=
0
;
i
<
members
.
length
;
i
++)
{
currentMember
=
members
[
i
];
build
(
elements
);
build
Children
(
node
);
}
}
}
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/XMLNode.java
0 → 100644
浏览文件 @
8cf30206
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
com.sun.tools.doclets.internal.toolkit.builders
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* Simple class to represent the attribute and elements of an XML node.
*/
public
class
XMLNode
{
XMLNode
(
XMLNode
parent
,
String
qname
)
{
this
.
parent
=
parent
;
name
=
qname
;
attrs
=
new
HashMap
<
String
,
String
>();
children
=
new
ArrayList
<
XMLNode
>();
if
(
parent
!=
null
)
parent
.
children
.
add
(
this
);
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"<"
);
sb
.
append
(
name
);
for
(
Map
.
Entry
<
String
,
String
>
e:
attrs
.
entrySet
())
sb
.
append
(
" "
+
e
.
getKey
()
+
"=\""
+
e
.
getValue
()
+
"\""
);
if
(
children
.
size
()
==
0
)
sb
.
append
(
"/>"
);
else
{
sb
.
append
(
">"
);
for
(
XMLNode
c:
children
)
sb
.
append
(
c
.
toString
());
sb
.
append
(
"</"
+
name
+
">"
);
}
return
sb
.
toString
();
}
final
XMLNode
parent
;
final
String
name
;
final
Map
<
String
,
String
>
attrs
;
final
List
<
XMLNode
>
children
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录