Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
9d6c634c
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看板
提交
9d6c634c
编写于
5月 14, 2013
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8012174: {@literal} and {@code} should use \"new\" Taglet, not old.
Reviewed-by: darcy
上级
24d71a5d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
93 addition
and
92 deletion
+93
-92
src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java
.../com/sun/tools/doclets/formats/html/TagletWriterImpl.java
+29
-0
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java
...es/com/sun/tools/doclets/formats/html/markup/HtmlTag.java
+2
-1
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/CodeTaglet.java
...un/tools/doclets/internal/toolkit/taglets/CodeTaglet.java
+16
-17
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ExpertTaglet.java
.../tools/doclets/internal/toolkit/taglets/ExpertTaglet.java
+6
-21
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LiteralTaglet.java
...tools/doclets/internal/toolkit/taglets/LiteralTaglet.java
+11
-47
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
...tools/doclets/internal/toolkit/taglets/TagletManager.java
+3
-5
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java
.../tools/doclets/internal/toolkit/taglets/TagletWriter.java
+26
-1
未找到文件。
src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java
浏览文件 @
9d6c634c
...
...
@@ -26,6 +26,10 @@
package
com.sun.tools.doclets.formats.html
;
import
com.sun.javadoc.*
;
import
com.sun.tools.doclets.formats.html.markup.HtmlAttr
;
import
com.sun.tools.doclets.formats.html.markup.HtmlTag
;
import
com.sun.tools.doclets.formats.html.markup.HtmlTree
;
import
com.sun.tools.doclets.formats.html.markup.StringContent
;
import
com.sun.tools.doclets.internal.toolkit.*
;
import
com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder
;
import
com.sun.tools.doclets.internal.toolkit.taglets.*
;
...
...
@@ -62,6 +66,14 @@ public class TagletWriterImpl extends TagletWriter {
return
new
TagletOutputImpl
(
""
);
}
/**
* {@inheritDoc}
*/
protected
TagletOutput
codeTagOutput
(
Tag
tag
)
{
Content
result
=
HtmlTree
.
CODE
(
new
StringContent
(
tag
.
text
()));
return
new
TagletOutputImpl
(
result
.
toString
());
}
/**
* {@inheritDoc}
*/
...
...
@@ -118,6 +130,23 @@ public class TagletWriterImpl extends TagletWriter {
return
new
TagletOutputImpl
(
output
.
toString
());
}
/**
* {@inheritDoc}
*/
protected
TagletOutput
expertTagOutput
(
Tag
tag
)
{
HtmlTree
result
=
new
HtmlTree
(
HtmlTag
.
SUB
,
new
StringContent
(
tag
.
text
()));
result
.
addAttr
(
HtmlAttr
.
ID
,
"expert"
);
return
new
TagletOutputImpl
(
result
.
toString
());
}
/**
* {@inheritDoc}
*/
protected
TagletOutput
literalTagOutput
(
Tag
tag
)
{
Content
result
=
new
StringContent
(
tag
.
text
());
return
new
TagletOutputImpl
(
result
.
toString
());
}
/**
* {@inheritDoc}
*/
...
...
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java
浏览文件 @
9d6c634c
/*
* 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
...
...
@@ -75,6 +75,7 @@ public enum HtmlTag {
SMALL
(
BlockType
.
INLINE
,
EndTag
.
END
),
SPAN
(
BlockType
.
INLINE
,
EndTag
.
END
),
STRONG
(
BlockType
.
INLINE
,
EndTag
.
END
),
SUB
(
BlockType
.
INLINE
,
EndTag
.
END
),
TABLE
,
TBODY
,
TD
,
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/CodeTaglet.java
浏览文件 @
9d6c634c
/*
* 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
...
...
@@ -26,7 +26,6 @@ package com.sun.tools.doclets.internal.toolkit.taglets;
import
java.util.Map
;
import
com.sun.javadoc.Tag
;
import
com.sun.tools.doclets.Taglet
;
/**
* An inline Taglet used to denote literal code fragments.
...
...
@@ -49,23 +48,23 @@ import com.sun.tools.doclets.Taglet;
* @since 1.5
*/
public
class
CodeTaglet
extends
Literal
Taglet
{
public
class
CodeTaglet
extends
BaseInline
Taglet
{
private
static
final
String
NAME
=
"code"
;
private
static
final
String
NAME
=
"code"
;
public
static
void
register
(
Map
<
String
,
Taglet
>
map
)
{
map
.
remove
(
NAME
);
map
.
put
(
NAME
,
new
CodeTaglet
());
}
public
static
void
register
(
Map
<
String
,
Taglet
>
map
)
{
map
.
remove
(
NAME
);
map
.
put
(
NAME
,
new
CodeTaglet
());
}
public
String
getName
()
{
return
NAME
;
}
public
String
getName
()
{
return
NAME
;
}
/
*
* Wraps @literal's result in a <code> element.
*/
public
String
toString
(
Tag
tag
)
{
return
"<code>"
+
super
.
toString
(
tag
)
+
"</code>"
;
}
/*
*
* {@inheritDoc}
*/
public
TagletOutput
getTagletOutput
(
Tag
tag
,
TagletWriter
writer
)
{
return
writer
.
codeTagOutput
(
tag
)
;
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ExpertTaglet.java
浏览文件 @
9d6c634c
...
...
@@ -27,7 +27,6 @@ package com.sun.tools.doclets.internal.toolkit.taglets;
import
java.util.Map
;
import
com.sun.tools.doclets.Taglet
;
import
com.sun.javadoc.Tag
;
/**
...
...
@@ -39,11 +38,9 @@ import com.sun.javadoc.Tag;
* deletion without notice.</b>
*
*/
public
class
ExpertTaglet
implements
Taglet
{
public
class
ExpertTaglet
extends
Base
Taglet
{
private
static
final
String
NAME
=
"expert"
;
private
static
final
String
START_TAG
=
"<sub id=\"expert\">"
;
private
static
final
String
END_TAG
=
"</sub>"
;
/**
* {@inheritDoc}
...
...
@@ -85,22 +82,10 @@ public class ExpertTaglet implements Taglet {
map
.
put
(
NAME
,
new
ExpertTaglet
());
}
public
String
toString
(
Tag
tag
)
{
return
(
tag
.
text
()
==
null
||
tag
.
text
().
length
()
==
0
)
?
null
:
START_TAG
+
LiteralTaglet
.
textToString
(
tag
.
text
())
+
END_TAG
;
}
public
String
toString
(
Tag
[]
tags
)
{
if
(
tags
==
null
||
tags
.
length
==
0
)
return
null
;
StringBuffer
sb
=
new
StringBuffer
(
START_TAG
);
for
(
Tag
t:
tags
)
{
sb
.
append
(
LiteralTaglet
.
textToString
(
t
.
text
()));
}
sb
.
append
(
END_TAG
);
return
sb
.
toString
();
/**
* {@inheritDoc}
*/
public
TagletOutput
getTagletOutput
(
Tag
tag
,
TagletWriter
writer
)
{
return
writer
.
expertTagOutput
(
tag
);
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LiteralTaglet.java
浏览文件 @
9d6c634c
/*
* 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
...
...
@@ -25,8 +25,9 @@
package
com.sun.tools.doclets.internal.toolkit.taglets
;
import
java.util.Map
;
import
com.sun.javadoc.Doc
;
import
com.sun.javadoc.Tag
;
import
com.sun.tools.doclets.Taglet
;
/**
...
...
@@ -47,60 +48,23 @@ import com.sun.tools.doclets.Taglet;
* @since 1.5
*/
public
class
LiteralTaglet
implements
Taglet
{
public
class
LiteralTaglet
extends
BaseInline
Taglet
{
private
static
final
String
NAME
=
"literal"
;
public
static
void
register
(
Map
<
String
,
Taglet
>
map
)
{
map
.
remove
(
NAME
);
map
.
put
(
NAME
,
new
LiteralTaglet
());
public
static
void
register
(
Map
<
String
,
Taglet
>
map
)
{
map
.
remove
(
NAME
);
map
.
put
(
NAME
,
new
LiteralTaglet
());
}
public
String
getName
()
{
return
NAME
;
}
public
String
toString
(
Tag
tag
)
{
return
textToString
(
tag
.
text
());
}
public
String
toString
(
Tag
[]
tags
)
{
return
null
;
}
public
boolean
inField
()
{
return
false
;
}
public
boolean
inConstructor
()
{
return
false
;
}
public
boolean
inMethod
()
{
return
false
;
}
public
boolean
inOverview
()
{
return
false
;
}
public
boolean
inPackage
()
{
return
false
;
}
public
boolean
inType
()
{
return
false
;
}
public
boolean
isInlineTag
()
{
return
true
;
}
/*
* Replace occurrences of the following characters: < > &
/**
* {@inheritDoc}
*/
protected
static
String
textToString
(
String
text
)
{
StringBuilder
buf
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
text
.
length
();
i
++)
{
char
c
=
text
.
charAt
(
i
);
switch
(
c
)
{
case
'<'
:
buf
.
append
(
"<"
);
break
;
case
'>'
:
buf
.
append
(
">"
);
break
;
case
'&'
:
buf
.
append
(
"&"
);
break
;
default
:
buf
.
append
(
c
);
}
}
return
buf
.
toString
();
public
TagletOutput
getTagletOutput
(
Tag
tag
,
TagletWriter
writer
)
{
return
writer
.
literalTagOutput
(
tag
);
}
}
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
浏览文件 @
9d6c634c
...
...
@@ -659,10 +659,8 @@ public class TagletManager {
customTags
.
put
((
temp
=
new
DocRootTaglet
()).
getName
(),
temp
);
customTags
.
put
((
temp
=
new
InheritDocTaglet
()).
getName
(),
temp
);
customTags
.
put
((
temp
=
new
ValueTaglet
()).
getName
(),
temp
);
customTags
.
put
((
temp
=
new
LegacyTaglet
(
new
LiteralTaglet
())).
getName
(),
temp
);
customTags
.
put
((
temp
=
new
LegacyTaglet
(
new
CodeTaglet
())).
getName
(),
temp
);
customTags
.
put
((
temp
=
new
LiteralTaglet
()).
getName
(),
temp
);
customTags
.
put
((
temp
=
new
CodeTaglet
()).
getName
(),
temp
);
//Keep track of the names of standard tags for error
//checking purposes.
...
...
@@ -705,7 +703,7 @@ public class TagletManager {
SimpleTaglet
.
FIELD
+
SimpleTaglet
.
METHOD
)).
getName
(),
temp
);
customTags
.
put
((
temp
=
new
SimpleTaglet
(
"treatAsPrivate"
,
null
,
SimpleTaglet
.
FIELD
+
SimpleTaglet
.
METHOD
+
SimpleTaglet
.
TYPE
)).
getName
(),
temp
);
customTags
.
put
((
temp
=
new
LegacyTaglet
(
new
ExpertTaglet
()
)).
getName
(),
temp
);
customTags
.
put
((
temp
=
new
ExpertTaglet
(
)).
getName
(),
temp
);
standardTags
.
add
(
"propertyGetter"
);
standardTags
.
add
(
"propertySetter"
);
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java
浏览文件 @
9d6c634c
...
...
@@ -53,10 +53,18 @@ public abstract class TagletWriter {
}
/**
* @return an instance of
the
output object.
* @return an instance of
an
output object.
*/
public
abstract
TagletOutput
getOutputInstance
();
/**
* Return the output for a {@code...} tag.
*
* @param tag the tag.
* @return the output of the taglet.
*/
protected
abstract
TagletOutput
codeTagOutput
(
Tag
tag
);
/**
* Returns the output for the DocRoot inline tag.
* @return the output for the DocRoot inline tag.
...
...
@@ -71,6 +79,23 @@ public abstract class TagletWriter {
*/
protected
abstract
TagletOutput
deprecatedTagOutput
(
Doc
doc
);
/**
* Return the output for a {@expert...} tag.
*
* @param tag the tag.
* @return the output of the taglet.
*/
// TODO: remove this taglet
protected
abstract
TagletOutput
expertTagOutput
(
Tag
tag
);
/**
* Return the output for a {@literal...} tag.
*
* @param tag the tag.
* @return the output of the taglet.
*/
protected
abstract
TagletOutput
literalTagOutput
(
Tag
tag
);
/**
* Returns {@link MessageRetriever} for output purposes.
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录