Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
e904244f
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看板
提交
e904244f
编写于
5月 14, 2013
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8011642: Remove LinkOutput in favor of direct use of Content
Reviewed-by: bpatel, darcy
上级
cc56c8b6
变更
33
隐藏空白更改
内联
并排
Showing
33 changed file
with
343 addition
and
297 deletion
+343
-297
src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java
.../doclets/formats/html/AbstractExecutableMemberWriter.java
+13
-13
src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java
...m/sun/tools/doclets/formats/html/AbstractIndexWriter.java
+3
-4
src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java
.../sun/tools/doclets/formats/html/AbstractMemberWriter.java
+4
-4
src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java
...sun/tools/doclets/formats/html/AllClassesFrameWriter.java
+4
-4
src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
.../formats/html/AnnotationTypeRequiredMemberWriterImpl.java
+4
-4
src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java
.../tools/doclets/formats/html/AnnotationTypeWriterImpl.java
+6
-6
src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java
...es/com/sun/tools/doclets/formats/html/ClassUseWriter.java
+8
-8
src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
...s/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
+21
-21
src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java
...ools/doclets/formats/html/ConstantsSummaryWriterImpl.java
+5
-5
src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java
...un/tools/doclets/formats/html/EnumConstantWriterImpl.java
+4
-4
src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java
...s/com/sun/tools/doclets/formats/html/FieldWriterImpl.java
+8
-8
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
.../com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
+25
-25
src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java
...sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java
...s/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java
+31
-29
src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java
.../com/sun/tools/doclets/formats/html/MethodWriterImpl.java
+12
-12
src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java
...sun/tools/doclets/formats/html/NestedClassWriterImpl.java
+4
-5
src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java
...om/sun/tools/doclets/formats/html/PackageFrameWriter.java
+3
-3
src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java
...com/sun/tools/doclets/formats/html/PackageTreeWriter.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java
.../com/sun/tools/doclets/formats/html/PackageUseWriter.java
+5
-5
src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java
...com/sun/tools/doclets/formats/html/PackageWriterImpl.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java
...tools/doclets/formats/html/ProfilePackageFrameWriter.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java
...om/sun/tools/doclets/formats/html/PropertyWriterImpl.java
+8
-8
src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java
.../tools/doclets/formats/html/SerializedFormWriterImpl.java
+3
-3
src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java
.../com/sun/tools/doclets/formats/html/TagletWriterImpl.java
+3
-3
src/share/classes/com/sun/tools/doclets/formats/html/markup/ContentBuilder.java
...sun/tools/doclets/formats/html/markup/ContentBuilder.java
+88
-0
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
...s/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
...com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
+1
-1
src/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java
...asses/com/sun/tools/doclets/internal/toolkit/Content.java
+1
-29
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java
...lets/internal/toolkit/builders/PackageSummaryBuilder.java
+1
-1
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocletConstants.java
.../tools/doclets/internal/toolkit/util/DocletConstants.java
+2
-2
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkFactory.java
...ools/doclets/internal/toolkit/util/links/LinkFactory.java
+60
-74
test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java
...adoc/testNewLanguageFeatures/TestNewLanguageFeatures.java
+3
-3
test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java
.../sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java
+3
-3
未找到文件。
src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java
浏览文件 @
e904244f
...
...
@@ -63,9 +63,9 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
protected
int
addTypeParameters
(
ExecutableMemberDoc
member
,
Content
htmltree
)
{
LinkInfoImpl
linkInfo
=
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER_TYPE_PARAMS
,
member
,
false
);
String
typeParameters
=
writer
.
getTypeParameterLinks
(
linkInfo
);
Content
typeParameters
=
writer
.
getTypeParameterLinks
(
linkInfo
);
if
(
linkInfo
.
displayLength
>
0
)
{
Content
linkContent
=
new
RawHtml
(
typeParameters
)
;
Content
linkContent
=
typeParameters
;
htmltree
.
addContent
(
linkContent
);
htmltree
.
addContent
(
writer
.
getSpace
());
writer
.
displayLength
+=
linkInfo
.
displayLength
+
1
;
...
...
@@ -94,9 +94,9 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
Content
tdSummary
)
{
ExecutableMemberDoc
emd
=
(
ExecutableMemberDoc
)
member
;
String
name
=
emd
.
name
();
Content
strong
=
HtmlTree
.
STRONG
(
new
RawHtml
(
Content
strong
=
HtmlTree
.
STRONG
(
writer
.
getDocLink
(
context
,
cd
,
(
MemberDoc
)
emd
,
name
,
false
))
)
;
name
,
false
));
Content
code
=
HtmlTree
.
CODE
(
strong
);
writer
.
displayLength
=
name
.
length
();
addParameters
(
emd
,
false
,
code
);
...
...
@@ -112,9 +112,9 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
*/
protected
void
addInheritedSummaryLink
(
ClassDoc
cd
,
ProgramElementDoc
member
,
Content
linksTree
)
{
linksTree
.
addContent
(
new
RawHtml
(
linksTree
.
addContent
(
writer
.
getDocLink
(
LinkInfoImpl
.
Kind
.
MEMBER
,
cd
,
(
MemberDoc
)
member
,
member
.
name
(),
false
))
)
;
member
.
name
(),
false
));
}
/**
...
...
@@ -128,9 +128,9 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
protected
void
addParam
(
ExecutableMemberDoc
member
,
Parameter
param
,
boolean
isVarArg
,
Content
tree
)
{
if
(
param
.
type
()
!=
null
)
{
Content
link
=
new
RawHtml
(
writer
.
getLink
(
new
LinkInfoImpl
(
Content
link
=
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
EXECUTABLE_MEMBER_PARAM
,
param
.
type
(),
isVarArg
))
)
;
param
.
type
(),
isVarArg
));
tree
.
addContent
(
link
);
}
if
(
param
.
name
().
length
()
>
0
)
{
...
...
@@ -154,7 +154,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
tree
.
addContent
(
rcvrType
.
typeName
());
LinkInfoImpl
linkInfo
=
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS_SIGNATURE
,
rcvrType
);
tree
.
addContent
(
new
RawHtml
(
writer
.
getTypeParameterLinks
(
linkInfo
)
));
tree
.
addContent
(
writer
.
getTypeParameterLinks
(
linkInfo
));
tree
.
addContent
(
writer
.
getSpace
());
tree
.
addContent
(
"this"
);
}
...
...
@@ -255,15 +255,15 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
htmltree
.
addContent
(
indent
);
htmltree
.
addContent
(
"throws "
);
indent
+=
" "
;
Content
link
=
new
RawHtml
(
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
exceptions
[
0
]))
)
;
Content
link
=
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
exceptions
[
0
]));
htmltree
.
addContent
(
link
);
for
(
int
i
=
1
;
i
<
exceptions
.
length
;
i
++)
{
htmltree
.
addContent
(
","
);
htmltree
.
addContent
(
DocletConstants
.
NL
);
htmltree
.
addContent
(
indent
);
Content
exceptionLink
=
new
RawHtml
(
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
exceptions
[
i
]))
)
;
Content
exceptionLink
=
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
exceptions
[
i
]));
htmltree
.
addContent
(
exceptionLink
);
}
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java
浏览文件 @
e904244f
...
...
@@ -139,9 +139,8 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
* @param dlTree the content tree to which the description will be added
*/
protected
void
addDescription
(
ClassDoc
cd
,
Content
dlTree
)
{
Content
link
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
INDEX
,
cd
,
true
)));
Content
link
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
INDEX
,
cd
,
true
));
Content
dt
=
HtmlTree
.
DT
(
link
);
dt
.
addContent
(
" - "
);
addClassInfo
(
cd
,
dt
);
...
...
@@ -162,7 +161,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
contentTree
.
addContent
(
getResource
(
"doclet.in"
,
Util
.
getTypeName
(
configuration
,
cd
,
false
),
getPackageLinkString
(
cd
.
containingPackage
(),
Util
.
getPackageName
(
cd
.
containingPackage
(
)),
false
)));
Util
.
escapeHtmlChars
(
Util
.
getPackageName
(
cd
.
containingPackage
()
)),
false
)));
}
/**
...
...
src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java
浏览文件 @
e904244f
...
...
@@ -292,13 +292,13 @@ public abstract class AbstractMemberWriter {
if
(
displayLength
>
10
)
{
code
.
addContent
(
new
HtmlTree
(
HtmlTag
.
BR
));
}
code
.
addContent
(
new
RawHtml
(
code
.
addContent
(
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
SUMMARY_RETURN_TYPE
,
type
)))
)
;
LinkInfoImpl
.
Kind
.
SUMMARY_RETURN_TYPE
,
type
)));
}
else
{
code
.
addContent
(
new
RawHtml
(
code
.
addContent
(
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
SUMMARY_RETURN_TYPE
,
type
)))
)
;
LinkInfoImpl
.
Kind
.
SUMMARY_RETURN_TYPE
,
type
)));
}
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java
浏览文件 @
e904244f
...
...
@@ -159,11 +159,11 @@ public class AllClassesFrameWriter extends HtmlDocletWriter {
String
label
=
italicsClassName
(
cd
,
false
);
Content
linkContent
;
if
(
wantFrames
){
linkContent
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
ALL_CLASSES_FRAME
,
cd
,
label
,
"classFrame"
))
)
;
linkContent
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
ALL_CLASSES_FRAME
,
cd
,
label
,
"classFrame"
));
}
else
{
linkContent
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
cd
,
label
))
)
;
linkContent
=
getLink
(
new
LinkInfoImpl
(
configuration
,
cd
,
label
));
}
Content
li
=
HtmlTree
.
LI
(
linkContent
);
content
.
addContent
(
li
);
...
...
src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
浏览文件 @
e904244f
...
...
@@ -105,9 +105,9 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
Content
pre
=
new
HtmlTree
(
HtmlTag
.
PRE
);
writer
.
addAnnotationInfo
(
member
,
pre
);
addModifiers
(
member
,
pre
);
Content
link
=
new
RawHtml
(
Content
link
=
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
getType
(
member
)))
)
;
LinkInfoImpl
.
Kind
.
MEMBER
,
getType
(
member
)));
pre
.
addContent
(
link
);
pre
.
addContent
(
writer
.
getSpace
());
if
(
configuration
.
linksource
)
{
...
...
@@ -225,8 +225,8 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
*/
protected
void
addSummaryLink
(
LinkInfoImpl
.
Kind
context
,
ClassDoc
cd
,
ProgramElementDoc
member
,
Content
tdSummary
)
{
Content
strong
=
HtmlTree
.
STRONG
(
new
RawHtml
(
writer
.
getDocLink
(
context
,
(
MemberDoc
)
member
,
member
.
name
(),
false
))
)
;
Content
strong
=
HtmlTree
.
STRONG
(
writer
.
getDocLink
(
context
,
(
MemberDoc
)
member
,
member
.
name
(),
false
));
Content
code
=
HtmlTree
.
CODE
(
strong
);
tdSummary
.
addContent
(
code
);
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java
浏览文件 @
e904244f
...
...
@@ -116,9 +116,9 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
public
Content
getNavLinkPrevious
()
{
Content
li
;
if
(
prev
!=
null
)
{
Content
prevLink
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
Content
prevLink
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS
,
prev
.
asClassDoc
(),
""
,
configuration
.
getText
(
"doclet.Prev_Class"
),
true
))
)
;
configuration
.
getText
(
"doclet.Prev_Class"
),
true
));
li
=
HtmlTree
.
LI
(
prevLink
);
}
else
...
...
@@ -134,9 +134,9 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
public
Content
getNavLinkNext
()
{
Content
li
;
if
(
next
!=
null
)
{
Content
nextLink
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
Content
nextLink
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS
,
next
.
asClassDoc
(),
""
,
configuration
.
getText
(
"doclet.Next_Class"
),
true
))
)
;
configuration
.
getText
(
"doclet.Next_Class"
),
true
));
li
=
HtmlTree
.
LI
(
nextLink
);
}
else
...
...
@@ -167,7 +167,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
Content
headerContent
=
new
StringContent
(
header
);
Content
heading
=
HtmlTree
.
HEADING
(
HtmlConstants
.
CLASS_PAGE_HEADING
,
true
,
HtmlStyle
.
title
,
headerContent
);
heading
.
addContent
(
new
RawHtml
(
getTypeParameterLinks
(
linkInfo
)
));
heading
.
addContent
(
getTypeParameterLinks
(
linkInfo
));
div
.
addContent
(
heading
);
bodyTree
.
addContent
(
div
);
return
bodyTree
;
...
...
@@ -222,7 +222,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
LinkInfoImpl
linkInfo
=
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS_SIGNATURE
,
annotationType
,
false
);
Content
annotationName
=
new
StringContent
(
annotationType
.
name
());
Content
parameterLinks
=
new
RawHtml
(
getTypeParameterLinks
(
linkInfo
)
);
Content
parameterLinks
=
getTypeParameterLinks
(
linkInfo
);
if
(
configuration
.
linksource
)
{
addSrcLink
(
annotationType
,
annotationName
,
pre
);
pre
.
addContent
(
parameterLinks
);
...
...
src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java
浏览文件 @
e904244f
...
...
@@ -259,7 +259,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
getTableCaption
(
configuration
.
getText
(
"doclet.ClassUse_Packages.that.use.0"
,
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS_USE_HEADER
,
classdoc
,
false
)))));
false
))
.
toString
()
)));
table
.
addContent
(
getSummaryTableHeader
(
packageTableHeader
,
"col"
));
Content
tbody
=
new
HtmlTree
(
HtmlTag
.
TBODY
);
Iterator
<
PackageDoc
>
it
=
pkgSet
.
iterator
();
...
...
@@ -294,7 +294,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
getTableCaption
(
configuration
.
getText
(
"doclet.ClassUse_PackageAnnotation"
,
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS_USE_HEADER
,
classdoc
,
false
)))));
LinkInfoImpl
.
Kind
.
CLASS_USE_HEADER
,
classdoc
,
false
))
.
toString
()
)));
table
.
addContent
(
getSummaryTableHeader
(
packageTableHeader
,
"col"
));
Content
tbody
=
new
HtmlTree
(
HtmlTag
.
TBODY
);
Iterator
<
PackageDoc
>
it
=
pkgToPackageAnnotations
.
iterator
();
...
...
@@ -334,8 +334,8 @@ public class ClassUseWriter extends SubWriterHolderWriter {
Content
link
=
new
RawHtml
(
configuration
.
getText
(
"doclet.ClassUse_Uses.of.0.in.1"
,
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS_USE_HEADER
,
classdoc
,
false
)),
getPackageLinkString
(
pkg
,
Util
.
getPackageName
(
pkg
),
false
)));
classdoc
,
false
))
.
toString
()
,
getPackageLinkString
(
pkg
,
Util
.
escapeHtmlChars
(
Util
.
getPackageName
(
pkg
)
),
false
)));
Content
heading
=
HtmlTree
.
HEADING
(
HtmlConstants
.
SUMMARY_HEADING
,
link
);
li
.
addContent
(
heading
);
addClassUse
(
pkg
,
li
);
...
...
@@ -369,8 +369,8 @@ public class ClassUseWriter extends SubWriterHolderWriter {
*/
protected
void
addClassUse
(
PackageDoc
pkg
,
Content
contentTree
)
throws
IOException
{
String
classLink
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS_USE_HEADER
,
classdoc
,
false
));
String
pkgLink
=
getPackageLinkString
(
pkg
,
Util
.
getPackageName
(
pkg
),
false
);
LinkInfoImpl
.
Kind
.
CLASS_USE_HEADER
,
classdoc
,
false
))
.
toString
()
;
String
pkgLink
=
getPackageLinkString
(
pkg
,
Util
.
escapeHtmlChars
(
Util
.
getPackageName
(
pkg
)
),
false
);
classSubWriter
.
addUseInfo
(
pkgToClassAnnotations
.
get
(
pkg
.
name
()),
configuration
.
getText
(
"doclet.ClassUse_Annotation"
,
classLink
,
pkgLink
),
classUseTableSummary
,
contentTree
);
...
...
@@ -476,9 +476,9 @@ public class ClassUseWriter extends SubWriterHolderWriter {
* @return a content tree for the class page link
*/
protected
Content
getNavLinkClass
()
{
Content
linkContent
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
Content
linkContent
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS_USE_HEADER
,
classdoc
,
""
,
configuration
.
getText
(
"doclet.Class"
),
false
))
)
;
""
,
configuration
.
getText
(
"doclet.Class"
),
false
));
Content
li
=
HtmlTree
.
LI
(
linkContent
);
return
li
;
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
浏览文件 @
e904244f
...
...
@@ -124,9 +124,9 @@ public class ClassWriterImpl extends SubWriterHolderWriter
public
Content
getNavLinkPrevious
()
{
Content
li
;
if
(
prev
!=
null
)
{
Content
prevLink
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
Content
prevLink
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS
,
prev
,
""
,
configuration
.
getText
(
"doclet.Prev_Class"
),
true
))
)
;
configuration
.
getText
(
"doclet.Prev_Class"
),
true
));
li
=
HtmlTree
.
LI
(
prevLink
);
}
else
...
...
@@ -142,9 +142,9 @@ public class ClassWriterImpl extends SubWriterHolderWriter
public
Content
getNavLinkNext
()
{
Content
li
;
if
(
next
!=
null
)
{
Content
nextLink
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
Content
nextLink
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS
,
next
,
""
,
configuration
.
getText
(
"doclet.Next_Class"
),
true
))
)
;
configuration
.
getText
(
"doclet.Next_Class"
),
true
));
li
=
HtmlTree
.
LI
(
nextLink
);
}
else
...
...
@@ -191,7 +191,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
Content
headerContent
=
new
StringContent
(
header
);
Content
heading
=
HtmlTree
.
HEADING
(
HtmlConstants
.
CLASS_PAGE_HEADING
,
true
,
HtmlStyle
.
title
,
headerContent
);
heading
.
addContent
(
new
RawHtml
(
getTypeParameterLinks
(
linkInfo
)
));
heading
.
addContent
(
getTypeParameterLinks
(
linkInfo
));
div
.
addContent
(
heading
);
bodyTree
.
addContent
(
div
);
return
bodyTree
;
...
...
@@ -249,7 +249,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
//Let's not link to ourselves in the signature.
linkInfo
.
linkToSelf
=
false
;
Content
className
=
new
StringContent
(
classDoc
.
name
());
Content
parameterLinks
=
new
RawHtml
(
getTypeParameterLinks
(
linkInfo
)
);
Content
parameterLinks
=
getTypeParameterLinks
(
linkInfo
);
if
(
configuration
.
linksource
)
{
addSrcLink
(
classDoc
,
className
,
pre
);
pre
.
addContent
(
parameterLinks
);
...
...
@@ -264,9 +264,9 @@ public class ClassWriterImpl extends SubWriterHolderWriter
if
(
superclass
!=
null
)
{
pre
.
addContent
(
DocletConstants
.
NL
);
pre
.
addContent
(
"extends "
);
Content
link
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
Content
link
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS_SIGNATURE_PARENT_NAME
,
superclass
))
)
;
superclass
));
pre
.
addContent
(
link
);
}
}
...
...
@@ -285,9 +285,9 @@ public class ClassWriterImpl extends SubWriterHolderWriter
}
else
{
pre
.
addContent
(
", "
);
}
Content
link
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
Content
link
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS_SIGNATURE_PARENT_NAME
,
implIntfacs
[
i
]))
)
;
implIntfacs
[
i
]));
pre
.
addContent
(
link
);
counter
++;
}
...
...
@@ -360,22 +360,22 @@ public class ClassWriterImpl extends SubWriterHolderWriter
private
Content
getTreeForClassHelper
(
Type
type
)
{
Content
li
=
new
HtmlTree
(
HtmlTag
.
LI
);
if
(
type
.
equals
(
classDoc
))
{
String
typeParameters
=
getTypeParameterLinks
(
Content
typeParameters
=
getTypeParameterLinks
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
TREE
,
classDoc
,
false
));
if
(
configuration
.
shouldExcludeQualifier
(
classDoc
.
containingPackage
().
name
()))
{
li
.
addContent
(
type
.
asClassDoc
().
name
());
li
.
addContent
(
new
RawHtml
(
typeParameters
)
);
li
.
addContent
(
typeParameters
);
}
else
{
li
.
addContent
(
type
.
asClassDoc
().
qualifiedName
());
li
.
addContent
(
new
RawHtml
(
typeParameters
)
);
li
.
addContent
(
typeParameters
);
}
}
else
{
Content
link
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
Content
link
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS_TREE_PARENT
,
type
instanceof
ClassDoc
?
(
ClassDoc
)
type
:
type
,
configuration
.
getClassName
(
type
.
asClassDoc
()),
false
))
)
;
configuration
.
getClassName
(
type
.
asClassDoc
()),
false
));
li
.
addContent
(
link
);
}
return
li
;
...
...
@@ -520,8 +520,8 @@ public class ClassWriterImpl extends SubWriterHolderWriter
Content
dt
=
HtmlTree
.
DT
(
label
);
Content
dl
=
HtmlTree
.
DL
(
dt
);
Content
dd
=
new
HtmlTree
(
HtmlTag
.
DD
);
dd
.
addContent
(
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS
,
outerClass
,
false
)))
)
;
dd
.
addContent
(
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CLASS
,
outerClass
,
false
)));
dl
.
addContent
(
dd
);
classInfoTree
.
addContent
(
dl
);
}
...
...
@@ -578,12 +578,12 @@ public class ClassWriterImpl extends SubWriterHolderWriter
dd
.
addContent
(
separator
);
}
if
(
typeList
[
i
]
instanceof
ClassDoc
)
{
Content
link
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
(
ClassDoc
)(
typeList
[
i
])))
)
;
Content
link
=
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
(
ClassDoc
)(
typeList
[
i
])));
dd
.
addContent
(
link
);
}
else
{
Content
link
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
(
Type
)(
typeList
[
i
])))
)
;
Content
link
=
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
(
Type
)(
typeList
[
i
])));
dd
.
addContent
(
link
);
}
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java
浏览文件 @
e904244f
...
...
@@ -186,7 +186,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
//generate links backward only to public classes.
String
classlink
=
(
cd
.
isPublic
()
||
cd
.
isProtected
())
?
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CONSTANT_SUMMARY
,
cd
,
false
))
:
LinkInfoImpl
.
Kind
.
CONSTANT_SUMMARY
,
cd
,
false
))
.
toString
()
:
cd
.
qualifiedName
();
String
name
=
cd
.
containingPackage
().
name
();
if
(
name
.
length
()
>
0
)
{
...
...
@@ -260,8 +260,8 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
code
.
addContent
(
modifier
);
code
.
addContent
(
getSpace
());
}
Content
type
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CONSTANT_SUMMARY
,
member
.
type
()))
)
;
Content
type
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
CONSTANT_SUMMARY
,
member
.
type
()));
code
.
addContent
(
type
);
tdType
.
addContent
(
code
);
return
tdType
;
...
...
@@ -274,8 +274,8 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
* @return the name column of the constant table row
*/
private
Content
getNameColumn
(
FieldDoc
member
)
{
Content
nameContent
=
new
RawHtml
(
getDocLink
(
LinkInfoImpl
.
Kind
.
CONSTANT_SUMMARY
,
member
,
member
.
name
(),
false
)
)
;
Content
nameContent
=
getDocLink
(
LinkInfoImpl
.
Kind
.
CONSTANT_SUMMARY
,
member
,
member
.
name
(),
false
);
Content
code
=
HtmlTree
.
CODE
(
nameContent
);
return
HtmlTree
.
TD
(
code
);
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java
浏览文件 @
e904244f
...
...
@@ -101,8 +101,8 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
Content
pre
=
new
HtmlTree
(
HtmlTag
.
PRE
);
writer
.
addAnnotationInfo
(
enumConstant
,
pre
);
addModifiers
(
enumConstant
,
pre
);
Content
enumConstantLink
=
new
RawHtml
(
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
enumConstant
.
type
()))
)
;
Content
enumConstantLink
=
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
enumConstant
.
type
()));
pre
.
addContent
(
enumConstantLink
);
pre
.
addContent
(
" "
);
if
(
configuration
.
linksource
)
{
...
...
@@ -222,8 +222,8 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
*/
protected
void
addSummaryLink
(
LinkInfoImpl
.
Kind
context
,
ClassDoc
cd
,
ProgramElementDoc
member
,
Content
tdSummary
)
{
Content
strong
=
HtmlTree
.
STRONG
(
new
RawHtml
(
writer
.
getDocLink
(
context
,
(
MemberDoc
)
member
,
member
.
name
(),
false
))
)
;
Content
strong
=
HtmlTree
.
STRONG
(
writer
.
getDocLink
(
context
,
(
MemberDoc
)
member
,
member
.
name
(),
false
));
Content
code
=
HtmlTree
.
CODE
(
strong
);
tdSummary
.
addContent
(
code
);
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java
浏览文件 @
e904244f
...
...
@@ -102,8 +102,8 @@ public class FieldWriterImpl extends AbstractMemberWriter
Content
pre
=
new
HtmlTree
(
HtmlTag
.
PRE
);
writer
.
addAnnotationInfo
(
field
,
pre
);
addModifiers
(
field
,
pre
);
Content
fieldlink
=
new
RawHtml
(
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
field
.
type
()))
)
;
Content
fieldlink
=
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
field
.
type
()));
pre
.
addContent
(
fieldlink
);
pre
.
addContent
(
" "
);
if
(
configuration
.
linksource
)
{
...
...
@@ -132,12 +132,12 @@ public class FieldWriterImpl extends AbstractMemberWriter
(!
(
holder
.
isPublic
()
||
Util
.
isLinkable
(
holder
,
configuration
))))
{
writer
.
addInlineComment
(
field
,
fieldDocTree
);
}
else
{
Content
link
=
new
RawHtml
(
Content
link
=
writer
.
getDocLink
(
LinkInfoImpl
.
Kind
.
FIELD_DOC_COPY
,
holder
,
field
,
holder
.
isIncluded
()
?
holder
.
typeName
()
:
holder
.
qualifiedTypeName
(),
false
)
)
;
false
);
Content
codeLink
=
HtmlTree
.
CODE
(
link
);
Content
strong
=
HtmlTree
.
STRONG
(
holder
.
isClass
()?
writer
.
descfrmClassLabel
:
writer
.
descfrmInterfaceLabel
);
...
...
@@ -256,8 +256,8 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/
protected
void
addSummaryLink
(
LinkInfoImpl
.
Kind
context
,
ClassDoc
cd
,
ProgramElementDoc
member
,
Content
tdSummary
)
{
Content
strong
=
HtmlTree
.
STRONG
(
new
RawHtml
(
writer
.
getDocLink
(
context
,
cd
,
(
MemberDoc
)
member
,
member
.
name
(),
false
))
)
;
Content
strong
=
HtmlTree
.
STRONG
(
writer
.
getDocLink
(
context
,
cd
,
(
MemberDoc
)
member
,
member
.
name
(),
false
));
Content
code
=
HtmlTree
.
CODE
(
strong
);
tdSummary
.
addContent
(
code
);
}
...
...
@@ -267,9 +267,9 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/
protected
void
addInheritedSummaryLink
(
ClassDoc
cd
,
ProgramElementDoc
member
,
Content
linksTree
)
{
linksTree
.
addContent
(
new
RawHtml
(
linksTree
.
addContent
(
writer
.
getDocLink
(
LinkInfoImpl
.
Kind
.
MEMBER
,
cd
,
(
MemberDoc
)
member
,
member
.
name
(),
false
))
)
;
member
.
name
(),
false
));
}
/**
...
...
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
浏览文件 @
e904244f
...
...
@@ -372,9 +372,9 @@ public class HtmlDocletWriter extends HtmlDocWriter {
!
configuration
.
isGeneratedDoc
(
classes
[
i
]))
{
continue
;
}
Content
classContent
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
Content
classContent
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
PACKAGE
,
classes
[
i
],
false
))
)
;
false
));
Content
tdClass
=
HtmlTree
.
TD
(
HtmlStyle
.
colFirst
,
classContent
);
HtmlTree
tr
=
HtmlTree
.
TR
(
tdClass
);
if
(
i
%
2
==
0
)
...
...
@@ -1109,9 +1109,9 @@ public class HtmlDocletWriter extends HtmlDocWriter {
*
* @return the link for the given class.
*/
public
String
getLink
(
LinkInfoImpl
linkInfo
)
{
public
Content
getLink
(
LinkInfoImpl
linkInfo
)
{
LinkFactoryImpl
factory
=
new
LinkFactoryImpl
(
this
);
String
link
=
factory
.
getLinkOutput
(
linkInfo
).
toString
(
);
Content
link
=
factory
.
getLink
(
linkInfo
);
displayLength
+=
linkInfo
.
displayLength
;
return
link
;
}
...
...
@@ -1122,9 +1122,9 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param linkInfo the information about the link.
* @return the type for the given class.
*/
public
String
getTypeParameterLinks
(
LinkInfoImpl
linkInfo
)
{
public
Content
getTypeParameterLinks
(
LinkInfoImpl
linkInfo
)
{
LinkFactoryImpl
factory
=
new
LinkFactoryImpl
(
this
);
return
factory
.
getTypeParameterLinks
(
linkInfo
,
false
)
.
toString
()
;
return
factory
.
getTypeParameterLinks
(
linkInfo
,
false
);
}
/*************************************************************
...
...
@@ -1192,8 +1192,8 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @return a content tree for the link
*/
public
Content
getQualifiedClassLink
(
LinkInfoImpl
.
Kind
context
,
ClassDoc
cd
)
{
return
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
cd
,
configuration
.
getClassName
(
cd
),
""
))
)
;
return
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
cd
,
configuration
.
getClassName
(
cd
),
""
));
}
/**
...
...
@@ -1244,8 +1244,8 @@ public class HtmlDocletWriter extends HtmlDocWriter {
if
(
pd
!=
null
&&
!
configuration
.
shouldExcludeQualifier
(
pd
.
name
()))
{
contentTree
.
addContent
(
getPkgName
(
cd
));
}
contentTree
.
addContent
(
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
cd
,
cd
.
name
(),
isStrong
)))
)
;
contentTree
.
addContent
(
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
cd
,
cd
.
name
(),
isStrong
)));
}
/**
...
...
@@ -1281,8 +1281,8 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param strong true if the link should be strong.
* @return the link for the given member.
*/
public
String
getDocLink
(
LinkInfoImpl
.
Kind
context
,
MemberDoc
doc
,
String
label
,
boolean
strong
)
{
public
Content
getDocLink
(
LinkInfoImpl
.
Kind
context
,
MemberDoc
doc
,
String
label
,
boolean
strong
)
{
return
getDocLink
(
context
,
doc
.
containingClass
(),
doc
,
label
,
strong
);
}
...
...
@@ -1298,8 +1298,8 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param strong true if the link should be strong.
* @return the link for the given member.
*/
public
String
getDocLink
(
LinkInfoImpl
.
Kind
context
,
ClassDoc
classDoc
,
MemberDoc
doc
,
String
label
,
boolean
strong
)
{
public
Content
getDocLink
(
LinkInfoImpl
.
Kind
context
,
ClassDoc
classDoc
,
MemberDoc
doc
,
String
label
,
boolean
strong
)
{
return
getDocLink
(
context
,
classDoc
,
doc
,
label
,
strong
,
false
);
}
...
...
@@ -1316,11 +1316,11 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param isProperty true if the doc parameter is a JavaFX property.
* @return the link for the given member.
*/
public
String
getDocLink
(
LinkInfoImpl
.
Kind
context
,
ClassDoc
classDoc
,
MemberDoc
doc
,
public
Content
getDocLink
(
LinkInfoImpl
.
Kind
context
,
ClassDoc
classDoc
,
MemberDoc
doc
,
String
label
,
boolean
strong
,
boolean
isProperty
)
{
if
(!
(
doc
.
isIncluded
()
||
Util
.
isLinkable
(
classDoc
,
configuration
)))
{
return
label
;
return
new
RawHtml
(
label
)
;
}
else
if
(
doc
instanceof
ExecutableMemberDoc
)
{
ExecutableMemberDoc
emd
=
(
ExecutableMemberDoc
)
doc
;
return
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
classDoc
,
...
...
@@ -1329,7 +1329,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
return
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
classDoc
,
doc
.
name
(),
label
,
strong
));
}
else
{
return
label
;
return
new
RawHtml
(
label
)
;
}
}
...
...
@@ -1351,11 +1351,11 @@ public class HtmlDocletWriter extends HtmlDocWriter {
return
new
StringContent
(
label
);
}
else
if
(
doc
instanceof
ExecutableMemberDoc
)
{
ExecutableMemberDoc
emd
=
(
ExecutableMemberDoc
)
doc
;
return
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
classDoc
,
getAnchor
(
emd
),
label
,
false
))
)
;
return
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
classDoc
,
getAnchor
(
emd
),
label
,
false
));
}
else
if
(
doc
instanceof
MemberDoc
)
{
return
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
classDoc
,
doc
.
name
(),
label
,
false
))
)
;
return
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
classDoc
,
doc
.
name
(),
label
,
false
));
}
else
{
return
new
StringContent
(
label
);
}
...
...
@@ -1441,7 +1441,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
if
(
label
.
isEmpty
())
{
label
=
plainOrCodeText
(
plain
,
refClass
.
name
());
}
return
getLink
(
new
LinkInfoImpl
(
configuration
,
refClass
,
label
));
return
getLink
(
new
LinkInfoImpl
(
configuration
,
refClass
,
label
))
.
toString
()
;
}
else
if
(
refMem
==
null
)
{
// Must be a member reference since refClass is not null and refMemName is not null.
// However, refMem is null, so this referenced member does not exist.
...
...
@@ -1481,7 +1481,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
text
=
plainOrCodeText
(
plain
,
Util
.
escapeHtmlChars
(
refMemName
));
return
getDocLink
(
LinkInfoImpl
.
Kind
.
SEE_TAG
,
containing
,
refMem
,
(
label
.
isEmpty
()
?
text:
label
),
false
);
refMem
,
(
label
.
isEmpty
()
?
text:
label
),
false
)
.
toString
()
;
}
}
...
...
@@ -2147,7 +2147,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
linkInfo
.
label
=
(
type
.
asClassDoc
().
isIncluded
()
?
type
.
typeName
()
:
type
.
qualifiedTypeName
())
+
type
.
dimension
()
+
".class"
;
return
getLink
(
linkInfo
);
return
getLink
(
linkInfo
)
.
toString
()
;
}
else
{
return
type
.
typeName
()
+
type
.
dimension
()
+
".class"
;
}
...
...
@@ -2163,7 +2163,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
}
else
if
(
annotationValue
.
value
()
instanceof
MemberDoc
)
{
return
getDocLink
(
LinkInfoImpl
.
Kind
.
ANNOTATION
,
(
MemberDoc
)
annotationValue
.
value
(),
((
MemberDoc
)
annotationValue
.
value
()).
name
(),
false
);
((
MemberDoc
)
annotationValue
.
value
()).
name
(),
false
)
.
toString
()
;
}
else
{
return
annotationValue
.
toString
();
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java
浏览文件 @
e904244f
...
...
@@ -129,8 +129,8 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
if
(
fieldType
==
null
)
{
pre
.
addContent
(
fieldTypeStr
);
}
else
{
Content
fieldContent
=
new
RawHtml
(
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
SERIAL_MEMBER
,
fieldType
))
)
;
Content
fieldContent
=
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
SERIAL_MEMBER
,
fieldType
));
pre
.
addContent
(
fieldContent
);
}
pre
.
addContent
(
fieldDimensions
+
" "
);
...
...
src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java
浏览文件 @
e904244f
...
...
@@ -28,6 +28,8 @@ package com.sun.tools.doclets.formats.html;
import
java.util.List
;
import
com.sun.javadoc.*
;
import
com.sun.tools.doclets.formats.html.markup.ContentBuilder
;
import
com.sun.tools.doclets.formats.html.markup.RawHtml
;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.tools.doclets.internal.toolkit.util.*
;
import
com.sun.tools.doclets.internal.toolkit.util.links.*
;
...
...
@@ -54,14 +56,14 @@ public class LinkFactoryImpl extends LinkFactory {
/**
* {@inheritDoc}
*/
protected
LinkOutput
getOutputInstance
()
{
return
new
LinkOutputImpl
();
protected
Content
newContent
()
{
return
new
ContentBuilder
();
}
/**
* {@inheritDoc}
*/
protected
LinkOutpu
t
getClassLink
(
LinkInfo
linkInfo
)
{
protected
Conten
t
getClassLink
(
LinkInfo
linkInfo
)
{
LinkInfoImpl
classLinkInfo
=
(
LinkInfoImpl
)
linkInfo
;
boolean
noLabel
=
linkInfo
.
label
==
null
||
linkInfo
.
label
.
length
()
==
0
;
ClassDoc
classDoc
=
classLinkInfo
.
classDoc
;
...
...
@@ -77,21 +79,21 @@ public class LinkFactoryImpl extends LinkFactory {
classLinkInfo
.
getClassLinkLabel
(
m_writer
.
configuration
));
classLinkInfo
.
displayLength
+=
label
.
length
();
Configuration
configuration
=
m_writer
.
configuration
;
LinkOutputImpl
linkOutput
=
new
LinkOutputImpl
();
Content
link
=
new
ContentBuilder
();
if
(
classDoc
.
isIncluded
())
{
if
(
configuration
.
isGeneratedDoc
(
classDoc
))
{
DocPath
filename
=
getPath
(
classLinkInfo
);
if
(
linkInfo
.
linkToSelf
||
!(
DocPath
.
forName
(
classDoc
)).
equals
(
m_writer
.
filename
))
{
link
Output
.
append
(
m_writer
.
getHyperLinkString
(
link
.
addContent
(
new
RawHtml
(
m_writer
.
getHyperLinkString
(
filename
.
fragment
(
classLinkInfo
.
where
),
label
.
toString
(),
classLinkInfo
.
isStrong
,
classLinkInfo
.
styleName
,
title
,
classLinkInfo
.
target
));
title
,
classLinkInfo
.
target
))
)
;
if
(
noLabel
&&
!
classLinkInfo
.
excludeTypeParameterLinks
)
{
link
Output
.
append
(
getTypeParameterLinks
(
linkInfo
).
toString
(
));
link
.
addContent
(
getTypeParameterLinks
(
linkInfo
));
}
return
link
Output
;
return
link
;
}
}
}
else
{
...
...
@@ -100,25 +102,25 @@ public class LinkFactoryImpl extends LinkFactory {
label
.
toString
(),
classLinkInfo
.
isStrong
,
classLinkInfo
.
styleName
,
true
);
if
(
crossLink
!=
null
)
{
link
Output
.
append
(
crossLink
);
link
.
addContent
(
new
RawHtml
(
crossLink
)
);
if
(
noLabel
&&
!
classLinkInfo
.
excludeTypeParameterLinks
)
{
link
Output
.
append
(
getTypeParameterLinks
(
linkInfo
).
toString
(
));
link
.
addContent
(
getTypeParameterLinks
(
linkInfo
));
}
return
link
Output
;
return
link
;
}
}
// Can't link so just write label.
link
Output
.
append
(
label
.
toString
(
));
link
.
addContent
(
new
RawHtml
(
label
.
toString
()
));
if
(
noLabel
&&
!
classLinkInfo
.
excludeTypeParameterLinks
)
{
link
Output
.
append
(
getTypeParameterLinks
(
linkInfo
).
toString
(
));
link
.
addContent
(
getTypeParameterLinks
(
linkInfo
));
}
return
link
Output
;
return
link
;
}
/**
* {@inheritDoc}
*/
protected
LinkOutpu
t
getTypeParameterLink
(
LinkInfo
linkInfo
,
protected
Conten
t
getTypeParameterLink
(
LinkInfo
linkInfo
,
Type
typeParam
)
{
LinkInfoImpl
typeLinkInfo
=
new
LinkInfoImpl
(
m_writer
.
configuration
,
((
LinkInfoImpl
)
linkInfo
).
getContext
(),
typeParam
);
...
...
@@ -126,29 +128,29 @@ public class LinkFactoryImpl extends LinkFactory {
typeLinkInfo
.
excludeTypeParameterLinks
=
linkInfo
.
excludeTypeParameterLinks
;
typeLinkInfo
.
linkToSelf
=
linkInfo
.
linkToSelf
;
typeLinkInfo
.
isJava5DeclarationLocation
=
false
;
LinkOutput
output
=
getLinkOutput
(
typeLinkInfo
);
Content
output
=
getLink
(
typeLinkInfo
);
((
LinkInfoImpl
)
linkInfo
).
displayLength
+=
typeLinkInfo
.
displayLength
;
return
output
;
}
protected
LinkOutpu
t
getTypeAnnotationLink
(
LinkInfo
linkInfo
,
protected
Conten
t
getTypeAnnotationLink
(
LinkInfo
linkInfo
,
AnnotationDesc
annotation
)
{
throw
new
RuntimeException
(
"Not implemented yet!"
);
}
public
LinkOutpu
t
getTypeAnnotationLinks
(
LinkInfo
linkInfo
)
{
LinkOutput
output
=
getOutputInstance
();
public
Conten
t
getTypeAnnotationLinks
(
LinkInfo
linkInfo
)
{
ContentBuilder
links
=
new
ContentBuilder
();
AnnotationDesc
[]
annotations
;
if
(
linkInfo
.
type
instanceof
AnnotatedType
)
{
annotations
=
linkInfo
.
type
.
asAnnotatedType
().
annotations
();
}
else
if
(
linkInfo
.
type
instanceof
TypeVariable
)
{
annotations
=
linkInfo
.
type
.
asTypeVariable
().
annotations
();
}
else
{
return
output
;
return
links
;
}
if
(
annotations
.
length
==
0
)
return
output
;
return
links
;
List
<
String
>
annos
=
m_writer
.
getAnnotations
(
0
,
annotations
,
false
,
linkInfo
.
isJava5DeclarationLocation
);
...
...
@@ -156,17 +158,17 @@ public class LinkFactoryImpl extends LinkFactory {
for
(
String
anno
:
annos
)
{
if
(!
isFirst
)
{
linkInfo
.
displayLength
+=
1
;
output
.
append
(
" "
);
links
.
addContent
(
" "
);
}
output
.
append
(
anno
);
links
.
addContent
(
new
RawHtml
(
anno
)
);
isFirst
=
false
;
}
if
(!
annos
.
isEmpty
())
{
linkInfo
.
displayLength
+=
1
;
output
.
append
(
" "
);
links
.
addContent
(
" "
);
}
return
output
;
return
links
;
}
/**
...
...
@@ -182,16 +184,16 @@ public class LinkFactoryImpl extends LinkFactory {
classDoc
.
name
());
}
else
if
(
classDoc
.
isInterface
()){
return
configuration
.
getText
(
"doclet.Href_Interface_Title"
,
Util
.
getPackageName
(
classDoc
.
containingPackage
(
)));
Util
.
escapeHtmlChars
(
Util
.
getPackageName
(
classDoc
.
containingPackage
()
)));
}
else
if
(
classDoc
.
isAnnotationType
())
{
return
configuration
.
getText
(
"doclet.Href_Annotation_Title"
,
Util
.
getPackageName
(
classDoc
.
containingPackage
(
)));
Util
.
escapeHtmlChars
(
Util
.
getPackageName
(
classDoc
.
containingPackage
()
)));
}
else
if
(
classDoc
.
isEnum
())
{
return
configuration
.
getText
(
"doclet.Href_Enum_Title"
,
Util
.
getPackageName
(
classDoc
.
containingPackage
(
)));
Util
.
escapeHtmlChars
(
Util
.
getPackageName
(
classDoc
.
containingPackage
()
)));
}
else
{
return
configuration
.
getText
(
"doclet.Href_Class_Title"
,
Util
.
getPackageName
(
classDoc
.
containingPackage
(
)));
Util
.
escapeHtmlChars
(
Util
.
getPackageName
(
classDoc
.
containingPackage
()
)));
}
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java
浏览文件 @
e904244f
...
...
@@ -152,12 +152,12 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
Util
.
isLinkable
(
holderClassDoc
,
configuration
))))
{
writer
.
addInlineComment
(
method
,
methodDocTree
);
}
else
{
Content
link
=
new
RawHtml
(
Content
link
=
writer
.
getDocLink
(
LinkInfoImpl
.
Kind
.
METHOD_DOC_COPY
,
holder
.
asClassDoc
(),
method
,
holder
.
asClassDoc
().
isIncluded
()
?
holder
.
typeName
()
:
holder
.
qualifiedTypeName
(),
false
)
)
;
false
);
Content
codelLink
=
HtmlTree
.
CODE
(
link
);
Content
strong
=
HtmlTree
.
STRONG
(
holder
.
asClassDoc
().
isClass
()?
writer
.
descfrmClassLabel
:
writer
.
descfrmInterfaceLabel
);
...
...
@@ -311,14 +311,14 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
}
Content
dt
=
HtmlTree
.
DT
(
HtmlTree
.
STRONG
(
label
));
dl
.
addContent
(
dt
);
Content
overriddenTypeLink
=
new
RawHtml
(
writer
.
getLink
(
new
LinkInfoImpl
(
writer
.
configuration
,
context
,
overriddenType
))
)
;
Content
overriddenTypeLink
=
writer
.
getLink
(
new
LinkInfoImpl
(
writer
.
configuration
,
context
,
overriddenType
));
Content
codeOverridenTypeLink
=
HtmlTree
.
CODE
(
overriddenTypeLink
);
String
name
=
method
.
name
();
Content
methlink
=
new
RawHtml
(
writer
.
getLink
(
Content
methlink
=
writer
.
getLink
(
new
LinkInfoImpl
(
writer
.
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
overriddenType
.
asClassDoc
(),
writer
.
getAnchor
(
method
),
name
,
false
))
)
;
writer
.
getAnchor
(
method
),
name
,
false
));
Content
codeMethLink
=
HtmlTree
.
CODE
(
methlink
);
Content
dd
=
HtmlTree
.
DD
(
codeMethLink
);
dd
.
addContent
(
writer
.
getSpace
());
...
...
@@ -361,14 +361,14 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
for
(
int
i
=
0
;
i
<
implementedMethods
.
length
;
i
++)
{
MethodDoc
implementedMeth
=
implementedMethods
[
i
];
Type
intfac
=
implementedMethodsFinder
.
getMethodHolder
(
implementedMeth
);
Content
intfaclink
=
new
RawHtml
(
writer
.
getLink
(
new
LinkInfoImpl
(
writer
.
configuration
,
LinkInfoImpl
.
Kind
.
METHOD_SPECIFIED_BY
,
intfac
))
)
;
Content
intfaclink
=
writer
.
getLink
(
new
LinkInfoImpl
(
writer
.
configuration
,
LinkInfoImpl
.
Kind
.
METHOD_SPECIFIED_BY
,
intfac
));
Content
codeIntfacLink
=
HtmlTree
.
CODE
(
intfaclink
);
Content
dt
=
HtmlTree
.
DT
(
HtmlTree
.
STRONG
(
writer
.
specifiedByLabel
));
dl
.
addContent
(
dt
);
Content
methlink
=
new
RawHtml
(
writer
.
getDocLink
(
Content
methlink
=
writer
.
getDocLink
(
LinkInfoImpl
.
Kind
.
MEMBER
,
implementedMeth
,
implementedMeth
.
name
(),
false
)
)
;
implementedMeth
.
name
(),
false
);
Content
codeMethLink
=
HtmlTree
.
CODE
(
methlink
);
Content
dd
=
HtmlTree
.
DD
(
codeMethLink
);
dd
.
addContent
(
writer
.
getSpace
());
...
...
@@ -388,8 +388,8 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
protected
void
addReturnType
(
MethodDoc
method
,
Content
htmltree
)
{
Type
type
=
method
.
returnType
();
if
(
type
!=
null
)
{
Content
linkContent
=
new
RawHtml
(
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
RETURN_TYPE
,
type
))
)
;
Content
linkContent
=
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
RETURN_TYPE
,
type
));
htmltree
.
addContent
(
linkContent
);
htmltree
.
addContent
(
writer
.
getSpace
());
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java
浏览文件 @
e904244f
...
...
@@ -26,7 +26,6 @@
package
com.sun.tools.doclets.formats.html
;
import
java.io.*
;
import
java.util.*
;
import
com.sun.javadoc.*
;
import
com.sun.tools.doclets.formats.html.markup.*
;
...
...
@@ -165,8 +164,8 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
*/
protected
void
addSummaryLink
(
LinkInfoImpl
.
Kind
context
,
ClassDoc
cd
,
ProgramElementDoc
member
,
Content
tdSummary
)
{
Content
strong
=
HtmlTree
.
STRONG
(
new
RawHtml
(
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
(
ClassDoc
)
member
,
false
)))
)
;
Content
strong
=
HtmlTree
.
STRONG
(
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
context
,
(
ClassDoc
)
member
,
false
)));
Content
code
=
HtmlTree
.
CODE
(
strong
);
tdSummary
.
addContent
(
code
);
}
...
...
@@ -176,9 +175,9 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
*/
protected
void
addInheritedSummaryLink
(
ClassDoc
cd
,
ProgramElementDoc
member
,
Content
linksTree
)
{
linksTree
.
addContent
(
new
RawHtml
(
linksTree
.
addContent
(
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
(
ClassDoc
)
member
,
false
)))
)
;
(
ClassDoc
)
member
,
false
)));
}
/**
...
...
src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java
浏览文件 @
e904244f
...
...
@@ -94,7 +94,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
packgen
=
new
PackageFrameWriter
(
configuration
,
packageDoc
);
String
pkgName
=
Util
.
getPackageName
(
packageDoc
);
Content
body
=
packgen
.
getBody
(
false
,
packgen
.
getWindowTitle
(
pkgName
));
Content
pkgNameContent
=
new
RawHtml
(
pkgName
);
Content
pkgNameContent
=
new
RawHtml
(
Util
.
escapeHtmlChars
(
pkgName
)
);
Content
heading
=
HtmlTree
.
HEADING
(
HtmlConstants
.
TITLE_HEADING
,
HtmlStyle
.
bar
,
packgen
.
getTargetPackageLink
(
packageDoc
,
"classFrame"
,
pkgNameContent
));
body
.
addContent
(
heading
);
...
...
@@ -182,10 +182,10 @@ public class PackageFrameWriter extends HtmlDocletWriter {
contentTree
.
addContent
(
heading
);
printedHeader
=
true
;
}
Content
link
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
Content
link
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
PACKAGE_FRAME
,
arr
[
i
],
(
arr
[
i
].
isInterface
()
?
italicsText
(
arr
[
i
].
name
())
:
arr
[
i
].
name
()),
"classFrame"
))
)
;
arr
[
i
].
name
()),
"classFrame"
));
Content
li
=
HtmlTree
.
LI
(
link
);
ul
.
addContent
(
li
);
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java
浏览文件 @
e904244f
/*
* Copyright (c) 1998, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
3
, 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
...
...
@@ -115,7 +115,7 @@ public class PackageTreeWriter extends AbstractTreeWriter {
protected
void
generatePackageTreeFile
()
throws
IOException
{
Content
body
=
getPackageTreeHeader
();
Content
headContent
=
getResource
(
"doclet.Hierarchy_For_Package"
,
Util
.
getPackageName
(
packagedoc
));
Util
.
escapeHtmlChars
(
Util
.
getPackageName
(
packagedoc
)
));
Content
heading
=
HtmlTree
.
HEADING
(
HtmlConstants
.
TITLE_HEADING
,
false
,
HtmlStyle
.
title
,
headContent
);
Content
div
=
HtmlTree
.
DIV
(
HtmlStyle
.
header
,
heading
);
...
...
src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java
浏览文件 @
e904244f
/*
* Copyright (c) 1998, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
3
, 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
...
...
@@ -154,7 +154,7 @@ public class PackageUseWriter extends SubWriterHolderWriter {
Content
table
=
HtmlTree
.
TABLE
(
0
,
3
,
0
,
useTableSummary
,
getTableCaption
(
configuration
.
getText
(
"doclet.ClassUse_Packages.that.use.0"
,
getPackageLinkString
(
pkgdoc
,
Util
.
getPackageName
(
pkgdoc
),
false
))));
getPackageLinkString
(
pkgdoc
,
Util
.
escapeHtmlChars
(
Util
.
getPackageName
(
pkgdoc
)
),
false
))));
table
.
addContent
(
getSummaryTableHeader
(
packageTableHeader
,
"col"
));
Content
tbody
=
new
HtmlTree
(
HtmlTag
.
TBODY
);
Iterator
<
String
>
it
=
usingPackageToUsedClasses
.
keySet
().
iterator
();
...
...
@@ -199,8 +199,8 @@ public class PackageUseWriter extends SubWriterHolderWriter {
Content
table
=
HtmlTree
.
TABLE
(
0
,
3
,
0
,
tableSummary
,
getTableCaption
(
configuration
.
getText
(
"doclet.ClassUse_Classes.in.0.used.by.1"
,
getPackageLinkString
(
pkgdoc
,
Util
.
getPackageName
(
pkgdoc
),
false
),
getPackageLinkString
(
usingPackage
,
Util
.
getPackageName
(
usingPackage
),
false
))));
getPackageLinkString
(
pkgdoc
,
Util
.
escapeHtmlChars
(
Util
.
getPackageName
(
pkgdoc
)
),
false
),
getPackageLinkString
(
usingPackage
,
Util
.
escapeHtmlChars
(
Util
.
getPackageName
(
usingPackage
)
),
false
))));
table
.
addContent
(
getSummaryTableHeader
(
classTableHeader
,
"col"
));
Content
tbody
=
new
HtmlTree
(
HtmlTag
.
TBODY
);
Iterator
<
ClassDoc
>
itc
=
...
...
@@ -247,7 +247,7 @@ public class PackageUseWriter extends SubWriterHolderWriter {
protected
void
addPackageUse
(
PackageDoc
pkg
,
Content
contentTree
)
throws
IOException
{
Content
tdFirst
=
HtmlTree
.
TD
(
HtmlStyle
.
colFirst
,
getHyperLink
(
Util
.
getPackageName
(
pkg
),
new
RawHtml
(
Util
.
getPackageName
(
pkg
))));
new
StringContent
(
Util
.
getPackageName
(
pkg
))));
contentTree
.
addContent
(
tdFirst
);
HtmlTree
tdLast
=
new
HtmlTree
(
HtmlTag
.
TD
);
tdLast
.
addStyle
(
HtmlStyle
.
colLast
);
...
...
src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java
浏览文件 @
e904244f
...
...
@@ -178,9 +178,9 @@ public class PackageWriterImpl extends HtmlDocletWriter
!
configuration
.
isGeneratedDoc
(
classes
[
i
]))
{
continue
;
}
Content
classContent
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
Content
classContent
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
PACKAGE
,
classes
[
i
],
false
))
)
;
false
));
Content
tdClass
=
HtmlTree
.
TD
(
HtmlStyle
.
colFirst
,
classContent
);
HtmlTree
tr
=
HtmlTree
.
TR
(
tdClass
);
if
(
i
%
2
==
0
)
...
...
src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java
浏览文件 @
e904244f
...
...
@@ -173,10 +173,10 @@ public class ProfilePackageFrameWriter extends HtmlDocletWriter {
contentTree
.
addContent
(
heading
);
printedHeader
=
true
;
}
Content
link
=
new
RawHtml
(
getLink
(
new
LinkInfoImpl
(
configuration
,
Content
link
=
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
PACKAGE_FRAME
,
arr
[
i
],
(
arr
[
i
].
isInterface
()
?
italicsText
(
arr
[
i
].
name
())
:
arr
[
i
].
name
()),
"classFrame"
))
)
;
arr
[
i
].
name
()),
"classFrame"
));
Content
li
=
HtmlTree
.
LI
(
link
);
ul
.
addContent
(
li
);
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java
浏览文件 @
e904244f
...
...
@@ -98,9 +98,9 @@ public class PropertyWriterImpl extends AbstractMemberWriter
Content
pre
=
new
HtmlTree
(
HtmlTag
.
PRE
);
writer
.
addAnnotationInfo
(
property
,
pre
);
addModifiers
(
property
,
pre
);
Content
propertylink
=
new
RawHtml
(
writer
.
getLink
(
new
LinkInfoImpl
(
Content
propertylink
=
writer
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
property
.
returnType
()))
)
;
property
.
returnType
()));
pre
.
addContent
(
propertylink
);
pre
.
addContent
(
" "
);
if
(
configuration
.
linksource
)
{
...
...
@@ -128,12 +128,12 @@ public class PropertyWriterImpl extends AbstractMemberWriter
(!
(
holder
.
isPublic
()
||
Util
.
isLinkable
(
holder
,
configuration
))))
{
writer
.
addInlineComment
(
property
,
propertyDocTree
);
}
else
{
Content
link
=
new
RawHtml
(
Content
link
=
writer
.
getDocLink
(
LinkInfoImpl
.
Kind
.
PROPERTY_DOC_COPY
,
holder
,
property
,
holder
.
isIncluded
()
?
holder
.
typeName
()
:
holder
.
qualifiedTypeName
(),
false
)
)
;
false
);
Content
codeLink
=
HtmlTree
.
CODE
(
link
);
Content
strong
=
HtmlTree
.
STRONG
(
holder
.
isClass
()?
writer
.
descfrmClassLabel
:
writer
.
descfrmInterfaceLabel
);
...
...
@@ -252,13 +252,13 @@ public class PropertyWriterImpl extends AbstractMemberWriter
*/
protected
void
addSummaryLink
(
LinkInfoImpl
.
Kind
context
,
ClassDoc
cd
,
ProgramElementDoc
member
,
Content
tdSummary
)
{
Content
strong
=
HtmlTree
.
STRONG
(
new
RawHtml
(
Content
strong
=
HtmlTree
.
STRONG
(
writer
.
getDocLink
(
context
,
cd
,
(
MemberDoc
)
member
,
member
.
name
().
substring
(
0
,
member
.
name
().
lastIndexOf
(
"Property"
)),
false
,
true
))
)
;
true
));
Content
code
=
HtmlTree
.
CODE
(
strong
);
tdSummary
.
addContent
(
code
);
...
...
@@ -269,12 +269,12 @@ public class PropertyWriterImpl extends AbstractMemberWriter
*/
protected
void
addInheritedSummaryLink
(
ClassDoc
cd
,
ProgramElementDoc
member
,
Content
linksTree
)
{
linksTree
.
addContent
(
new
RawHtml
(
linksTree
.
addContent
(
writer
.
getDocLink
(
LinkInfoImpl
.
Kind
.
MEMBER
,
cd
,
(
MemberDoc
)
member
,
((
member
.
name
().
lastIndexOf
(
"Property"
)
!=
-
1
)
&&
configuration
.
javafx
)
?
member
.
name
().
substring
(
0
,
member
.
name
().
length
()
-
"Property"
.
length
())
:
member
.
name
(),
false
,
true
))
)
;
false
,
true
));
}
/**
...
...
src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java
浏览文件 @
e904244f
...
...
@@ -127,9 +127,9 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
* @return a content tree for the class header
*/
public
Content
getClassHeader
(
ClassDoc
classDoc
)
{
String
classLink
=
(
classDoc
.
isPublic
()
||
classDoc
.
isProtected
())?
String
classLink
=
(
classDoc
.
isPublic
()
||
classDoc
.
isProtected
())
?
getLink
(
new
LinkInfoImpl
(
configuration
,
classDoc
,
configuration
.
getClassName
(
classDoc
))):
configuration
.
getClassName
(
classDoc
)))
.
toString
()
:
classDoc
.
qualifiedName
();
Content
li
=
HtmlTree
.
LI
(
HtmlStyle
.
blockList
,
getMarkerAnchor
(
classDoc
.
qualifiedName
()));
...
...
@@ -137,7 +137,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
classDoc
.
superclassType
()
!=
null
?
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
SERIALIZED_FORM
,
classDoc
.
superclassType
()))
:
classDoc
.
superclassType
()))
.
toString
()
:
null
;
//Print the heading.
...
...
src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java
浏览文件 @
e904244f
...
...
@@ -248,7 +248,7 @@ public class TagletWriterImpl extends TagletWriter {
htmlWriter
.
codeText
(
throwsTag
.
exceptionName
())
:
htmlWriter
.
codeText
(
htmlWriter
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
throwsTag
.
exceptionType
())));
throwsTag
.
exceptionType
()))
.
toString
()
);
TagletOutput
text
=
new
TagletOutputImpl
(
htmlWriter
.
commentTagsToString
(
throwsTag
,
null
,
throwsTag
.
inlineTags
(),
false
));
...
...
@@ -265,7 +265,7 @@ public class TagletWriterImpl extends TagletWriter {
public
TagletOutput
throwsTagOutput
(
Type
throwsType
)
{
return
new
TagletOutputImpl
(
DocletConstants
.
NL
+
"<dd>"
+
htmlWriter
.
codeText
(
htmlWriter
.
getLink
(
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
throwsType
)))
+
"</dd>"
);
new
LinkInfoImpl
(
configuration
,
LinkInfoImpl
.
Kind
.
MEMBER
,
throwsType
))
.
toString
()
)
+
"</dd>"
);
}
/**
...
...
@@ -275,7 +275,7 @@ public class TagletWriterImpl extends TagletWriter {
boolean
includeLink
)
{
return
new
TagletOutputImpl
(
includeLink
?
htmlWriter
.
getDocLink
(
LinkInfoImpl
.
Kind
.
VALUE_TAG
,
field
,
constantVal
,
false
)
:
constantVal
);
constantVal
,
false
)
.
toString
()
:
constantVal
);
}
/**
...
...
src/share/classes/com/sun/tools/doclets/formats/html/markup/ContentBuilder.java
0 → 100644
浏览文件 @
e904244f
/*
* Copyright (c) 2003, 2013, 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.formats.html.markup
;
import
java.io.IOException
;
import
java.io.Writer
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
com.sun.tools.doclets.internal.toolkit.Content
;
/**
* A sequence of Content nodes.
*/
public
class
ContentBuilder
extends
Content
{
protected
List
<
Content
>
contents
=
Collections
.<
Content
>
emptyList
();
@Override
public
void
addContent
(
Content
content
)
{
if
(
content
.
isEmpty
())
return
;
ensureMutableContents
();
if
(
content
instanceof
ContentBuilder
)
{
contents
.
addAll
(((
ContentBuilder
)
content
).
contents
);
}
else
contents
.
add
(
content
);
}
@Override
public
void
addContent
(
String
text
)
{
if
(
text
.
isEmpty
())
return
;
ensureMutableContents
();
Content
c
=
contents
.
isEmpty
()
?
null
:
contents
.
get
(
contents
.
size
()
-
1
);
StringContent
sc
;
if
(
c
!=
null
&&
c
instanceof
StringContent
)
{
sc
=
(
StringContent
)
c
;
}
else
{
contents
.
add
(
sc
=
new
StringContent
());
}
sc
.
addContent
(
text
);
}
@Override
public
boolean
write
(
Writer
writer
,
boolean
atNewline
)
throws
IOException
{
for
(
Content
content:
contents
)
{
atNewline
=
content
.
write
(
writer
,
atNewline
);
}
return
atNewline
;
}
@Override
public
boolean
isEmpty
()
{
for
(
Content
content:
contents
)
{
if
(!
content
.
isEmpty
())
return
false
;
}
return
true
;
}
private
void
ensureMutableContents
()
{
if
(
contents
.
isEmpty
())
contents
=
new
ArrayList
<
Content
>();
}
}
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
浏览文件 @
e904244f
/*
* Copyright (c) 2010, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 201
3
, 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
...
...
@@ -132,7 +132,7 @@ public class HtmlTree extends Content {
*/
public
static
HtmlTree
A
(
String
ref
,
Content
body
)
{
HtmlTree
htmltree
=
new
HtmlTree
(
HtmlTag
.
A
,
nullCheck
(
body
));
htmltree
.
addAttr
(
HtmlAttr
.
HREF
,
nullCheck
(
ref
));
htmltree
.
addAttr
(
HtmlAttr
.
HREF
,
Util
.
escapeHtmlChars
(
nullCheck
(
ref
)
));
return
htmltree
;
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
浏览文件 @
e904244f
...
...
@@ -196,7 +196,7 @@ public class HtmlWriter {
configuration
.
getText
(
"doclet.Type"
));
overviewLabel
=
getResource
(
"doclet.Overview"
);
defaultPackageLabel
=
new
RawHtml
(
DocletConstants
.
DEFAULT_PACKAGE_NAME
);
Util
.
escapeHtmlChars
(
DocletConstants
.
DEFAULT_PACKAGE_NAME
)
);
packageLabel
=
getResource
(
"doclet.Package"
);
profileLabel
=
getResource
(
"doclet.Profile"
);
useLabel
=
getResource
(
"doclet.navClassUse"
);
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java
浏览文件 @
e904244f
/*
* Copyright (c) 2010, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 201
3
, 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
...
...
@@ -106,32 +106,4 @@ public abstract class Content {
t
.
getClass
();
return
t
;
}
/**
* Returns true if the content ends with a newline character. Empty content
* is considered as ending with new line.
*
* @param contentBuilder content to test for newline character at the end
* @return true if the content ends with newline.
*/
protected
boolean
endsWithNewLine
(
StringBuilder
contentBuilder
)
{
int
contentLength
=
contentBuilder
.
length
();
if
(
contentLength
==
0
)
{
return
true
;
}
int
nlLength
=
DocletConstants
.
NL
.
length
();
if
(
contentLength
<
nlLength
)
{
return
false
;
}
int
contentIndex
=
contentLength
-
1
;
int
nlIndex
=
nlLength
-
1
;
while
(
nlIndex
>=
0
)
{
if
(
contentBuilder
.
charAt
(
contentIndex
)
!=
DocletConstants
.
NL
.
charAt
(
nlIndex
))
{
return
false
;
}
contentIndex
--;
nlIndex
--;
}
return
true
;
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java
浏览文件 @
e904244f
...
...
@@ -121,7 +121,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
*/
public
void
buildPackageDoc
(
XMLNode
node
,
Content
contentTree
)
throws
Exception
{
contentTree
=
packageWriter
.
getPackageHeader
(
Util
.
getPackageName
(
packageDoc
));
Util
.
escapeHtmlChars
(
Util
.
getPackageName
(
packageDoc
)
));
buildChildren
(
node
,
contentTree
);
packageWriter
.
addPackageFooter
(
contentTree
);
packageWriter
.
printDocument
(
contentTree
);
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocletConstants.java
浏览文件 @
e904244f
/*
* Copyright (c) 2003, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
3
, 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
...
...
@@ -52,7 +52,7 @@ public class DocletConstants {
/**
* The default package name.
*/
public
static
final
String
DEFAULT_PACKAGE_NAME
=
"
<Unnamed>
"
;
public
static
final
String
DEFAULT_PACKAGE_NAME
=
"
<Unnamed>
"
;
/**
* The default package file name.
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkFactory.java
浏览文件 @
e904244f
...
...
@@ -26,6 +26,7 @@
package
com.sun.tools.doclets.internal.toolkit.util.links
;
import
com.sun.javadoc.*
;
import
com.sun.tools.doclets.internal.toolkit.Content
;
/**
* A factory that constructs links from given link information.
...
...
@@ -41,11 +42,11 @@ import com.sun.javadoc.*;
public
abstract
class
LinkFactory
{
/**
* Return an empty instance of
the link outpu
t object.
* Return an empty instance of
a conten
t object.
*
* @return an empty instance of
the link outpu
t object.
* @return an empty instance of
a conten
t object.
*/
protected
abstract
LinkOutput
getOutputInstance
();
protected
abstract
Content
newContent
();
/**
* Constructs a link from the given link information.
...
...
@@ -53,41 +54,41 @@ public abstract class LinkFactory {
* @param linkInfo the information about the link.
* @return the output of the link.
*/
public
LinkOutput
getLinkOutput
(
LinkInfo
linkInfo
)
{
public
Content
getLink
(
LinkInfo
linkInfo
)
{
if
(
linkInfo
.
type
!=
null
)
{
Type
type
=
linkInfo
.
type
;
LinkOutput
linkOutput
=
getOutputInstance
();
Content
link
=
newContent
();
if
(
type
.
isPrimitive
())
{
//Just a primitive.
linkInfo
.
displayLength
+=
type
.
typeName
().
length
();
link
Output
.
append
(
type
.
typeName
());
link
.
addContent
(
type
.
typeName
());
}
else
if
(
type
.
asAnnotatedType
()
!=
null
&&
type
.
dimension
().
length
()
==
0
)
{
link
Output
.
append
(
getTypeAnnotationLinks
(
linkInfo
));
link
.
addContent
(
getTypeAnnotationLinks
(
linkInfo
));
linkInfo
.
type
=
type
.
asAnnotatedType
().
underlyingType
();
link
Output
.
append
(
getLinkOutput
(
linkInfo
));
return
link
Output
;
link
.
addContent
(
getLink
(
linkInfo
));
return
link
;
}
else
if
(
type
.
asWildcardType
()
!=
null
)
{
//Wildcard type.
linkInfo
.
isTypeBound
=
true
;
linkInfo
.
displayLength
+=
1
;
link
Output
.
append
(
"?"
);
link
.
addContent
(
"?"
);
WildcardType
wildcardType
=
type
.
asWildcardType
();
Type
[]
extendsBounds
=
wildcardType
.
extendsBounds
();
for
(
int
i
=
0
;
i
<
extendsBounds
.
length
;
i
++)
{
linkInfo
.
displayLength
+=
i
>
0
?
2
:
9
;
link
Output
.
append
(
i
>
0
?
", "
:
" extends "
);
link
.
addContent
(
i
>
0
?
", "
:
" extends "
);
setBoundsLinkInfo
(
linkInfo
,
extendsBounds
[
i
]);
link
Output
.
append
(
getLinkOutput
(
linkInfo
));
link
.
addContent
(
getLink
(
linkInfo
));
}
Type
[]
superBounds
=
wildcardType
.
superBounds
();
for
(
int
i
=
0
;
i
<
superBounds
.
length
;
i
++)
{
linkInfo
.
displayLength
+=
i
>
0
?
2
:
7
;
link
Output
.
append
(
i
>
0
?
", "
:
" super "
);
link
.
addContent
(
i
>
0
?
", "
:
" super "
);
setBoundsLinkInfo
(
linkInfo
,
superBounds
[
i
]);
link
Output
.
append
(
getLinkOutput
(
linkInfo
));
link
.
addContent
(
getLink
(
linkInfo
));
}
}
else
if
(
type
.
asTypeVariable
()!=
null
)
{
link
Output
.
append
(
getTypeAnnotationLinks
(
linkInfo
));
link
.
addContent
(
getTypeAnnotationLinks
(
linkInfo
));
linkInfo
.
isTypeBound
=
true
;
//A type variable.
Doc
owner
=
type
.
asTypeVariable
().
owner
();
...
...
@@ -95,11 +96,11 @@ public abstract class LinkFactory {
owner
instanceof
ClassDoc
)
{
linkInfo
.
classDoc
=
(
ClassDoc
)
owner
;
linkInfo
.
label
=
type
.
typeName
();
link
Output
.
append
(
getClassLink
(
linkInfo
));
link
.
addContent
(
getClassLink
(
linkInfo
));
}
else
{
//No need to link method type parameters.
linkInfo
.
displayLength
+=
type
.
typeName
().
length
();
link
Output
.
append
(
type
.
typeName
());
link
.
addContent
(
type
.
typeName
());
}
Type
[]
bounds
=
type
.
asTypeVariable
().
bounds
();
...
...
@@ -107,9 +108,9 @@ public abstract class LinkFactory {
linkInfo
.
excludeTypeBounds
=
true
;
for
(
int
i
=
0
;
i
<
bounds
.
length
;
i
++)
{
linkInfo
.
displayLength
+=
i
>
0
?
2
:
9
;
link
Output
.
append
(
i
>
0
?
" & "
:
" extends "
);
link
.
addContent
(
i
>
0
?
" & "
:
" extends "
);
setBoundsLinkInfo
(
linkInfo
,
bounds
[
i
]);
link
Output
.
append
(
getLinkOutput
(
linkInfo
));
link
.
addContent
(
getLink
(
linkInfo
));
}
}
}
else
if
(
type
.
asClassDoc
()
!=
null
)
{
...
...
@@ -119,14 +120,15 @@ public abstract class LinkFactory {
//Since we are excluding type parameter links, we should not
//be linking to the type bound.
linkInfo
.
displayLength
+=
type
.
typeName
().
length
();
link
Output
.
append
(
type
.
typeName
());
link
Output
.
append
(
getTypeParameterLinks
(
linkInfo
));
return
link
Output
;
link
.
addContent
(
type
.
typeName
());
link
.
addContent
(
getTypeParameterLinks
(
linkInfo
));
return
link
;
}
else
{
linkInfo
.
classDoc
=
type
.
asClassDoc
();
linkOutput
=
getClassLink
(
linkInfo
);
link
=
newContent
();
link
.
addContent
(
getClassLink
(
linkInfo
));
if
(
linkInfo
.
includeTypeAsSepLink
)
{
link
Output
.
append
(
getTypeParameterLinks
(
linkInfo
,
false
));
link
.
addContent
(
getTypeParameterLinks
(
linkInfo
,
false
));
}
}
}
...
...
@@ -136,35 +138,39 @@ public abstract class LinkFactory {
//Javadoc returns var args as array.
//Strip out the first [] from the var arg.
linkInfo
.
displayLength
+=
type
.
dimension
().
length
()-
2
;
link
Output
.
append
(
type
.
dimension
().
substring
(
2
));
link
.
addContent
(
type
.
dimension
().
substring
(
2
));
}
linkInfo
.
displayLength
+=
3
;
link
Output
.
append
(
"..."
);
link
.
addContent
(
"..."
);
}
else
{
while
(
type
!=
null
&&
type
.
dimension
().
length
()
>
0
)
{
linkInfo
.
displayLength
+=
type
.
dimension
().
length
();
if
(
type
.
asAnnotatedType
()
!=
null
)
{
linkInfo
.
type
=
type
;
link
Output
.
append
(
" "
);
link
Output
.
append
(
getTypeAnnotationLinks
(
linkInfo
));
link
Output
.
append
(
"[]"
);
link
.
addContent
(
" "
);
link
.
addContent
(
getTypeAnnotationLinks
(
linkInfo
));
link
.
addContent
(
"[]"
);
type
=
type
.
asAnnotatedType
().
underlyingType
().
getElementType
();
}
else
{
link
Output
.
append
(
"[]"
);
link
.
addContent
(
"[]"
);
type
=
type
.
getElementType
();
}
}
linkInfo
.
type
=
type
;
linkOutput
.
insert
(
0
,
getTypeAnnotationLinks
(
linkInfo
));
Content
newLink
=
newContent
();
newLink
.
addContent
(
getTypeAnnotationLinks
(
linkInfo
));
newLink
.
addContent
(
link
);
link
=
newLink
;
}
return
link
Output
;
return
link
;
}
else
if
(
linkInfo
.
classDoc
!=
null
)
{
//Just a class link
LinkOutput
linkOutput
=
getClassLink
(
linkInfo
);
Content
link
=
newContent
();
link
.
addContent
(
getClassLink
(
linkInfo
));
if
(
linkInfo
.
includeTypeAsSepLink
)
{
link
Output
.
append
(
getTypeParameterLinks
(
linkInfo
,
false
));
link
.
addContent
(
getTypeParameterLinks
(
linkInfo
,
false
));
}
return
link
Output
;
return
link
;
}
else
{
return
null
;
}
...
...
@@ -183,7 +189,7 @@ public abstract class LinkFactory {
*
* @return the link for the given class.
*/
protected
abstract
LinkOutpu
t
getClassLink
(
LinkInfo
linkInfo
);
protected
abstract
Conten
t
getClassLink
(
LinkInfo
linkInfo
);
/**
* Return the link to the given type parameter.
...
...
@@ -191,10 +197,10 @@ public abstract class LinkFactory {
* @param linkInfo the information about the link to construct.
* @param typeParam the type parameter to link to.
*/
protected
abstract
LinkOutpu
t
getTypeParameterLink
(
LinkInfo
linkInfo
,
protected
abstract
Conten
t
getTypeParameterLink
(
LinkInfo
linkInfo
,
Type
typeParam
);
protected
abstract
LinkOutpu
t
getTypeAnnotationLink
(
LinkInfo
linkInfo
,
protected
abstract
Conten
t
getTypeAnnotationLink
(
LinkInfo
linkInfo
,
AnnotationDesc
annotation
);
/**
...
...
@@ -203,7 +209,7 @@ public abstract class LinkFactory {
* @param linkInfo the information about the link to construct.
* @return the links to the type parameters.
*/
public
LinkOutpu
t
getTypeParameterLinks
(
LinkInfo
linkInfo
)
{
public
Conten
t
getTypeParameterLinks
(
LinkInfo
linkInfo
)
{
return
getTypeParameterLinks
(
linkInfo
,
true
);
}
...
...
@@ -215,8 +221,8 @@ public abstract class LinkFactory {
* the type parameters portion of the link.
* @return the links to the type parameters.
*/
public
LinkOutpu
t
getTypeParameterLinks
(
LinkInfo
linkInfo
,
boolean
isClassLabel
)
{
LinkOutput
output
=
getOutputInstance
();
public
Conten
t
getTypeParameterLinks
(
LinkInfo
linkInfo
,
boolean
isClassLabel
)
{
Content
links
=
newContent
();
Type
[]
vars
;
if
(
linkInfo
.
executableMemberDoc
!=
null
)
{
vars
=
linkInfo
.
executableMemberDoc
.
typeParameters
();
...
...
@@ -227,62 +233,42 @@ public abstract class LinkFactory {
vars
=
linkInfo
.
classDoc
.
typeParameters
();
}
else
{
//Nothing to document.
return
output
;
return
links
;
}
if
(((
linkInfo
.
includeTypeInClassLinkLabel
&&
isClassLabel
)
||
(
linkInfo
.
includeTypeAsSepLink
&&
!
isClassLabel
)
)
&&
vars
.
length
>
0
)
{
linkInfo
.
displayLength
+=
1
;
output
.
append
(
getLessThanString
()
);
links
.
addContent
(
"<"
);
for
(
int
i
=
0
;
i
<
vars
.
length
;
i
++)
{
if
(
i
>
0
)
{
linkInfo
.
displayLength
+=
1
;
output
.
append
(
","
);
links
.
addContent
(
","
);
}
output
.
append
(
getTypeParameterLink
(
linkInfo
,
vars
[
i
]));
links
.
addContent
(
getTypeParameterLink
(
linkInfo
,
vars
[
i
]));
}
linkInfo
.
displayLength
+=
1
;
output
.
append
(
getGreaterThanString
()
);
links
.
addContent
(
">"
);
}
return
output
;
return
links
;
}
public
LinkOutpu
t
getTypeAnnotationLinks
(
LinkInfo
linkInfo
)
{
LinkOutput
output
=
getOutputInstance
();
public
Conten
t
getTypeAnnotationLinks
(
LinkInfo
linkInfo
)
{
Content
links
=
newContent
();
if
(
linkInfo
.
type
.
asAnnotatedType
()
==
null
)
return
output
;
return
links
;
AnnotationDesc
[]
annotations
=
linkInfo
.
type
.
asAnnotatedType
().
annotations
();
for
(
int
i
=
0
;
i
<
annotations
.
length
;
i
++)
{
if
(
i
>
0
)
{
linkInfo
.
displayLength
+=
1
;
output
.
append
(
" "
);
links
.
addContent
(
" "
);
}
output
.
append
(
getTypeAnnotationLink
(
linkInfo
,
annotations
[
i
]));
links
.
addContent
(
getTypeAnnotationLink
(
linkInfo
,
annotations
[
i
]));
}
linkInfo
.
displayLength
+=
1
;
output
.
append
(
" "
);
return
output
;
}
/**
* Return &lt;, which is used in type parameters. Override this
* if your doclet uses something different.
*
* @return return &lt;, which is used in type parameters.
*/
protected
String
getLessThanString
()
{
return
"<"
;
}
/**
* Return &gt;, which is used in type parameters. Override this
* if your doclet uses something different.
*
* @return return &gt;, which is used in type parameters.
*/
protected
String
getGreaterThanString
()
{
return
">"
;
links
.
addContent
(
" "
);
return
links
;
}
}
test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java
浏览文件 @
e904244f
...
...
@@ -306,7 +306,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
// Handle multiple bounds.
//==============================================================
{
BUG_ID
+
FS
+
"pkg"
+
FS
+
"MultiTypeParameters.html"
,
"public <T extends java.lang.Number & java.lang.Runnable> T foo(T t)"
},
"public <T extends java.lang.Number &
amp;
java.lang.Runnable> T foo(T t)"
},
//==============================================================
// Test Class-Use Documenation for Type Parameters.
...
...
@@ -323,7 +323,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
"<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" "
+
"title=\"class in pkg2\">ClassUseTest1</a><T extends "
+
"<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo"
+
"</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">"
+
"</a> &
amp;
<a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">"
+
"Foo2</a>></strong></code> </td>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"Foo.html"
,
...
...
@@ -375,7 +375,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
"<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" "
+
"title=\"class in pkg2\">ClassUseTest1</a><T extends "
+
"<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo"
+
"</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">"
+
"</a> &
amp;
<a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">"
+
"Foo2</a>></strong></code> </td>"
},
{
BUG_ID
+
FS
+
"pkg2"
+
FS
+
"class-use"
+
FS
+
"Foo2.html"
,
...
...
test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java
浏览文件 @
e904244f
...
...
@@ -103,17 +103,17 @@ public class TestTypeAnnotations extends JavadocTester {
{
BUG_ID
+
FS
+
"typeannos"
+
FS
+
"Complex1.html"
,
"class <span class=\"strong\">Complex1<K extends <a href=\"../"
+
"typeannos/ClassParamA.html\" title=\"annotation in typeannos\">"
+
"@ClassParamA</a> java.lang.String & java.lang.Runnable></span>"
"@ClassParamA</a> java.lang.String &
amp;
java.lang.Runnable></span>"
},
{
BUG_ID
+
FS
+
"typeannos"
+
FS
+
"Complex2.html"
,
"class <span class=\"strong\">Complex2<K extends java.lang."
+
"String & <a href=\"../typeannos/ClassParamB.html\" title=\""
+
"String &
amp;
<a href=\"../typeannos/ClassParamB.html\" title=\""
+
"annotation in typeannos\">@ClassParamB</a> java.lang.Runnable></span>"
},
{
BUG_ID
+
FS
+
"typeannos"
+
FS
+
"ComplexBoth.html"
,
"class <span class=\"strong\">ComplexBoth<K extends <a href=\""
+
"../typeannos/ClassParamA.html\" title=\"annotation in typeannos\""
+
">@ClassParamA</a> java.lang.String & <a href=\"../typeannos/"
+
">@ClassParamA</a> java.lang.String &
amp;
<a href=\"../typeannos/"
+
"ClassParamA.html\" title=\"annotation in typeannos\">@ClassParamA"
+
"</a> java.lang.Runnable></span>"
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录