Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
255f9ddd
提交
255f9ddd
authored
4月 02, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improved Javadoc navigation (similar to Scaladoc).
上级
5c0fc070
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
125 行增加
和
132 行删除
+125
-132
LinkChecker.java
h2/src/tools/org/h2/build/doc/LinkChecker.java
+1
-1
Doclet.java
h2/src/tools/org/h2/build/doclet/Doclet.java
+124
-131
没有找到文件。
h2/src/tools/org/h2/build/doc/LinkChecker.java
浏览文件 @
255f9ddd
...
@@ -80,7 +80,7 @@ public class LinkChecker {
...
@@ -80,7 +80,7 @@ public class LinkChecker {
if
(!
link
.
startsWith
(
"http"
)
&&
!
link
.
endsWith
(
"h2.pdf"
)
if
(!
link
.
startsWith
(
"http"
)
&&
!
link
.
endsWith
(
"h2.pdf"
)
&&
link
.
indexOf
(
"_ja."
)
<
0
)
{
&&
link
.
indexOf
(
"_ja."
)
<
0
)
{
if
(
targets
.
get
(
link
)
==
null
)
{
if
(
targets
.
get
(
link
)
==
null
)
{
errors
.
add
(
links
.
get
(
link
)
+
":
missing link
"
+
link
);
errors
.
add
(
links
.
get
(
link
)
+
":
link missing
"
+
link
);
}
}
}
}
}
}
...
...
h2/src/tools/org/h2/build/doclet/Doclet.java
浏览文件 @
255f9ddd
...
@@ -89,12 +89,14 @@ public class Doclet {
...
@@ -89,12 +89,14 @@ public class Doclet {
"lang=\""
+
language
+
"\" xml:lang=\""
+
language
+
"\">"
);
"lang=\""
+
language
+
"\" xml:lang=\""
+
language
+
"\">"
);
writer
.
println
(
"<head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" /><title>"
);
writer
.
println
(
"<head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" /><title>"
);
writer
.
println
(
className
);
writer
.
println
(
className
);
writer
.
println
(
"</title><link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" /></head><body>"
);
writer
.
println
(
"</title><link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" />"
);
writer
.
println
(
"<script type=\"text/javascript\" src=\"../../../animate.js\"></script>"
);
writer
.
println
(
"</head><body onload=\"openLink();\">"
);
writer
.
println
(
"<table class=\"content\"><tr class=\"content\"><td class=\"content\"><div class=\"contentDiv\">"
);
writer
.
println
(
"<table class=\"content\"><tr class=\"content\"><td class=\"content\"><div class=\"contentDiv\">"
);
writer
.
println
(
"<h1>"
+
className
+
"</h1>"
);
writer
.
println
(
"<h1>"
+
className
+
"</h1>"
);
writer
.
println
(
formatText
(
clazz
.
commentText
())
+
"<br /><br />"
);
writer
.
println
(
formatText
(
clazz
.
commentText
())
+
"<br /><br />"
);
// method
overview
// method
s
MethodDoc
[]
methods
=
clazz
.
methods
();
MethodDoc
[]
methods
=
clazz
.
methods
();
Arrays
.
sort
(
methods
,
new
Comparator
()
{
Arrays
.
sort
(
methods
,
new
Comparator
()
{
public
int
compare
(
Object
a
,
Object
b
)
{
public
int
compare
(
Object
a
,
Object
b
)
{
...
@@ -103,6 +105,7 @@ public class Doclet {
...
@@ -103,6 +105,7 @@ public class Doclet {
});
});
ArrayList
signatures
=
new
ArrayList
();
ArrayList
signatures
=
new
ArrayList
();
boolean
hasMethods
=
false
;
boolean
hasMethods
=
false
;
int
id
=
0
;
for
(
int
i
=
0
;
i
<
methods
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
methods
.
length
;
i
++)
{
MethodDoc
method
=
methods
[
i
];
MethodDoc
method
=
methods
[
i
];
String
name
=
method
.
name
();
String
name
=
method
.
name
();
...
@@ -110,11 +113,11 @@ public class Doclet {
...
@@ -110,11 +113,11 @@ public class Doclet {
continue
;
continue
;
}
}
if
(!
hasMethods
)
{
if
(!
hasMethods
)
{
writer
.
println
(
"<table
><tr
><th colspan=\"2\">Methods</th></tr>"
);
writer
.
println
(
"<table
class=\"block\"><tr onclick=\"return allDetails()\"
><th colspan=\"2\">Methods</th></tr>"
);
hasMethods
=
true
;
hasMethods
=
true
;
}
}
String
type
=
getTypeName
(
method
.
isStatic
(),
method
.
returnType
());
String
type
=
getTypeName
(
method
.
isStatic
(),
method
.
returnType
());
writer
.
println
(
"<tr><td class=\"return\">"
+
type
+
"</td><td class=\"method\">"
);
writer
.
println
(
"<tr
id=\"tm"
+
id
+
"\" onclick=\"return on('m"
+
id
+
"')\"
><td class=\"return\">"
+
type
+
"</td><td class=\"method\">"
);
Parameter
[]
params
=
method
.
parameters
();
Parameter
[]
params
=
method
.
parameters
();
StringBuffer
buff
=
new
StringBuffer
();
StringBuffer
buff
=
new
StringBuffer
();
StringBuffer
buffSignature
=
new
StringBuffer
(
name
);
StringBuffer
buffSignature
=
new
StringBuffer
(
name
);
...
@@ -147,6 +150,12 @@ public class Doclet {
...
@@ -147,6 +150,12 @@ public class Doclet {
writer
.
println
(
"<div class=\"methodText\">"
+
formatText
(
firstSentence
)
+
"</div>"
);
writer
.
println
(
"<div class=\"methodText\">"
+
formatText
(
firstSentence
)
+
"</div>"
);
}
}
writer
.
println
(
"</td></tr>"
);
writer
.
println
(
"</td></tr>"
);
writer
.
println
(
"<tr onclick=\"return off('m"
+
id
+
"')\" class=\"detail\" id=\"m"
+
id
+
"\">"
);
writer
.
println
(
"<td class=\"return\">"
+
type
+
"</td><td>"
);
writer
.
println
(
"<a name=\""
+
signature
+
"\"></a>"
);
writeMethodDetails
(
writer
,
clazz
,
method
,
signature
);
writer
.
println
(
"</td></tr>"
);
id
++;
}
}
if
(
hasMethods
)
{
if
(
hasMethods
)
{
writer
.
println
(
"</table>"
);
writer
.
println
(
"</table>"
);
...
@@ -198,16 +207,57 @@ public class Doclet {
...
@@ -198,16 +207,57 @@ public class Doclet {
writer
.
println
(
"</table>"
);
writer
.
println
(
"</table>"
);
}
}
// method details
// field details
for
(
int
i
=
0
;
i
<
methods
.
length
;
i
++)
{
Arrays
.
sort
(
fields
,
new
Comparator
()
{
MethodDoc
method
=
methods
[
i
];
public
int
compare
(
Object
a
,
Object
b
)
{
FieldDoc
fa
=
(
FieldDoc
)
a
;
FieldDoc
fb
=
(
FieldDoc
)
b
;
String
ca
=
fa
.
constantValueExpression
();
String
cb
=
fb
.
constantValueExpression
();
if
(
ca
!=
null
&&
cb
!=
null
)
{
return
ca
.
compareTo
(
cb
);
}
return
fa
.
name
().
compareTo
(
fb
.
name
());
}
});
for
(
int
i
=
0
;
i
<
fields
.
length
;
i
++)
{
FieldDoc
field
=
fields
[
i
];
writeFieldDetails
(
writer
,
clazz
,
field
);
}
writer
.
println
(
"</div></td></tr></table></body></html>"
);
writer
.
close
();
out
.
close
();
}
private
void
writeFieldDetails
(
PrintWriter
writer
,
ClassDoc
clazz
,
FieldDoc
field
)
{
if
(
skipField
(
clazz
,
field
))
{
return
;
}
String
text
=
field
.
commentText
();
if
(
text
.
startsWith
(
"INTERNAL"
))
{
return
;
}
String
name
=
field
.
name
();
String
constant
=
field
.
constantValueExpression
();
String
link
=
getFieldLink
(
text
,
constant
,
clazz
,
name
);
writer
.
println
(
"<a name=\""
+
link
+
"\"></a>"
);
writer
.
println
(
"<h4><span class=\"methodName\">"
+
name
);
if
(
constant
==
null
)
{
writer
.
println
();
}
else
{
writer
.
println
(
" = "
+
constant
);
}
writer
.
println
(
"</span></h4>"
);
writer
.
println
(
"<div class=\"item\">"
+
formatText
(
text
)
+
"</div>"
);
writer
.
println
(
"<hr />"
);
}
private
void
writeMethodDetails
(
PrintWriter
writer
,
ClassDoc
clazz
,
MethodDoc
method
,
String
signature
)
{
String
name
=
method
.
name
();
String
name
=
method
.
name
();
if
(
skipMethod
(
method
))
{
if
(
skipMethod
(
method
))
{
continue
;
return
;
}
}
String
type
=
getTypeName
(
method
.
isStatic
(),
method
.
returnType
());
String
signature
=
(
String
)
signatures
.
get
(
i
);
writer
.
println
(
"<a name=\""
+
signature
+
"\"></a>"
);
Parameter
[]
params
=
method
.
parameters
();
Parameter
[]
params
=
method
.
parameters
();
StringBuffer
buff
=
new
StringBuffer
();
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
'('
);
buff
.
append
(
'('
);
...
@@ -233,14 +283,12 @@ public class Doclet {
...
@@ -233,14 +283,12 @@ public class Doclet {
if
(
isDeprecated
(
method
))
{
if
(
isDeprecated
(
method
))
{
name
=
"<span class=\"deprecated\">"
+
name
+
"</span>"
;
name
=
"<span class=\"deprecated\">"
+
name
+
"</span>"
;
}
}
writer
.
println
(
"<h4>"
+
type
+
" <span class=\"methodName\">"
+
name
+
"</span>"
+
buff
.
toString
()
writer
.
println
(
"<a href=\"#"
+
signature
+
"\">"
+
name
+
"</a>"
+
buff
.
toString
());
+
"</h4>"
);
boolean
hasComment
=
method
.
commentText
()
!=
null
&&
method
.
commentText
().
trim
().
length
()
!=
0
;
boolean
hasComment
=
method
.
commentText
()
!=
null
&&
method
.
commentText
().
trim
().
length
()
!=
0
;
writer
.
println
(
formatText
(
method
.
commentText
())
);
writer
.
println
(
"<div class=\"methodText\">"
+
formatText
(
method
.
commentText
())
+
"</div>"
);
ParamTag
[]
paramTags
=
method
.
paramTags
();
ParamTag
[]
paramTags
=
method
.
paramTags
();
ThrowsTag
[]
throwsTags
=
method
.
throwsTags
();
ThrowsTag
[]
throwsTags
=
method
.
throwsTags
();
boolean
hasThrowsTag
=
throwsTags
!=
null
&&
throwsTags
.
length
>
0
;
boolean
hasThrowsTag
=
throwsTags
!=
null
&&
throwsTags
.
length
>
0
;
boolean
space
=
false
;
if
(
paramTags
.
length
!=
params
.
length
)
{
if
(
paramTags
.
length
!=
params
.
length
)
{
if
(
hasComment
&&
!
method
.
commentText
().
startsWith
(
"["
)
&&
!
hasThrowsTag
)
{
if
(
hasComment
&&
!
method
.
commentText
().
startsWith
(
"["
)
&&
!
hasThrowsTag
)
{
// [Not supported] and such are not problematic
// [Not supported] and such are not problematic
...
@@ -250,10 +298,6 @@ public class Doclet {
...
@@ -250,10 +298,6 @@ public class Doclet {
}
}
}
}
for
(
int
j
=
0
;
j
<
paramTags
.
length
;
j
++)
{
for
(
int
j
=
0
;
j
<
paramTags
.
length
;
j
++)
{
if
(!
space
)
{
writer
.
println
(
"<br /><br />"
);
space
=
true
;
}
String
paramName
=
paramTags
[
j
].
parameterName
();
String
paramName
=
paramTags
[
j
].
parameterName
();
String
comment
=
paramTags
[
j
].
parameterComment
();
String
comment
=
paramTags
[
j
].
parameterComment
();
if
(
comment
.
trim
().
length
()
==
0
)
{
if
(
comment
.
trim
().
length
()
==
0
)
{
...
@@ -268,10 +312,6 @@ public class Doclet {
...
@@ -268,10 +312,6 @@ public class Doclet {
}
}
Tag
[]
returnTags
=
method
.
tags
(
"return"
);
Tag
[]
returnTags
=
method
.
tags
(
"return"
);
if
(
returnTags
!=
null
&&
returnTags
.
length
>
0
)
{
if
(
returnTags
!=
null
&&
returnTags
.
length
>
0
)
{
if
(!
space
)
{
writer
.
println
(
"<br /><br />"
);
space
=
true
;
}
writer
.
println
(
"<div class=\"itemTitle\">Returns:</div>"
);
writer
.
println
(
"<div class=\"itemTitle\">Returns:</div>"
);
String
returnComment
=
returnTags
[
0
].
text
();
String
returnComment
=
returnTags
[
0
].
text
();
if
(
returnComment
.
trim
().
length
()
==
0
)
{
if
(
returnComment
.
trim
().
length
()
==
0
)
{
...
@@ -288,10 +328,6 @@ public class Doclet {
...
@@ -288,10 +328,6 @@ public class Doclet {
}
}
}
}
if
(
hasThrowsTag
)
{
if
(
hasThrowsTag
)
{
if
(!
space
)
{
writer
.
println
(
"<br /><br />"
);
space
=
true
;
}
writer
.
println
(
"<div class=\"itemTitle\">Throws:</div>"
);
writer
.
println
(
"<div class=\"itemTitle\">Throws:</div>"
);
for
(
int
j
=
0
;
j
<
throwsTags
.
length
;
j
++)
{
for
(
int
j
=
0
;
j
<
throwsTags
.
length
;
j
++)
{
String
p
=
throwsTags
[
j
].
exceptionName
();
String
p
=
throwsTags
[
j
].
exceptionName
();
...
@@ -302,49 +338,6 @@ public class Doclet {
...
@@ -302,49 +338,6 @@ public class Doclet {
writer
.
println
(
"<div class=\"item\">"
+
p
+
"</div>"
);
writer
.
println
(
"<div class=\"item\">"
+
p
+
"</div>"
);
}
}
}
}
writer
.
println
(
"<hr />"
);
}
// field details
Arrays
.
sort
(
fields
,
new
Comparator
()
{
public
int
compare
(
Object
a
,
Object
b
)
{
FieldDoc
fa
=
(
FieldDoc
)
a
;
FieldDoc
fb
=
(
FieldDoc
)
b
;
String
ca
=
fa
.
constantValueExpression
();
String
cb
=
fb
.
constantValueExpression
();
if
(
ca
!=
null
&&
cb
!=
null
)
{
return
ca
.
compareTo
(
cb
);
}
return
fa
.
name
().
compareTo
(
fb
.
name
());
}
});
for
(
int
i
=
0
;
i
<
fields
.
length
;
i
++)
{
FieldDoc
field
=
fields
[
i
];
if
(
skipField
(
clazz
,
field
))
{
continue
;
}
String
text
=
field
.
commentText
();
if
(
text
.
startsWith
(
"INTERNAL"
))
{
continue
;
}
String
name
=
field
.
name
();
String
constant
=
field
.
constantValueExpression
();
String
link
=
getFieldLink
(
text
,
constant
,
clazz
,
name
);
writer
.
println
(
"<a name=\""
+
link
+
"\"></a>"
);
writer
.
println
(
"<h4><span class=\"methodName\">"
+
name
);
if
(
constant
==
null
)
{
writer
.
println
();
}
else
{
writer
.
println
(
" = "
+
constant
);
}
writer
.
println
(
"</span></h4>"
);
writer
.
println
(
"<div class=\"item\">"
+
formatText
(
text
)
+
"</div>"
);
writer
.
println
(
"<hr />"
);
}
writer
.
println
(
"</div></td></tr></table></body></html>"
);
writer
.
close
();
out
.
close
();
}
}
private
String
getFieldLink
(
String
text
,
String
constant
,
ClassDoc
clazz
,
String
name
)
{
private
String
getFieldLink
(
String
text
,
String
constant
,
ClassDoc
clazz
,
String
name
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论