mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-16 10:17:23 +00:00
ICU-4195 doc tool cleanup for 3.2 release
X-SVN-Rev: 16730
This commit is contained in:
parent
d653aa2c58
commit
ad2a4971b9
1 changed files with 48 additions and 43 deletions
|
@ -165,8 +165,8 @@ public class CheckTags {
|
|||
} else if (option.equals("-brief")) {
|
||||
return 1;
|
||||
} else if (option.equals("-short")) {
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -181,8 +181,8 @@ public class CheckTags {
|
|||
} else if (opt.equals("-brief")) {
|
||||
this.brief = true;
|
||||
} else if (opt.equals("-short")) {
|
||||
this.isShort = true;
|
||||
}
|
||||
this.isShort = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -277,37 +277,38 @@ public class CheckTags {
|
|||
boolean isClass = doc.isClass() || doc.isInterface();
|
||||
String header;
|
||||
if (!isShort || isClass) {
|
||||
header = "--- ";
|
||||
header = "--- ";
|
||||
} else {
|
||||
header = "";
|
||||
header = "";
|
||||
}
|
||||
header += (isClass ? doc.qualifiedName() : doc.name());
|
||||
if (doc instanceof ExecutableMemberDoc) {
|
||||
header += ((ExecutableMemberDoc)doc).flatSignature();
|
||||
}
|
||||
if (!isShort || isClass) {
|
||||
header += " ---";
|
||||
header += " ---";
|
||||
}
|
||||
stack.push(header, isClass);
|
||||
if (log) {
|
||||
logln();
|
||||
}
|
||||
doTags(doc);
|
||||
if (isClass) {
|
||||
ClassDoc cdoc = (ClassDoc)doc;
|
||||
doDocs(cdoc.fields(), "Fields", !brief);
|
||||
doDocs(cdoc.constructors(), "Constructors", !brief);
|
||||
doDocs(cdoc.methods(), "Methods", !brief);
|
||||
}
|
||||
stack.pop();
|
||||
stack.push(header, isClass);
|
||||
if (log) {
|
||||
logln();
|
||||
}
|
||||
doTags(doc);
|
||||
if (isClass) {
|
||||
ClassDoc cdoc = (ClassDoc)doc;
|
||||
doDocs(cdoc.fields(), "Fields", !brief);
|
||||
doDocs(cdoc.constructors(), "Constructors", !brief);
|
||||
doDocs(cdoc.methods(), "Methods", !brief);
|
||||
}
|
||||
stack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
void doTags(ProgramElementDoc doc) {
|
||||
Tag[] tags = doc.tags();
|
||||
boolean foundRequiredTag = false;
|
||||
boolean foundDraftTag = false;
|
||||
boolean foundDeprecatedTag = false;
|
||||
boolean foundDraftTag = false;
|
||||
boolean foundDeprecatedTag = false;
|
||||
boolean foundObsoleteTag = false;
|
||||
|
||||
for (int i = 0; i < tags.length; ++i) {
|
||||
Tag tag = tags[i];
|
||||
|
@ -325,30 +326,31 @@ public class CheckTags {
|
|||
break;
|
||||
|
||||
case DRAFT:
|
||||
foundRequiredTag = true;
|
||||
foundDraftTag = true;
|
||||
if (tag.text().indexOf("ICU 2.4") != -1) {
|
||||
tagErr(tag);
|
||||
foundRequiredTag = true;
|
||||
foundDraftTag = true;
|
||||
if (tag.text().indexOf("ICU 2.4") != -1) {
|
||||
tagErr(tag);
|
||||
break;
|
||||
}
|
||||
if (tag.text().indexOf("ICU 2.6") != -1) {
|
||||
tagErr(tag);
|
||||
break;
|
||||
}
|
||||
if (tag.text().indexOf("ICU") != 0) {
|
||||
tagErr(tag);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (tag.text().indexOf("ICU 2.6") != -1) {
|
||||
tagErr(tag);
|
||||
break;
|
||||
}
|
||||
if (tag.text().indexOf("ICU") != 0) {
|
||||
tagErr(tag);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case DEPRECATED:
|
||||
foundDeprecatedTag = true;
|
||||
foundDeprecatedTag = true;
|
||||
if (tag.text().indexOf("ICU") == 0) {
|
||||
foundRequiredTag = true;
|
||||
}
|
||||
break;
|
||||
foundRequiredTag = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case OBSOLETE:
|
||||
foundObsoleteTag = true;
|
||||
if (tag.text().indexOf("ICU") != 0) {
|
||||
tagErr(tag);
|
||||
}
|
||||
|
@ -389,10 +391,13 @@ public class CheckTags {
|
|||
}
|
||||
}
|
||||
if (!foundRequiredTag) {
|
||||
errln("missing required tag [" + /*doc.position() +*/ "]");
|
||||
errln("missing required tag [" + doc.position() + "]");
|
||||
}
|
||||
if (foundDraftTag && !foundDeprecatedTag) {
|
||||
errln("draft tag missing deprecated");
|
||||
}
|
||||
if (foundObsoleteTag && !foundDeprecatedTag) {
|
||||
errln("obsolete tag missing deprecated");
|
||||
}
|
||||
if (foundDraftTag && !foundDeprecatedTag) {
|
||||
errln("draft tag missing deprecated");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue