6657907: javadoc has unchecked warnings
Reviewed-by: bpatel
This commit is contained in:
parent
43dbd05dde
commit
a6f6acaf27
@ -345,18 +345,18 @@ public abstract class AbstractMemberWriter {
|
|||||||
/**
|
/**
|
||||||
* Print use info.
|
* Print use info.
|
||||||
*/
|
*/
|
||||||
protected void printUseInfo(Object mems, String heading) {
|
protected void printUseInfo(List<? extends ProgramElementDoc> mems, String heading) {
|
||||||
if (mems == null) {
|
if (mems == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List members = (List)mems;
|
List<? extends ProgramElementDoc> members = mems;
|
||||||
if (members.size() > 0) {
|
if (members.size() > 0) {
|
||||||
writer.tableIndexSummary();
|
writer.tableIndexSummary();
|
||||||
writer.tableUseInfoHeaderStart("#CCCCFF");
|
writer.tableUseInfoHeaderStart("#CCCCFF");
|
||||||
writer.print(heading);
|
writer.print(heading);
|
||||||
writer.tableHeaderEnd();
|
writer.tableHeaderEnd();
|
||||||
for (Iterator it = members.iterator(); it.hasNext(); ) {
|
for (Iterator<? extends ProgramElementDoc> it = members.iterator(); it.hasNext(); ) {
|
||||||
ProgramElementDoc pgmdoc = (ProgramElementDoc)it.next();
|
ProgramElementDoc pgmdoc = it.next();
|
||||||
ClassDoc cd = pgmdoc.containingClass();
|
ClassDoc cd = pgmdoc.containingClass();
|
||||||
|
|
||||||
writer.printSummaryLinkType(this, pgmdoc);
|
writer.printSummaryLinkType(this, pgmdoc);
|
||||||
|
@ -39,28 +39,28 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
|||||||
|
|
||||||
final ClassDoc classdoc;
|
final ClassDoc classdoc;
|
||||||
Set pkgToPackageAnnotations = null;
|
Set pkgToPackageAnnotations = null;
|
||||||
final Map pkgToClassTypeParameter;
|
final Map<String,List<ProgramElementDoc>> pkgToClassTypeParameter;
|
||||||
final Map pkgToClassAnnotations;
|
final Map<String,List<ProgramElementDoc>> pkgToClassAnnotations;
|
||||||
final Map pkgToMethodTypeParameter;
|
final Map<String,List<ProgramElementDoc>> pkgToMethodTypeParameter;
|
||||||
final Map pkgToMethodArgTypeParameter;
|
final Map<String,List<ProgramElementDoc>> pkgToMethodArgTypeParameter;
|
||||||
final Map pkgToMethodReturnTypeParameter;
|
final Map<String,List<ProgramElementDoc>> pkgToMethodReturnTypeParameter;
|
||||||
final Map pkgToMethodAnnotations;
|
final Map<String,List<ProgramElementDoc>> pkgToMethodAnnotations;
|
||||||
final Map pkgToMethodParameterAnnotations;
|
final Map<String,List<ProgramElementDoc>> pkgToMethodParameterAnnotations;
|
||||||
final Map pkgToFieldTypeParameter;
|
final Map<String,List<ProgramElementDoc>> pkgToFieldTypeParameter;
|
||||||
final Map pkgToFieldAnnotations;
|
final Map<String,List<ProgramElementDoc>> pkgToFieldAnnotations;
|
||||||
final Map pkgToSubclass;
|
final Map<String,List<ProgramElementDoc>> pkgToSubclass;
|
||||||
final Map pkgToSubinterface;
|
final Map<String,List<ProgramElementDoc>> pkgToSubinterface;
|
||||||
final Map pkgToImplementingClass;
|
final Map<String,List<ProgramElementDoc>> pkgToImplementingClass;
|
||||||
final Map pkgToField;
|
final Map<String,List<ProgramElementDoc>> pkgToField;
|
||||||
final Map pkgToMethodReturn;
|
final Map<String,List<ProgramElementDoc>> pkgToMethodReturn;
|
||||||
final Map pkgToMethodArgs;
|
final Map<String,List<ProgramElementDoc>> pkgToMethodArgs;
|
||||||
final Map pkgToMethodThrows;
|
final Map<String,List<ProgramElementDoc>> pkgToMethodThrows;
|
||||||
final Map pkgToConstructorAnnotations;
|
final Map<String,List<ProgramElementDoc>> pkgToConstructorAnnotations;
|
||||||
final Map pkgToConstructorParameterAnnotations;
|
final Map<String,List<ProgramElementDoc>> pkgToConstructorParameterAnnotations;
|
||||||
final Map pkgToConstructorArgs;
|
final Map<String,List<ProgramElementDoc>> pkgToConstructorArgs;
|
||||||
final Map pkgToConstructorArgTypeParameter;
|
final Map<String,List<ProgramElementDoc>> pkgToConstructorArgTypeParameter;
|
||||||
final Map pkgToConstructorThrows;
|
final Map<String,List<ProgramElementDoc>> pkgToConstructorThrows;
|
||||||
final SortedSet pkgSet;
|
final SortedSet<PackageDoc> pkgSet;
|
||||||
final MethodWriterImpl methodSubWriter;
|
final MethodWriterImpl methodSubWriter;
|
||||||
final ConstructorWriterImpl constrSubWriter;
|
final ConstructorWriterImpl constrSubWriter;
|
||||||
final FieldWriterImpl fieldSubWriter;
|
final FieldWriterImpl fieldSubWriter;
|
||||||
@ -81,9 +81,9 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
|||||||
super(configuration, path, filename, relpath);
|
super(configuration, path, filename, relpath);
|
||||||
this.classdoc = classdoc;
|
this.classdoc = classdoc;
|
||||||
if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName()))
|
if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName()))
|
||||||
pkgToPackageAnnotations = new HashSet((List) mapper.classToPackageAnnotations.get(classdoc.qualifiedName()));
|
pkgToPackageAnnotations = new HashSet<PackageDoc>(mapper.classToPackageAnnotations.get(classdoc.qualifiedName()));
|
||||||
configuration.currentcd = classdoc;
|
configuration.currentcd = classdoc;
|
||||||
this.pkgSet = new TreeSet();
|
this.pkgSet = new TreeSet<PackageDoc>();
|
||||||
this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam);
|
this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam);
|
||||||
this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations);
|
this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations);
|
||||||
this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam);
|
this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam);
|
||||||
@ -135,19 +135,19 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map pkgDivide(Map classMap) {
|
private Map<String,List<ProgramElementDoc>> pkgDivide(Map<String,? extends List<? extends ProgramElementDoc>> classMap) {
|
||||||
Map map = new HashMap();
|
Map<String,List<ProgramElementDoc>> map = new HashMap<String,List<ProgramElementDoc>>();
|
||||||
List list= (List)classMap.get(classdoc.qualifiedName());
|
List<? extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName());
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
Collections.sort(list);
|
Collections.sort(list);
|
||||||
Iterator it = list.iterator();
|
Iterator<? extends ProgramElementDoc> it = list.iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
ProgramElementDoc doc = (ProgramElementDoc)it.next();
|
ProgramElementDoc doc = it.next();
|
||||||
PackageDoc pkg = doc.containingPackage();
|
PackageDoc pkg = doc.containingPackage();
|
||||||
pkgSet.add(pkg);
|
pkgSet.add(pkg);
|
||||||
List inPkg = (List)map.get(pkg.name());
|
List<ProgramElementDoc> inPkg = map.get(pkg.name());
|
||||||
if (inPkg == null) {
|
if (inPkg == null) {
|
||||||
inPkg = new ArrayList();
|
inPkg = new ArrayList<ProgramElementDoc>();
|
||||||
map.put(pkg.name(), inPkg);
|
map.put(pkg.name(), inPkg);
|
||||||
}
|
}
|
||||||
inPkg.add(doc);
|
inPkg.add(doc);
|
||||||
|
@ -253,7 +253,7 @@ public class ConfigurationImpl extends Configuration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (root.specifiedClasses().length > 0) {
|
if (root.specifiedClasses().length > 0) {
|
||||||
Map map = new HashMap();
|
Map<String,PackageDoc> map = new HashMap<String,PackageDoc>();
|
||||||
PackageDoc pd;
|
PackageDoc pd;
|
||||||
ClassDoc[] classes = root.classes();
|
ClassDoc[] classes = root.classes();
|
||||||
for (int i = 0; i < classes.length; i++) {
|
for (int i = 0; i < classes.length; i++) {
|
||||||
@ -481,7 +481,7 @@ public class ConfigurationImpl extends Configuration {
|
|||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public Comparator getMemberComparator() {
|
public Comparator<ProgramElementDoc> getMemberComparator() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
|
|||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName, Set printedPackageHeaders) {
|
public void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName, Set<String> printedPackageHeaders) {
|
||||||
String packageName = pkg.name();
|
String packageName = pkg.name();
|
||||||
//add link to summary
|
//add link to summary
|
||||||
li();
|
li();
|
||||||
|
@ -55,10 +55,10 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
|
|||||||
super(writer, classDoc);
|
super(writer, classDoc);
|
||||||
VisibleMemberMap visibleMemberMap = new VisibleMemberMap(classDoc,
|
VisibleMemberMap visibleMemberMap = new VisibleMemberMap(classDoc,
|
||||||
VisibleMemberMap.CONSTRUCTORS, configuration().nodeprecated);
|
VisibleMemberMap.CONSTRUCTORS, configuration().nodeprecated);
|
||||||
List constructors = new ArrayList(visibleMemberMap.getMembersFor(classDoc));
|
List<ProgramElementDoc> constructors = new ArrayList<ProgramElementDoc>(visibleMemberMap.getMembersFor(classDoc));
|
||||||
for (int i = 0; i < constructors.size(); i++) {
|
for (int i = 0; i < constructors.size(); i++) {
|
||||||
if (((ProgramElementDoc)(constructors.get(i))).isProtected() ||
|
if ((constructors.get(i)).isProtected() ||
|
||||||
((ProgramElementDoc)(constructors.get(i))).isPrivate()) {
|
(constructors.get(i)).isPrivate()) {
|
||||||
setFoundNonPubConstructor(true);
|
setFoundNonPubConstructor(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1463,7 +1463,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
|||||||
int originalLength = result.length();
|
int originalLength = result.length();
|
||||||
TagletOutput output = TagletWriter.getInlineTagOuput(
|
TagletOutput output = TagletWriter.getInlineTagOuput(
|
||||||
configuration.tagletManager, holderTag,
|
configuration.tagletManager, holderTag,
|
||||||
(Tag) tagelem, getTagletWriterInstance(isFirstSentence));
|
tagelem, getTagletWriterInstance(isFirstSentence));
|
||||||
result.append(output == null ? "" : output.toString());
|
result.append(output == null ? "" : output.toString());
|
||||||
if (originalLength == 0 && isFirstSentence && tagelem.name().equals("@inheritDoc") && result.length() > 0) {
|
if (originalLength == 0 && isFirstSentence && tagelem.name().equals("@inheritDoc") && result.length() > 0) {
|
||||||
break;
|
break;
|
||||||
@ -1750,8 +1750,8 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
|||||||
* @return an array of strings representing the annotations being
|
* @return an array of strings representing the annotations being
|
||||||
* documented.
|
* documented.
|
||||||
*/
|
*/
|
||||||
private List getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak) {
|
private List<String> getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak) {
|
||||||
List results = new ArrayList();
|
List<String> results = new ArrayList<String>();
|
||||||
StringBuffer annotation;
|
StringBuffer annotation;
|
||||||
for (int i = 0; i < descList.length; i++) {
|
for (int i = 0; i < descList.length; i++) {
|
||||||
AnnotationTypeDoc annotationDoc = descList[i].annotationType();
|
AnnotationTypeDoc annotationDoc = descList[i].annotationType();
|
||||||
@ -1781,7 +1781,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
|||||||
pairs[j].element(), pairs[j].element().name(), false));
|
pairs[j].element(), pairs[j].element().name(), false));
|
||||||
annotation.append('=');
|
annotation.append('=');
|
||||||
AnnotationValue annotationValue = pairs[j].value();
|
AnnotationValue annotationValue = pairs[j].value();
|
||||||
List annotationTypeValues = new ArrayList();
|
List<AnnotationValue> annotationTypeValues = new ArrayList<AnnotationValue>();
|
||||||
if (annotationValue.value() instanceof AnnotationValue[]) {
|
if (annotationValue.value() instanceof AnnotationValue[]) {
|
||||||
AnnotationValue[] annotationArray =
|
AnnotationValue[] annotationArray =
|
||||||
(AnnotationValue[]) annotationValue.value();
|
(AnnotationValue[]) annotationValue.value();
|
||||||
|
@ -90,7 +90,7 @@ public class HtmlSerialMethodWriter extends MethodWriterImpl implements
|
|||||||
tagletManager.getSerializedFormTags(),
|
tagletManager.getSerializedFormTags(),
|
||||||
writer.getTagletWriterInstance(false), output);
|
writer.getTagletWriterInstance(false), output);
|
||||||
print(output.toString());
|
print(output.toString());
|
||||||
MethodDoc method = (MethodDoc)member;
|
MethodDoc method = member;
|
||||||
if (method.name().compareTo("writeExternal") == 0
|
if (method.name().compareTo("writeExternal") == 0
|
||||||
&& method.tags("serialData").length == 0) {
|
&& method.tags("serialData").length == 0) {
|
||||||
serialWarning(member.position(), "doclet.MissingSerialDataTag",
|
serialWarning(member.position(), "doclet.MissingSerialDataTag",
|
||||||
|
@ -73,7 +73,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
|
|||||||
super(configuration, DirectoryManager.getDirectoryPath(packageDoc), OUTPUT_FILE_NAME, DirectoryManager.getRelativePath(packageDoc));
|
super(configuration, DirectoryManager.getDirectoryPath(packageDoc), OUTPUT_FILE_NAME, DirectoryManager.getRelativePath(packageDoc));
|
||||||
this.packageDoc = packageDoc;
|
this.packageDoc = packageDoc;
|
||||||
if (configuration.root.specifiedPackages().length == 0) {
|
if (configuration.root.specifiedPackages().length == 0) {
|
||||||
documentedClasses = new HashSet(Arrays.asList(configuration.root.classes()));
|
documentedClasses = new HashSet<ClassDoc>(Arrays.asList(configuration.root.classes()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
|
|||||||
*
|
*
|
||||||
* @see Group
|
* @see Group
|
||||||
*/
|
*/
|
||||||
private Map groupPackageMap;
|
private Map<String,List<PackageDoc>> groupPackageMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List to store the order groups as specified on the command line.
|
* List to store the order groups as specified on the command line.
|
||||||
@ -120,10 +120,9 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
|
|||||||
protected void generateIndex() {
|
protected void generateIndex() {
|
||||||
for (int i = 0; i < groupList.size(); i++) {
|
for (int i = 0; i < groupList.size(); i++) {
|
||||||
String groupname = (String)groupList.get(i);
|
String groupname = (String)groupList.get(i);
|
||||||
List list = (List)groupPackageMap.get(groupname);
|
List<PackageDoc> list = groupPackageMap.get(groupname);
|
||||||
if (list != null && list.size() > 0) {
|
if (list != null && list.size() > 0) {
|
||||||
printIndexContents((PackageDoc[])list.
|
printIndexContents(list.toArray(new PackageDoc[list.size()]),
|
||||||
toArray(new PackageDoc[list.size()]),
|
|
||||||
groupname);
|
groupname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ import java.util.*;
|
|||||||
public class PackageUseWriter extends SubWriterHolderWriter {
|
public class PackageUseWriter extends SubWriterHolderWriter {
|
||||||
|
|
||||||
final PackageDoc pkgdoc;
|
final PackageDoc pkgdoc;
|
||||||
final SortedMap usingPackageToUsedClasses = new TreeMap();
|
final SortedMap<String,Set<ClassDoc>> usingPackageToUsedClasses = new TreeMap<String,Set<ClassDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@ -61,15 +61,15 @@ public class PackageUseWriter extends SubWriterHolderWriter {
|
|||||||
ClassDoc[] content = pkgdoc.allClasses();
|
ClassDoc[] content = pkgdoc.allClasses();
|
||||||
for (int i = 0; i < content.length; ++i) {
|
for (int i = 0; i < content.length; ++i) {
|
||||||
ClassDoc usedClass = content[i];
|
ClassDoc usedClass = content[i];
|
||||||
Set usingClasses = (Set)mapper.classToClass.get(usedClass.qualifiedName());
|
Set<ClassDoc> usingClasses = mapper.classToClass.get(usedClass.qualifiedName());
|
||||||
if (usingClasses != null) {
|
if (usingClasses != null) {
|
||||||
for (Iterator it = usingClasses.iterator(); it.hasNext(); ) {
|
for (Iterator it = usingClasses.iterator(); it.hasNext(); ) {
|
||||||
ClassDoc usingClass = (ClassDoc)it.next();
|
ClassDoc usingClass = (ClassDoc)it.next();
|
||||||
PackageDoc usingPackage = usingClass.containingPackage();
|
PackageDoc usingPackage = usingClass.containingPackage();
|
||||||
Set usedClasses = (Set)usingPackageToUsedClasses
|
Set<ClassDoc> usedClasses = usingPackageToUsedClasses
|
||||||
.get(usingPackage.name());
|
.get(usingPackage.name());
|
||||||
if (usedClasses == null) {
|
if (usedClasses == null) {
|
||||||
usedClasses = new TreeSet();
|
usedClasses = new TreeSet<ClassDoc>();
|
||||||
usingPackageToUsedClasses.put(Util.getPackageName(usingPackage),
|
usingPackageToUsedClasses.put(Util.getPackageName(usingPackage),
|
||||||
usedClasses);
|
usedClasses);
|
||||||
}
|
}
|
||||||
|
@ -120,12 +120,12 @@ public abstract class Configuration {
|
|||||||
/**
|
/**
|
||||||
* The list of doc-file subdirectories to exclude
|
* The list of doc-file subdirectories to exclude
|
||||||
*/
|
*/
|
||||||
protected Set excludedDocFileDirs;
|
protected Set<String> excludedDocFileDirs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The list of qualifiers to exclude
|
* The list of qualifiers to exclude
|
||||||
*/
|
*/
|
||||||
protected Set excludedQualifiers;
|
protected Set<String> excludedQualifiers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Root of the generated Program Structure from the Doclet API.
|
* The Root of the generated Program Structure from the Doclet API.
|
||||||
@ -255,8 +255,8 @@ public abstract class Configuration {
|
|||||||
message =
|
message =
|
||||||
new MessageRetriever(this,
|
new MessageRetriever(this,
|
||||||
"com.sun.tools.doclets.internal.toolkit.resources.doclets");
|
"com.sun.tools.doclets.internal.toolkit.resources.doclets");
|
||||||
excludedDocFileDirs = new HashSet();
|
excludedDocFileDirs = new HashSet<String>();
|
||||||
excludedQualifiers = new HashSet();
|
excludedQualifiers = new HashSet<String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -329,14 +329,14 @@ public abstract class Configuration {
|
|||||||
DocErrorReporter reporter);
|
DocErrorReporter reporter);
|
||||||
|
|
||||||
private void initPackageArray() {
|
private void initPackageArray() {
|
||||||
Set set = new HashSet(Arrays.asList(root.specifiedPackages()));
|
Set<PackageDoc> set = new HashSet<PackageDoc>(Arrays.asList(root.specifiedPackages()));
|
||||||
ClassDoc[] classes = root.specifiedClasses();
|
ClassDoc[] classes = root.specifiedClasses();
|
||||||
for (int i = 0; i < classes.length; i++) {
|
for (int i = 0; i < classes.length; i++) {
|
||||||
set.add(classes[i].containingPackage());
|
set.add(classes[i].containingPackage());
|
||||||
}
|
}
|
||||||
ArrayList results = new ArrayList(set);
|
ArrayList<PackageDoc> results = new ArrayList<PackageDoc>(set);
|
||||||
Collections.sort(results);
|
Collections.sort(results);
|
||||||
packages = (PackageDoc[]) results.toArray(new PackageDoc[] {});
|
packages = results.toArray(new PackageDoc[] {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -345,7 +345,7 @@ public abstract class Configuration {
|
|||||||
* @param options the two dimensional array of options.
|
* @param options the two dimensional array of options.
|
||||||
*/
|
*/
|
||||||
public void setOptions(String[][] options) {
|
public void setOptions(String[][] options) {
|
||||||
LinkedHashSet customTagStrs = new LinkedHashSet();
|
LinkedHashSet<String[]> customTagStrs = new LinkedHashSet<String[]>();
|
||||||
for (int oi = 0; oi < options.length; ++oi) {
|
for (int oi = 0; oi < options.length; ++oi) {
|
||||||
String[] os = options[oi];
|
String[] os = options[oi];
|
||||||
String opt = os[0].toLowerCase();
|
String opt = os[0].toLowerCase();
|
||||||
@ -476,7 +476,7 @@ public abstract class Configuration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addToSet(Set s, String str){
|
private void addToSet(Set<String> s, String str){
|
||||||
StringTokenizer st = new StringTokenizer(str, ":");
|
StringTokenizer st = new StringTokenizer(str, ":");
|
||||||
String current;
|
String current;
|
||||||
while(st.hasMoreTokens()){
|
while(st.hasMoreTokens()){
|
||||||
@ -712,5 +712,5 @@ public abstract class Configuration {
|
|||||||
*
|
*
|
||||||
* @return the {@link java.util.Comparator} used to sort members.
|
* @return the {@link java.util.Comparator} used to sort members.
|
||||||
*/
|
*/
|
||||||
public abstract Comparator getMemberComparator();
|
public abstract Comparator<ProgramElementDoc> getMemberComparator();
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ public interface ConstantsSummaryWriter {
|
|||||||
* something more than once.
|
* something more than once.
|
||||||
*/
|
*/
|
||||||
public abstract void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName,
|
public abstract void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName,
|
||||||
Set WriteedPackageHeaders);
|
Set<String> WriteedPackageHeaders);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write the given package name.
|
* Write the given package name.
|
||||||
|
@ -61,7 +61,7 @@ public abstract class AbstractBuilder {
|
|||||||
* efficiency purposes. We don't want to copy the
|
* efficiency purposes. We don't want to copy the
|
||||||
* doc files multiple times for a single package.
|
* doc files multiple times for a single package.
|
||||||
*/
|
*/
|
||||||
protected static Set containingPackagesSeen;
|
protected static Set<String> containingPackagesSeen;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if we want to print debug output.
|
* True if we want to print debug output.
|
||||||
|
@ -84,7 +84,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
|
|||||||
builder.annotationTypeDoc = annotationTypeDoc;
|
builder.annotationTypeDoc = annotationTypeDoc;
|
||||||
builder.writer = writer;
|
builder.writer = writer;
|
||||||
if(containingPackagesSeen == null) {
|
if(containingPackagesSeen == null) {
|
||||||
containingPackagesSeen = new HashSet();
|
containingPackagesSeen = new HashSet<String>();
|
||||||
}
|
}
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ public class AnnotationTypeOptionalMemberBuilder extends
|
|||||||
builder.writer = writer;
|
builder.writer = writer;
|
||||||
builder.visibleMemberMap = new VisibleMemberMap(classDoc,
|
builder.visibleMemberMap = new VisibleMemberMap(classDoc,
|
||||||
VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL, configuration.nodeprecated);
|
VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL, configuration.nodeprecated);
|
||||||
builder.members = new ArrayList(
|
builder.members = new ArrayList<ProgramElementDoc>(
|
||||||
builder.visibleMemberMap.getMembersFor(classDoc));
|
builder.visibleMemberMap.getMembersFor(classDoc));
|
||||||
if (configuration.getMemberComparator() != null) {
|
if (configuration.getMemberComparator() != null) {
|
||||||
Collections.sort(builder.members,
|
Collections.sort(builder.members,
|
||||||
|
@ -62,7 +62,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
|
|||||||
/**
|
/**
|
||||||
* The list of members being documented.
|
* The list of members being documented.
|
||||||
*/
|
*/
|
||||||
protected List members;
|
protected List<ProgramElementDoc> members;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The index of the current member that is being documented at this point
|
* The index of the current member that is being documented at this point
|
||||||
@ -97,7 +97,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
|
|||||||
builder.writer = writer;
|
builder.writer = writer;
|
||||||
builder.visibleMemberMap = new VisibleMemberMap(classDoc,
|
builder.visibleMemberMap = new VisibleMemberMap(classDoc,
|
||||||
VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED, configuration.nodeprecated);
|
VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED, configuration.nodeprecated);
|
||||||
builder.members = new ArrayList(
|
builder.members = new ArrayList<ProgramElementDoc>(
|
||||||
builder.visibleMemberMap.getMembersFor(classDoc));
|
builder.visibleMemberMap.getMembersFor(classDoc));
|
||||||
if (configuration.getMemberComparator() != null) {
|
if (configuration.getMemberComparator() != null) {
|
||||||
Collections.sort(builder.members,
|
Collections.sort(builder.members,
|
||||||
|
@ -100,7 +100,7 @@ public class ClassBuilder extends AbstractBuilder {
|
|||||||
Util.setEnumDocumentation(configuration, classDoc);
|
Util.setEnumDocumentation(configuration, classDoc);
|
||||||
}
|
}
|
||||||
if(containingPackagesSeen == null) {
|
if(containingPackagesSeen == null) {
|
||||||
containingPackagesSeen = new HashSet();
|
containingPackagesSeen = new HashSet<String>();
|
||||||
}
|
}
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
@ -63,12 +63,12 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
|
|||||||
/**
|
/**
|
||||||
* The set of ClassDocs that have constant fields.
|
* The set of ClassDocs that have constant fields.
|
||||||
*/
|
*/
|
||||||
protected Set classDocsWithConstFields;
|
protected Set<ClassDoc> classDocsWithConstFields;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The set of printed package headers.
|
* The set of printed package headers.
|
||||||
*/
|
*/
|
||||||
protected Set printedPackageHeaders;
|
protected Set<String> printedPackageHeaders;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current package being documented.
|
* The current package being documented.
|
||||||
@ -102,7 +102,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
|
|||||||
ConstantsSummaryBuilder builder = new ConstantsSummaryBuilder(
|
ConstantsSummaryBuilder builder = new ConstantsSummaryBuilder(
|
||||||
configuration);
|
configuration);
|
||||||
builder.writer = writer;
|
builder.writer = writer;
|
||||||
builder.classDocsWithConstFields = new HashSet();
|
builder.classDocsWithConstFields = new HashSet<ClassDoc>();
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
|
|||||||
public void buildContents() {
|
public void buildContents() {
|
||||||
writer.writeContentsHeader();
|
writer.writeContentsHeader();
|
||||||
PackageDoc[] packages = configuration.packages;
|
PackageDoc[] packages = configuration.packages;
|
||||||
printedPackageHeaders = new HashSet();
|
printedPackageHeaders = new HashSet<String>();
|
||||||
for (int i = 0; i < packages.length; i++) {
|
for (int i = 0; i < packages.length; i++) {
|
||||||
if (hasConstantField(packages[i]) && ! hasPrintedPackageIndex(packages[i].name())) {
|
if (hasConstantField(packages[i]) && ! hasPrintedPackageIndex(packages[i].name())) {
|
||||||
writer.writeLinkToPackageContent(packages[i],
|
writer.writeLinkToPackageContent(packages[i],
|
||||||
@ -188,7 +188,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
|
|||||||
*/
|
*/
|
||||||
public void buildConstantSummaries(List elements) {
|
public void buildConstantSummaries(List elements) {
|
||||||
PackageDoc[] packages = configuration.packages;
|
PackageDoc[] packages = configuration.packages;
|
||||||
printedPackageHeaders = new HashSet();
|
printedPackageHeaders = new HashSet<String>();
|
||||||
for (int i = 0; i < packages.length; i++) {
|
for (int i = 0; i < packages.length; i++) {
|
||||||
if (hasConstantField(packages[i])) {
|
if (hasConstantField(packages[i])) {
|
||||||
currentPackage = packages[i];
|
currentPackage = packages[i];
|
||||||
@ -315,7 +315,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
|
|||||||
* @param pkgname the name of the package to check.
|
* @param pkgname the name of the package to check.
|
||||||
*/
|
*/
|
||||||
private boolean hasPrintedPackageIndex(String pkgname) {
|
private boolean hasPrintedPackageIndex(String pkgname) {
|
||||||
String[] list = (String[])printedPackageHeaders.toArray(new String[] {});
|
String[] list = printedPackageHeaders.toArray(new String[] {});
|
||||||
for (int i = 0; i < list.length; i++) {
|
for (int i = 0; i < list.length; i++) {
|
||||||
if (pkgname.startsWith(list[i])) {
|
if (pkgname.startsWith(list[i])) {
|
||||||
return true;
|
return true;
|
||||||
@ -363,7 +363,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
|
|||||||
* Builds the table of constants for a given class.
|
* Builds the table of constants for a given class.
|
||||||
*/
|
*/
|
||||||
protected void buildMembersSummary() {
|
protected void buildMembersSummary() {
|
||||||
List members = new ArrayList(members());
|
List<FieldDoc> members = new ArrayList<FieldDoc>(members());
|
||||||
if (members.size() > 0) {
|
if (members.size() > 0) {
|
||||||
Collections.sort(members);
|
Collections.sort(members);
|
||||||
writer.writeConstantMembers(classdoc, members);
|
writer.writeConstantMembers(classdoc, members);
|
||||||
@ -375,17 +375,17 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
|
|||||||
* @param cd the classdoc to examine.
|
* @param cd the classdoc to examine.
|
||||||
* @return the list of visible constant fields for the given classdoc.
|
* @return the list of visible constant fields for the given classdoc.
|
||||||
*/
|
*/
|
||||||
protected List members() {
|
protected List<FieldDoc> members() {
|
||||||
List l = visibleMemberMapFields.getLeafClassMembers(configuration);
|
List<ProgramElementDoc> l = visibleMemberMapFields.getLeafClassMembers(configuration);
|
||||||
l.addAll(visibleMemberMapEnumConst.getLeafClassMembers(configuration));
|
l.addAll(visibleMemberMapEnumConst.getLeafClassMembers(configuration));
|
||||||
Iterator iter;
|
Iterator<ProgramElementDoc> iter;
|
||||||
|
|
||||||
if(l != null){
|
if(l != null){
|
||||||
iter = l.iterator();
|
iter = l.iterator();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
List inclList = new LinkedList();
|
List<FieldDoc> inclList = new LinkedList<FieldDoc>();
|
||||||
FieldDoc member;
|
FieldDoc member;
|
||||||
while(iter.hasNext()){
|
while(iter.hasNext()){
|
||||||
member = (FieldDoc)iter.next();
|
member = (FieldDoc)iter.next();
|
||||||
|
@ -72,7 +72,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
|
|||||||
/**
|
/**
|
||||||
* The constructors being documented.
|
* The constructors being documented.
|
||||||
*/
|
*/
|
||||||
private List constructors;
|
private List<ProgramElementDoc> constructors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a new ConstructorBuilder.
|
* Construct a new ConstructorBuilder.
|
||||||
@ -104,12 +104,10 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
|
|||||||
VisibleMemberMap.CONSTRUCTORS,
|
VisibleMemberMap.CONSTRUCTORS,
|
||||||
configuration.nodeprecated);
|
configuration.nodeprecated);
|
||||||
builder.constructors =
|
builder.constructors =
|
||||||
new ArrayList(builder.visibleMemberMap.getMembersFor(classDoc));
|
new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getMembersFor(classDoc));
|
||||||
for (int i = 0; i < builder.constructors.size(); i++) {
|
for (int i = 0; i < builder.constructors.size(); i++) {
|
||||||
if (((ProgramElementDoc) (builder.constructors.get(i)))
|
if (builder.constructors.get(i).isProtected()
|
||||||
.isProtected()
|
|| builder.constructors.get(i).isPrivate()) {
|
||||||
|| ((ProgramElementDoc) (builder.constructors.get(i)))
|
|
||||||
.isPrivate()) {
|
|
||||||
writer.setFoundNonPubConstructor(true);
|
writer.setFoundNonPubConstructor(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
|
|||||||
/**
|
/**
|
||||||
* The list of enum constants being documented.
|
* The list of enum constants being documented.
|
||||||
*/
|
*/
|
||||||
private List enumConstants;
|
private List<ProgramElementDoc> enumConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The index of the current enum constant that is being documented at this point
|
* The index of the current enum constant that is being documented at this point
|
||||||
@ -99,7 +99,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
|
|||||||
VisibleMemberMap.ENUM_CONSTANTS,
|
VisibleMemberMap.ENUM_CONSTANTS,
|
||||||
configuration.nodeprecated);
|
configuration.nodeprecated);
|
||||||
builder.enumConstants =
|
builder.enumConstants =
|
||||||
new ArrayList(builder.visibleMemberMap.getMembersFor(classDoc));
|
new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getMembersFor(classDoc));
|
||||||
if (configuration.getMemberComparator() != null) {
|
if (configuration.getMemberComparator() != null) {
|
||||||
Collections.sort(
|
Collections.sort(
|
||||||
builder.enumConstants,
|
builder.enumConstants,
|
||||||
|
@ -61,7 +61,7 @@ public class FieldBuilder extends AbstractMemberBuilder {
|
|||||||
/**
|
/**
|
||||||
* The list of fields being documented.
|
* The list of fields being documented.
|
||||||
*/
|
*/
|
||||||
private List fields;
|
private List<ProgramElementDoc> fields;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The index of the current field that is being documented at this point
|
* The index of the current field that is being documented at this point
|
||||||
@ -99,7 +99,7 @@ public class FieldBuilder extends AbstractMemberBuilder {
|
|||||||
VisibleMemberMap.FIELDS,
|
VisibleMemberMap.FIELDS,
|
||||||
configuration.nodeprecated);
|
configuration.nodeprecated);
|
||||||
builder.fields =
|
builder.fields =
|
||||||
new ArrayList(builder.visibleMemberMap.getLeafClassMembers(
|
new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getLeafClassMembers(
|
||||||
configuration));
|
configuration));
|
||||||
if (configuration.getMemberComparator() != null) {
|
if (configuration.getMemberComparator() != null) {
|
||||||
Collections.sort(
|
Collections.sort(
|
||||||
|
@ -45,7 +45,7 @@ public class LayoutParser extends DefaultHandler {
|
|||||||
/**
|
/**
|
||||||
* The map of XML elements that have been parsed.
|
* The map of XML elements that have been parsed.
|
||||||
*/
|
*/
|
||||||
private Map xmlElementsMap;
|
private Map<String,List<Object>> xmlElementsMap;
|
||||||
|
|
||||||
private Configuration configuration;
|
private Configuration configuration;
|
||||||
private static LayoutParser instance;
|
private static LayoutParser instance;
|
||||||
@ -56,7 +56,7 @@ public class LayoutParser extends DefaultHandler {
|
|||||||
* This class is a singleton.
|
* This class is a singleton.
|
||||||
*/
|
*/
|
||||||
private LayoutParser(Configuration configuration) {
|
private LayoutParser(Configuration configuration) {
|
||||||
xmlElementsMap = new HashMap();
|
xmlElementsMap = new HashMap<String,List<Object>>();
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ public class LayoutParser extends DefaultHandler {
|
|||||||
return (List) xmlElementsMap.get(root);
|
return (List) xmlElementsMap.get(root);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
List xmlElements = new ArrayList();
|
List<Object> xmlElements = new ArrayList<Object>();
|
||||||
xmlElementsMap.put(root, xmlElements);
|
xmlElementsMap.put(root, xmlElements);
|
||||||
currentRoot = root;
|
currentRoot = root;
|
||||||
isParsing = false;
|
isParsing = false;
|
||||||
@ -106,7 +106,7 @@ public class LayoutParser extends DefaultHandler {
|
|||||||
throws SAXException {
|
throws SAXException {
|
||||||
if (isParsing || qName.equals(currentRoot)) {
|
if (isParsing || qName.equals(currentRoot)) {
|
||||||
isParsing = true;
|
isParsing = true;
|
||||||
List xmlElements = (List) xmlElementsMap.get(currentRoot);
|
List<Object> xmlElements = xmlElementsMap.get(currentRoot);
|
||||||
xmlElements.add(qName);
|
xmlElements.add(qName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -120,11 +120,11 @@ public class LayoutParser extends DefaultHandler {
|
|||||||
isParsing = false;
|
isParsing = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List xmlElements = (List) xmlElementsMap.get(currentRoot);
|
List<Object> xmlElements = xmlElementsMap.get(currentRoot);
|
||||||
if (xmlElements.get(xmlElements.size()-1).equals(qName)) {
|
if (xmlElements.get(xmlElements.size()-1).equals(qName)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
List subElements = new ArrayList();
|
List<Object> subElements = new ArrayList<Object>();
|
||||||
int targetIndex = xmlElements.indexOf(qName);
|
int targetIndex = xmlElements.indexOf(qName);
|
||||||
int size = xmlElements.size();
|
int size = xmlElements.size();
|
||||||
for (int i = targetIndex; i < size; i++) {
|
for (int i = targetIndex; i < size; i++) {
|
||||||
|
@ -306,13 +306,13 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
|
|||||||
*/
|
*/
|
||||||
private void buildSummary(MemberSummaryWriter writer,
|
private void buildSummary(MemberSummaryWriter writer,
|
||||||
VisibleMemberMap visibleMemberMap) {
|
VisibleMemberMap visibleMemberMap) {
|
||||||
List members = new ArrayList(visibleMemberMap.getLeafClassMembers(
|
List<ProgramElementDoc> members = new ArrayList<ProgramElementDoc>(visibleMemberMap.getLeafClassMembers(
|
||||||
configuration));
|
configuration));
|
||||||
if (members.size() > 0) {
|
if (members.size() > 0) {
|
||||||
Collections.sort(members);
|
Collections.sort(members);
|
||||||
writer.writeMemberSummaryHeader(classDoc);
|
writer.writeMemberSummaryHeader(classDoc);
|
||||||
for (int i = 0; i < members.size(); i++) {
|
for (int i = 0; i < members.size(); i++) {
|
||||||
ProgramElementDoc member = (ProgramElementDoc) members.get(i);
|
ProgramElementDoc member = members.get(i);
|
||||||
Tag[] firstSentenceTags = member.firstSentenceTags();
|
Tag[] firstSentenceTags = member.firstSentenceTags();
|
||||||
if (member instanceof MethodDoc && firstSentenceTags.length == 0) {
|
if (member instanceof MethodDoc && firstSentenceTags.length == 0) {
|
||||||
//Inherit comments from overriden or implemented method if
|
//Inherit comments from overriden or implemented method if
|
||||||
@ -349,7 +349,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
|
|||||||
if (inhclass == classDoc) {
|
if (inhclass == classDoc) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
List inhmembers = visibleMemberMap.getMembersFor(inhclass);
|
List<ProgramElementDoc> inhmembers = visibleMemberMap.getMembersFor(inhclass);
|
||||||
if (inhmembers.size() > 0) {
|
if (inhmembers.size() > 0) {
|
||||||
Collections.sort(inhmembers);
|
Collections.sort(inhmembers);
|
||||||
writer.writeInheritedMemberSummaryHeader(inhclass);
|
writer.writeInheritedMemberSummaryHeader(inhclass);
|
||||||
@ -358,7 +358,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
|
|||||||
inhclass.isPackagePrivate() &&
|
inhclass.isPackagePrivate() &&
|
||||||
! Util.isLinkable(inhclass, configuration) ?
|
! Util.isLinkable(inhclass, configuration) ?
|
||||||
classDoc : inhclass,
|
classDoc : inhclass,
|
||||||
(ProgramElementDoc) inhmembers.get(j),
|
inhmembers.get(j),
|
||||||
j == 0,
|
j == 0,
|
||||||
j == inhmembers.size() - 1);
|
j == inhmembers.size() - 1);
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ public class MethodBuilder extends AbstractMemberBuilder {
|
|||||||
/**
|
/**
|
||||||
* The methods being documented.
|
* The methods being documented.
|
||||||
*/
|
*/
|
||||||
private List methods;
|
private List<ProgramElementDoc> methods;
|
||||||
|
|
||||||
private MethodBuilder(Configuration configuration) {
|
private MethodBuilder(Configuration configuration) {
|
||||||
super(configuration);
|
super(configuration);
|
||||||
@ -94,7 +94,7 @@ public class MethodBuilder extends AbstractMemberBuilder {
|
|||||||
VisibleMemberMap.METHODS,
|
VisibleMemberMap.METHODS,
|
||||||
configuration.nodeprecated);
|
configuration.nodeprecated);
|
||||||
builder.methods =
|
builder.methods =
|
||||||
new ArrayList(builder.visibleMemberMap.getLeafClassMembers(
|
new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getLeafClassMembers(
|
||||||
configuration));
|
configuration));
|
||||||
if (configuration.getMemberComparator() != null) {
|
if (configuration.getMemberComparator() != null) {
|
||||||
Collections.sort(
|
Collections.sort(
|
||||||
|
@ -26,6 +26,7 @@ package com.sun.tools.doclets.internal.toolkit.taglets;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import com.sun.javadoc.Tag;
|
import com.sun.javadoc.Tag;
|
||||||
|
import com.sun.tools.doclets.Taglet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An inline Taglet used to denote literal code fragments.
|
* An inline Taglet used to denote literal code fragments.
|
||||||
@ -47,7 +48,7 @@ public class CodeTaglet extends LiteralTaglet {
|
|||||||
|
|
||||||
private static final String NAME = "code";
|
private static final String NAME = "code";
|
||||||
|
|
||||||
public static void register(Map map) {
|
public static void register(Map<String, Taglet> map) {
|
||||||
map.remove(NAME);
|
map.remove(NAME);
|
||||||
map.put(NAME, new CodeTaglet());
|
map.put(NAME, new CodeTaglet());
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public class LiteralTaglet implements Taglet {
|
|||||||
|
|
||||||
private static final String NAME = "literal";
|
private static final String NAME = "literal";
|
||||||
|
|
||||||
public static void register(Map map) {
|
public static void register(Map<String,Taglet> map) {
|
||||||
map.remove(NAME);
|
map.remove(NAME);
|
||||||
map.put(NAME, new LiteralTaglet());
|
map.put(NAME, new LiteralTaglet());
|
||||||
}
|
}
|
||||||
|
@ -56,11 +56,11 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
|
|||||||
* check.
|
* check.
|
||||||
* @return a name-rank number map.
|
* @return a name-rank number map.
|
||||||
*/
|
*/
|
||||||
private static Map getRankMap(Object[] params){
|
private static Map<String,String> getRankMap(Object[] params){
|
||||||
if (params == null) {
|
if (params == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
HashMap result = new HashMap();
|
HashMap<String,String> result = new HashMap<String,String>();
|
||||||
for (int i = 0; i < params.length; i++) {
|
for (int i = 0; i < params.length; i++) {
|
||||||
String name = params[i] instanceof Parameter ?
|
String name = params[i] instanceof Parameter ?
|
||||||
((Parameter) params[i]).name() :
|
((Parameter) params[i]).name() :
|
||||||
@ -192,7 +192,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
|
|||||||
private TagletOutput getTagletOutput(boolean isNonTypeParams, Doc holder,
|
private TagletOutput getTagletOutput(boolean isNonTypeParams, Doc holder,
|
||||||
TagletWriter writer, Object[] formalParameters, ParamTag[] paramTags) {
|
TagletWriter writer, Object[] formalParameters, ParamTag[] paramTags) {
|
||||||
TagletOutput result = writer.getOutputInstance();
|
TagletOutput result = writer.getOutputInstance();
|
||||||
Set alreadyDocumented = new HashSet();
|
Set<String> alreadyDocumented = new HashSet<String>();
|
||||||
if (paramTags.length > 0) {
|
if (paramTags.length > 0) {
|
||||||
result.appendOutput(
|
result.appendOutput(
|
||||||
processParamTags(isNonTypeParams, paramTags,
|
processParamTags(isNonTypeParams, paramTags,
|
||||||
@ -214,7 +214,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
|
|||||||
*/
|
*/
|
||||||
private TagletOutput getInheritedTagletOutput(boolean isNonTypeParams, Doc holder,
|
private TagletOutput getInheritedTagletOutput(boolean isNonTypeParams, Doc holder,
|
||||||
TagletWriter writer, Object[] formalParameters,
|
TagletWriter writer, Object[] formalParameters,
|
||||||
Set alreadyDocumented) {
|
Set<String> alreadyDocumented) {
|
||||||
TagletOutput result = writer.getOutputInstance();
|
TagletOutput result = writer.getOutputInstance();
|
||||||
if ((! alreadyDocumented.contains(null)) &&
|
if ((! alreadyDocumented.contains(null)) &&
|
||||||
holder instanceof MethodDoc) {
|
holder instanceof MethodDoc) {
|
||||||
@ -263,7 +263,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
|
|||||||
*/
|
*/
|
||||||
private TagletOutput processParamTags(boolean isNonTypeParams,
|
private TagletOutput processParamTags(boolean isNonTypeParams,
|
||||||
ParamTag[] paramTags, Map rankMap, TagletWriter writer,
|
ParamTag[] paramTags, Map rankMap, TagletWriter writer,
|
||||||
Set alreadyDocumented) {
|
Set<String> alreadyDocumented) {
|
||||||
TagletOutput result = writer.getOutputInstance();
|
TagletOutput result = writer.getOutputInstance();
|
||||||
if (paramTags.length > 0) {
|
if (paramTags.length > 0) {
|
||||||
for (int i = 0; i < paramTags.length; ++i) {
|
for (int i = 0; i < paramTags.length; ++i) {
|
||||||
|
@ -61,7 +61,7 @@ public class TagletManager {
|
|||||||
/**
|
/**
|
||||||
* The map of custom tags.
|
* The map of custom tags.
|
||||||
*/
|
*/
|
||||||
private LinkedHashMap customTags;
|
private LinkedHashMap<String,Taglet> customTags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The array of custom tags that can appear in packages.
|
* The array of custom tags that can appear in packages.
|
||||||
@ -111,31 +111,31 @@ public class TagletManager {
|
|||||||
/**
|
/**
|
||||||
* Keep track of standard tags.
|
* Keep track of standard tags.
|
||||||
*/
|
*/
|
||||||
private Set standardTags;
|
private Set<String> standardTags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keep track of standard tags in lowercase to compare for better
|
* Keep track of standard tags in lowercase to compare for better
|
||||||
* error messages when a tag like @docRoot is mistakenly spelled
|
* error messages when a tag like @docRoot is mistakenly spelled
|
||||||
* lowercase @docroot.
|
* lowercase @docroot.
|
||||||
*/
|
*/
|
||||||
private Set standardTagsLowercase;
|
private Set<String> standardTagsLowercase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keep track of overriden standard tags.
|
* Keep track of overriden standard tags.
|
||||||
*/
|
*/
|
||||||
private Set overridenStandardTags;
|
private Set<String> overridenStandardTags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keep track of the tags that may conflict
|
* Keep track of the tags that may conflict
|
||||||
* with standard tags in the future (any custom tag without
|
* with standard tags in the future (any custom tag without
|
||||||
* a period in its name).
|
* a period in its name).
|
||||||
*/
|
*/
|
||||||
private Set potentiallyConflictingTags;
|
private Set<String> potentiallyConflictingTags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The set of unseen custom tags.
|
* The set of unseen custom tags.
|
||||||
*/
|
*/
|
||||||
private Set unseenCustomTags;
|
private Set<String> unseenCustomTags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if we do not want to use @since tags.
|
* True if we do not want to use @since tags.
|
||||||
@ -161,12 +161,12 @@ public class TagletManager {
|
|||||||
*/
|
*/
|
||||||
public TagletManager(boolean nosince, boolean showversion,
|
public TagletManager(boolean nosince, boolean showversion,
|
||||||
boolean showauthor, MessageRetriever message){
|
boolean showauthor, MessageRetriever message){
|
||||||
overridenStandardTags = new HashSet();
|
overridenStandardTags = new HashSet<String>();
|
||||||
potentiallyConflictingTags = new HashSet();
|
potentiallyConflictingTags = new HashSet<String>();
|
||||||
standardTags = new HashSet();
|
standardTags = new HashSet<String>();
|
||||||
standardTagsLowercase = new HashSet();
|
standardTagsLowercase = new HashSet<String>();
|
||||||
unseenCustomTags = new HashSet();
|
unseenCustomTags = new HashSet<String>();
|
||||||
customTags = new LinkedHashMap();
|
customTags = new LinkedHashMap<String,Taglet>();
|
||||||
this.nosince = nosince;
|
this.nosince = nosince;
|
||||||
this.showversion = showversion;
|
this.showversion = showversion;
|
||||||
this.showauthor = showauthor;
|
this.showauthor = showauthor;
|
||||||
@ -201,7 +201,7 @@ public class TagletManager {
|
|||||||
*/
|
*/
|
||||||
public void addCustomTag(String classname, String tagletPath) {
|
public void addCustomTag(String classname, String tagletPath) {
|
||||||
try {
|
try {
|
||||||
Class customTagClass = null;
|
Class<?> customTagClass = null;
|
||||||
// construct class loader
|
// construct class loader
|
||||||
String cpString = null; // make sure env.class.path defaults to dot
|
String cpString = null; // make sure env.class.path defaults to dot
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ public class TagletManager {
|
|||||||
meth.invoke(null, new Object[] {customTags});
|
meth.invoke(null, new Object[] {customTags});
|
||||||
list = customTags.values().toArray();
|
list = customTags.values().toArray();
|
||||||
Object newLastTag = (list != null&& list.length > 0)
|
Object newLastTag = (list != null&& list.length > 0)
|
||||||
? (Object) list[list.length-1] : null;
|
? list[list.length-1] : null;
|
||||||
if (lastTag != newLastTag) {
|
if (lastTag != newLastTag) {
|
||||||
//New taglets must always be added to the end of the LinkedHashMap.
|
//New taglets must always be added to the end of the LinkedHashMap.
|
||||||
//If the current and previous last taglet are not equal, that
|
//If the current and previous last taglet are not equal, that
|
||||||
@ -315,7 +315,7 @@ public class TagletManager {
|
|||||||
if (tagName == null || locations == null) {
|
if (tagName == null || locations == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Taglet tag = (Taglet) customTags.get(tagName);
|
Taglet tag = customTags.get(tagName);
|
||||||
locations = locations.toLowerCase();
|
locations = locations.toLowerCase();
|
||||||
if (tag == null || header != null) {
|
if (tag == null || header != null) {
|
||||||
customTags.remove(tagName);
|
customTags.remove(tagName);
|
||||||
@ -396,7 +396,7 @@ public class TagletManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Check if this tag is being used in the wrong location.
|
//Check if this tag is being used in the wrong location.
|
||||||
if((taglet = (Taglet) customTags.get(name)) != null) {
|
if ((taglet = customTags.get(name)) != null) {
|
||||||
if (areInlineTags && ! taglet.isInlineTag()) {
|
if (areInlineTags && ! taglet.isInlineTag()) {
|
||||||
printTagMisuseWarn(taglet, tags[i], "inline");
|
printTagMisuseWarn(taglet, tags[i], "inline");
|
||||||
}
|
}
|
||||||
@ -425,7 +425,7 @@ public class TagletManager {
|
|||||||
* @param holderType the type of documentation that the misused tag was found in.
|
* @param holderType the type of documentation that the misused tag was found in.
|
||||||
*/
|
*/
|
||||||
private void printTagMisuseWarn(Taglet taglet, Tag tag, String holderType) {
|
private void printTagMisuseWarn(Taglet taglet, Tag tag, String holderType) {
|
||||||
Set locationsSet = new LinkedHashSet();
|
Set<String> locationsSet = new LinkedHashSet<String>();
|
||||||
if (taglet.inOverview()) {
|
if (taglet.inOverview()) {
|
||||||
locationsSet.add("overview");
|
locationsSet.add("overview");
|
||||||
}
|
}
|
||||||
@ -447,7 +447,7 @@ public class TagletManager {
|
|||||||
if (taglet.isInlineTag()) {
|
if (taglet.isInlineTag()) {
|
||||||
locationsSet.add("inline text");
|
locationsSet.add("inline text");
|
||||||
}
|
}
|
||||||
String[] locations = (String[]) locationsSet.toArray(new String[]{});
|
String[] locations = locationsSet.toArray(new String[]{});
|
||||||
if (locations == null || locations.length == 0) {
|
if (locations == null || locations.length == 0) {
|
||||||
//This known tag is excluded.
|
//This known tag is excluded.
|
||||||
return;
|
return;
|
||||||
@ -592,17 +592,17 @@ public class TagletManager {
|
|||||||
* Initialize the custom tag arrays.
|
* Initialize the custom tag arrays.
|
||||||
*/
|
*/
|
||||||
private void initCustomTagArrays() {
|
private void initCustomTagArrays() {
|
||||||
Iterator it = customTags.values().iterator();
|
Iterator<Taglet> it = customTags.values().iterator();
|
||||||
ArrayList pTags = new ArrayList(customTags.size());
|
ArrayList<Taglet> pTags = new ArrayList<Taglet>(customTags.size());
|
||||||
ArrayList tTags = new ArrayList(customTags.size());
|
ArrayList<Taglet> tTags = new ArrayList<Taglet>(customTags.size());
|
||||||
ArrayList fTags = new ArrayList(customTags.size());
|
ArrayList<Taglet> fTags = new ArrayList<Taglet>(customTags.size());
|
||||||
ArrayList cTags = new ArrayList(customTags.size());
|
ArrayList<Taglet> cTags = new ArrayList<Taglet>(customTags.size());
|
||||||
ArrayList mTags = new ArrayList(customTags.size());
|
ArrayList<Taglet> mTags = new ArrayList<Taglet>(customTags.size());
|
||||||
ArrayList iTags = new ArrayList(customTags.size());
|
ArrayList<Taglet> iTags = new ArrayList<Taglet>(customTags.size());
|
||||||
ArrayList oTags = new ArrayList(customTags.size());
|
ArrayList<Taglet> oTags = new ArrayList<Taglet>(customTags.size());
|
||||||
Taglet current;
|
Taglet current;
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
current = (Taglet) it.next();
|
current = it.next();
|
||||||
if (current.inPackage() && !current.isInlineTag()) {
|
if (current.inPackage() && !current.isInlineTag()) {
|
||||||
pTags.add(current);
|
pTags.add(current);
|
||||||
}
|
}
|
||||||
@ -625,20 +625,20 @@ public class TagletManager {
|
|||||||
oTags.add(current);
|
oTags.add(current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
packageTags = (Taglet[]) pTags.toArray(new Taglet[] {});
|
packageTags = pTags.toArray(new Taglet[] {});
|
||||||
typeTags = (Taglet[]) tTags.toArray(new Taglet[] {});
|
typeTags = tTags.toArray(new Taglet[] {});
|
||||||
fieldTags = (Taglet[]) fTags.toArray(new Taglet[] {});
|
fieldTags = fTags.toArray(new Taglet[] {});
|
||||||
constructorTags = (Taglet[]) cTags.toArray(new Taglet[] {});
|
constructorTags = cTags.toArray(new Taglet[] {});
|
||||||
methodTags = (Taglet[]) mTags.toArray(new Taglet[] {});
|
methodTags = mTags.toArray(new Taglet[] {});
|
||||||
overviewTags = (Taglet[]) oTags.toArray(new Taglet[] {});
|
overviewTags = oTags.toArray(new Taglet[] {});
|
||||||
inlineTags = (Taglet[]) iTags.toArray(new Taglet[] {});
|
inlineTags = iTags.toArray(new Taglet[] {});
|
||||||
|
|
||||||
//Init the serialized form tags
|
//Init the serialized form tags
|
||||||
serializedFormTags = new Taglet[4];
|
serializedFormTags = new Taglet[4];
|
||||||
serializedFormTags[0] = (Taglet) customTags.get("serialData");
|
serializedFormTags[0] = customTags.get("serialData");
|
||||||
serializedFormTags[1] = (Taglet) customTags.get("throws");
|
serializedFormTags[1] = customTags.get("throws");
|
||||||
serializedFormTags[2] = (Taglet) customTags.get("since");
|
serializedFormTags[2] = customTags.get("since");
|
||||||
serializedFormTags[3] = (Taglet) customTags.get("see");
|
serializedFormTags[3] = customTags.get("see");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -726,10 +726,9 @@ public class TagletManager {
|
|||||||
printReportHelper("doclet.Notice_taglet_unseen", unseenCustomTags);
|
printReportHelper("doclet.Notice_taglet_unseen", unseenCustomTags);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void printReportHelper(String noticeKey, Set names) {
|
private void printReportHelper(String noticeKey, Set<String> names) {
|
||||||
if (names.size() > 0) {
|
if (names.size() > 0) {
|
||||||
String[] namesArray =
|
String[] namesArray = names.toArray(new String[] {});
|
||||||
(String[]) names.toArray(new String[] {});
|
|
||||||
String result = " ";
|
String result = " ";
|
||||||
for (int i = 0; i < namesArray.length; i++) {
|
for (int i = 0; i < namesArray.length; i++) {
|
||||||
result += "@" + namesArray[i];
|
result += "@" + namesArray[i];
|
||||||
@ -751,9 +750,9 @@ public class TagletManager {
|
|||||||
*/
|
*/
|
||||||
public Taglet getTaglet(String name) {
|
public Taglet getTaglet(String name) {
|
||||||
if (name.indexOf("@") == 0) {
|
if (name.indexOf("@") == 0) {
|
||||||
return (Taglet) customTags.get(name.substring(1));
|
return customTags.get(name.substring(1));
|
||||||
} else {
|
} else {
|
||||||
return (Taglet) customTags.get(name);
|
return customTags.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet
|
|||||||
* Add links for exceptions that are declared but not documented.
|
* Add links for exceptions that are declared but not documented.
|
||||||
*/
|
*/
|
||||||
private TagletOutput linkToUndocumentedDeclaredExceptions(
|
private TagletOutput linkToUndocumentedDeclaredExceptions(
|
||||||
Type[] declaredExceptionTypes, Set alreadyDocumented,
|
Type[] declaredExceptionTypes, Set<String> alreadyDocumented,
|
||||||
TagletWriter writer) {
|
TagletWriter writer) {
|
||||||
TagletOutput result = writer.getOutputInstance();
|
TagletOutput result = writer.getOutputInstance();
|
||||||
//Add links to the exceptions declared but not documented.
|
//Add links to the exceptions declared but not documented.
|
||||||
@ -107,11 +107,11 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet
|
|||||||
* documented.
|
* documented.
|
||||||
*/
|
*/
|
||||||
private TagletOutput inheritThrowsDocumentation(Doc holder,
|
private TagletOutput inheritThrowsDocumentation(Doc holder,
|
||||||
Type[] declaredExceptionTypes, Set alreadyDocumented,
|
Type[] declaredExceptionTypes, Set<String> alreadyDocumented,
|
||||||
TagletWriter writer) {
|
TagletWriter writer) {
|
||||||
TagletOutput result = writer.getOutputInstance();
|
TagletOutput result = writer.getOutputInstance();
|
||||||
if (holder instanceof MethodDoc) {
|
if (holder instanceof MethodDoc) {
|
||||||
Set declaredExceptionTags = new LinkedHashSet();
|
Set<Tag> declaredExceptionTags = new LinkedHashSet<Tag>();
|
||||||
for (int j = 0; j < declaredExceptionTypes.length; j++) {
|
for (int j = 0; j < declaredExceptionTypes.length; j++) {
|
||||||
DocFinder.Output inheritedDoc =
|
DocFinder.Output inheritedDoc =
|
||||||
DocFinder.search(new DocFinder.Input((MethodDoc) holder, this,
|
DocFinder.search(new DocFinder.Input((MethodDoc) holder, this,
|
||||||
@ -124,7 +124,7 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet
|
|||||||
declaredExceptionTags.addAll(inheritedDoc.tagList);
|
declaredExceptionTags.addAll(inheritedDoc.tagList);
|
||||||
}
|
}
|
||||||
result.appendOutput(throwsTagsOutput(
|
result.appendOutput(throwsTagsOutput(
|
||||||
(ThrowsTag[]) declaredExceptionTags.toArray(new ThrowsTag[] {}),
|
declaredExceptionTags.toArray(new ThrowsTag[] {}),
|
||||||
writer, alreadyDocumented, false));
|
writer, alreadyDocumented, false));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -137,7 +137,7 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet
|
|||||||
ExecutableMemberDoc execHolder = (ExecutableMemberDoc) holder;
|
ExecutableMemberDoc execHolder = (ExecutableMemberDoc) holder;
|
||||||
ThrowsTag[] tags = execHolder.throwsTags();
|
ThrowsTag[] tags = execHolder.throwsTags();
|
||||||
TagletOutput result = writer.getOutputInstance();
|
TagletOutput result = writer.getOutputInstance();
|
||||||
HashSet alreadyDocumented = new HashSet();
|
HashSet<String> alreadyDocumented = new HashSet<String>();
|
||||||
if (tags.length > 0) {
|
if (tags.length > 0) {
|
||||||
result.appendOutput(throwsTagsOutput(
|
result.appendOutput(throwsTagsOutput(
|
||||||
execHolder.throwsTags(), writer, alreadyDocumented, true));
|
execHolder.throwsTags(), writer, alreadyDocumented, true));
|
||||||
@ -161,7 +161,7 @@ public class ThrowsTaglet extends BaseExecutableMemberTaglet
|
|||||||
* @return the TagletOutput representation of this <code>Tag</code>.
|
* @return the TagletOutput representation of this <code>Tag</code>.
|
||||||
*/
|
*/
|
||||||
protected TagletOutput throwsTagsOutput(ThrowsTag[] throwTags,
|
protected TagletOutput throwsTagsOutput(ThrowsTag[] throwTags,
|
||||||
TagletWriter writer, Set alreadyDocumented, boolean allowDups) {
|
TagletWriter writer, Set<String> alreadyDocumented, boolean allowDups) {
|
||||||
TagletOutput result = writer.getOutputInstance();
|
TagletOutput result = writer.getOutputInstance();
|
||||||
if (throwTags.length > 0) {
|
if (throwTags.length > 0) {
|
||||||
for (int i = 0; i < throwTags.length; ++i) {
|
for (int i = 0; i < throwTags.length; ++i) {
|
||||||
|
@ -49,44 +49,44 @@ import java.util.*;
|
|||||||
* Stores the set of packages that the classes specified on the command line
|
* Stores the set of packages that the classes specified on the command line
|
||||||
* belong to. Note that the default package is "".
|
* belong to. Note that the default package is "".
|
||||||
*/
|
*/
|
||||||
private Set packageSet;
|
private Set<String> packageSet;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores all classes for each package
|
* Stores all classes for each package
|
||||||
*/
|
*/
|
||||||
private Map allClasses;
|
private Map<String,Set<ClassDoc>> allClasses;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores ordinary classes (excluding Exceptions and Errors) for each
|
* Stores ordinary classes (excluding Exceptions and Errors) for each
|
||||||
* package
|
* package
|
||||||
*/
|
*/
|
||||||
private Map ordinaryClasses;
|
private Map<String,Set<ClassDoc>> ordinaryClasses;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores exceptions for each package
|
* Stores exceptions for each package
|
||||||
*/
|
*/
|
||||||
private Map exceptions;
|
private Map<String,Set<ClassDoc>> exceptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores enums for each package.
|
* Stores enums for each package.
|
||||||
*/
|
*/
|
||||||
private Map enums;
|
private Map<String,Set<ClassDoc>> enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores annotation types for each package.
|
* Stores annotation types for each package.
|
||||||
*/
|
*/
|
||||||
private Map annotationTypes;
|
private Map<String,Set<ClassDoc>> annotationTypes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores errors for each package
|
* Stores errors for each package
|
||||||
*/
|
*/
|
||||||
private Map errors;
|
private Map<String,Set<ClassDoc>> errors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores interfaces for each package
|
* Stores interfaces for each package
|
||||||
*/
|
*/
|
||||||
private Map interfaces;
|
private Map<String,Set<ClassDoc>> interfaces;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a new ClassDocCatalog.
|
* Construct a new ClassDocCatalog.
|
||||||
@ -109,14 +109,14 @@ import java.util.*;
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
allClasses = new HashMap();
|
allClasses = new HashMap<String,Set<ClassDoc>>();
|
||||||
ordinaryClasses = new HashMap();
|
ordinaryClasses = new HashMap<String,Set<ClassDoc>>();
|
||||||
exceptions = new HashMap();
|
exceptions = new HashMap<String,Set<ClassDoc>>();
|
||||||
enums = new HashMap();
|
enums = new HashMap<String,Set<ClassDoc>>();
|
||||||
annotationTypes = new HashMap();
|
annotationTypes = new HashMap<String,Set<ClassDoc>>();
|
||||||
errors = new HashMap();
|
errors = new HashMap<String,Set<ClassDoc>>();
|
||||||
interfaces = new HashMap();
|
interfaces = new HashMap<String,Set<ClassDoc>>();
|
||||||
packageSet = new HashSet();
|
packageSet = new HashSet<String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -148,7 +148,7 @@ import java.util.*;
|
|||||||
* @param classdoc the ClassDoc to add to the catelog.
|
* @param classdoc the ClassDoc to add to the catelog.
|
||||||
* @param map the Map to add the ClassDoc to.
|
* @param map the Map to add the ClassDoc to.
|
||||||
*/
|
*/
|
||||||
private void addClass(ClassDoc classdoc, Map map) {
|
private void addClass(ClassDoc classdoc, Map<String,Set<ClassDoc>> map) {
|
||||||
|
|
||||||
PackageDoc pkg = classdoc.containingPackage();
|
PackageDoc pkg = classdoc.containingPackage();
|
||||||
if (pkg.isIncluded()) {
|
if (pkg.isIncluded()) {
|
||||||
@ -157,22 +157,22 @@ import java.util.*;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String key = Util.getPackageName(pkg);
|
String key = Util.getPackageName(pkg);
|
||||||
Set s = (Set) map.get(key);
|
Set<ClassDoc> s = map.get(key);
|
||||||
if (s == null) {
|
if (s == null) {
|
||||||
packageSet.add(key);
|
packageSet.add(key);
|
||||||
s = new HashSet();
|
s = new HashSet<ClassDoc>();
|
||||||
}
|
}
|
||||||
s.add(classdoc);
|
s.add(classdoc);
|
||||||
map.put(key, s);
|
map.put(key, s);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ClassDoc[] getArray(Map m, String key) {
|
private ClassDoc[] getArray(Map<String,Set<ClassDoc>> m, String key) {
|
||||||
Set s = (Set) m.get(key);
|
Set<ClassDoc> s = m.get(key);
|
||||||
if (s == null) {
|
if (s == null) {
|
||||||
return new ClassDoc[] {};
|
return new ClassDoc[] {};
|
||||||
} else {
|
} else {
|
||||||
return (ClassDoc[]) s.toArray(new ClassDoc[] {});
|
return s.toArray(new ClassDoc[] {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ import java.util.*;
|
|||||||
* ClassDocs for.
|
* ClassDocs for.
|
||||||
*/
|
*/
|
||||||
public String[] packageNames() {
|
public String[] packageNames() {
|
||||||
return (String[]) packageSet.toArray(new String[] {});
|
return packageSet.toArray(new String[] {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -49,35 +49,35 @@ public class ClassTree {
|
|||||||
* List of baseclasses. Contains only java.lang.Object. Can be used to get
|
* List of baseclasses. Contains only java.lang.Object. Can be used to get
|
||||||
* the mapped listing of sub-classes.
|
* the mapped listing of sub-classes.
|
||||||
*/
|
*/
|
||||||
private List baseclasses = new ArrayList();
|
private List<ClassDoc> baseclasses = new ArrayList<ClassDoc>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping for each Class with their SubClasses
|
* Mapping for each Class with their SubClasses
|
||||||
*/
|
*/
|
||||||
private Map subclasses = new HashMap();
|
private Map<ClassDoc,List<ClassDoc>> subclasses = new HashMap<ClassDoc,List<ClassDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of base-interfaces. Contains list of all the interfaces who do not
|
* List of base-interfaces. Contains list of all the interfaces who do not
|
||||||
* have super-interfaces. Can be used to get the mapped listing of
|
* have super-interfaces. Can be used to get the mapped listing of
|
||||||
* sub-interfaces.
|
* sub-interfaces.
|
||||||
*/
|
*/
|
||||||
private List baseinterfaces = new ArrayList();
|
private List<ClassDoc> baseinterfaces = new ArrayList<ClassDoc>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping for each Interface with their SubInterfaces
|
* Mapping for each Interface with their SubInterfaces
|
||||||
*/
|
*/
|
||||||
private Map subinterfaces = new HashMap();
|
private Map<ClassDoc,List<ClassDoc>> subinterfaces = new HashMap<ClassDoc,List<ClassDoc>>();
|
||||||
|
|
||||||
private List baseEnums = new ArrayList();
|
private List<ClassDoc> baseEnums = new ArrayList<ClassDoc>();
|
||||||
private Map subEnums = new HashMap();
|
private Map<ClassDoc,List<ClassDoc>> subEnums = new HashMap<ClassDoc,List<ClassDoc>>();
|
||||||
|
|
||||||
private List baseAnnotationTypes = new ArrayList();
|
private List<ClassDoc> baseAnnotationTypes = new ArrayList<ClassDoc>();
|
||||||
private Map subAnnotationTypes = new HashMap();
|
private Map<ClassDoc,List<ClassDoc>> subAnnotationTypes = new HashMap<ClassDoc,List<ClassDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping for each Interface with classes who implement it.
|
* Mapping for each Interface with classes who implement it.
|
||||||
*/
|
*/
|
||||||
private Map implementingclasses = new HashMap();
|
private Map<ClassDoc,List<ClassDoc>> implementingclasses = new HashMap<ClassDoc,List<ClassDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. Build the Tree using the Root of this Javadoc run.
|
* Constructor. Build the Tree using the Root of this Javadoc run.
|
||||||
@ -132,7 +132,7 @@ public class ClassTree {
|
|||||||
processType(classes[i], configuration, baseclasses, subclasses);
|
processType(classes[i], configuration, baseclasses, subclasses);
|
||||||
} else if (classes[i].isInterface()) {
|
} else if (classes[i].isInterface()) {
|
||||||
processInterface(classes[i]);
|
processInterface(classes[i]);
|
||||||
List list = (List)implementingclasses.get(classes[i]);
|
List<ClassDoc> list = implementingclasses.get(classes[i]);
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
Collections.sort(list);
|
Collections.sort(list);
|
||||||
}
|
}
|
||||||
@ -143,11 +143,11 @@ public class ClassTree {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Collections.sort(baseinterfaces);
|
Collections.sort(baseinterfaces);
|
||||||
for (Iterator it = subinterfaces.values().iterator(); it.hasNext(); ) {
|
for (Iterator<List<ClassDoc>> it = subinterfaces.values().iterator(); it.hasNext(); ) {
|
||||||
Collections.sort((List)it.next());
|
Collections.sort(it.next());
|
||||||
}
|
}
|
||||||
for (Iterator it = subclasses.values().iterator(); it.hasNext(); ) {
|
for (Iterator<List<ClassDoc>> it = subclasses.values().iterator(); it.hasNext(); ) {
|
||||||
Collections.sort((List)it.next());
|
Collections.sort(it.next());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ public class ClassTree {
|
|||||||
* @param configuration the current configurtation of the doclet.
|
* @param configuration the current configurtation of the doclet.
|
||||||
*/
|
*/
|
||||||
private void processType(ClassDoc cd, Configuration configuration,
|
private void processType(ClassDoc cd, Configuration configuration,
|
||||||
List bases, Map subs) {
|
List<ClassDoc> bases, Map<ClassDoc,List<ClassDoc>> subs) {
|
||||||
ClassDoc superclass = Util.getFirstVisibleSuperClassCD(cd, configuration);
|
ClassDoc superclass = Util.getFirstVisibleSuperClassCD(cd, configuration);
|
||||||
if (superclass != null) {
|
if (superclass != null) {
|
||||||
if (!add(subs, superclass, cd)) {
|
if (!add(subs, superclass, cd)) {
|
||||||
@ -219,10 +219,10 @@ public class ClassTree {
|
|||||||
* @param cd sub-interface to be mapped.
|
* @param cd sub-interface to be mapped.
|
||||||
* @returns boolean true if class added, false if class already processed.
|
* @returns boolean true if class added, false if class already processed.
|
||||||
*/
|
*/
|
||||||
private boolean add(Map map, ClassDoc superclass, ClassDoc cd) {
|
private boolean add(Map<ClassDoc,List<ClassDoc>> map, ClassDoc superclass, ClassDoc cd) {
|
||||||
List list = (List)map.get(superclass);
|
List<ClassDoc> list = map.get(superclass);
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ArrayList();
|
list = new ArrayList<ClassDoc>();
|
||||||
map.put(superclass, list);
|
map.put(superclass, list);
|
||||||
}
|
}
|
||||||
if (list.contains(cd)) {
|
if (list.contains(cd)) {
|
||||||
@ -241,10 +241,10 @@ public class ClassTree {
|
|||||||
* @param cd class for which the sub-class list is requested.
|
* @param cd class for which the sub-class list is requested.
|
||||||
* @returns List Sub-Class list for the class passed.
|
* @returns List Sub-Class list for the class passed.
|
||||||
*/
|
*/
|
||||||
private List get(Map map, ClassDoc cd) {
|
private List<ClassDoc> get(Map<ClassDoc,List<ClassDoc>> map, ClassDoc cd) {
|
||||||
List list = (List)map.get(cd);
|
List<ClassDoc> list = map.get(cd);
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
return new ArrayList();
|
return new ArrayList<ClassDoc>();
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@ -254,7 +254,7 @@ public class ClassTree {
|
|||||||
*
|
*
|
||||||
* @param cd class whose sub-class list is required.
|
* @param cd class whose sub-class list is required.
|
||||||
*/
|
*/
|
||||||
public List subclasses(ClassDoc cd) {
|
public List<ClassDoc> subclasses(ClassDoc cd) {
|
||||||
return get(subclasses, cd);
|
return get(subclasses, cd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ public class ClassTree {
|
|||||||
*
|
*
|
||||||
* @param cd interface whose sub-interface list is required.
|
* @param cd interface whose sub-interface list is required.
|
||||||
*/
|
*/
|
||||||
public List subinterfaces(ClassDoc cd) {
|
public List<ClassDoc> subinterfaces(ClassDoc cd) {
|
||||||
return get(subinterfaces, cd);
|
return get(subinterfaces, cd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,9 +272,9 @@ public class ClassTree {
|
|||||||
*
|
*
|
||||||
* @param cd interface whose implementing-classes list is required.
|
* @param cd interface whose implementing-classes list is required.
|
||||||
*/
|
*/
|
||||||
public List implementingclasses(ClassDoc cd) {
|
public List<ClassDoc> implementingclasses(ClassDoc cd) {
|
||||||
List result = get(implementingclasses, cd);
|
List<ClassDoc> result = get(implementingclasses, cd);
|
||||||
List subinterfaces = allSubs(cd, false);
|
List<ClassDoc> subinterfaces = allSubs(cd, false);
|
||||||
|
|
||||||
//If class x implements a subinterface of cd, then it follows
|
//If class x implements a subinterface of cd, then it follows
|
||||||
//that class x implements cd.
|
//that class x implements cd.
|
||||||
@ -301,7 +301,7 @@ public class ClassTree {
|
|||||||
* @param isEnum true if the subclasses should be forced to come from the
|
* @param isEnum true if the subclasses should be forced to come from the
|
||||||
* enum tree.
|
* enum tree.
|
||||||
*/
|
*/
|
||||||
public List subs(ClassDoc cd, boolean isEnum) {
|
public List<ClassDoc> subs(ClassDoc cd, boolean isEnum) {
|
||||||
if (isEnum) {
|
if (isEnum) {
|
||||||
return get(subEnums, cd);
|
return get(subEnums, cd);
|
||||||
} else if (cd.isAnnotationType()) {
|
} else if (cd.isAnnotationType()) {
|
||||||
@ -324,10 +324,10 @@ public class ClassTree {
|
|||||||
* @param isEnum true if the subclasses should be forced to come from the
|
* @param isEnum true if the subclasses should be forced to come from the
|
||||||
* enum tree.
|
* enum tree.
|
||||||
*/
|
*/
|
||||||
public List allSubs(ClassDoc cd, boolean isEnum) {
|
public List<ClassDoc> allSubs(ClassDoc cd, boolean isEnum) {
|
||||||
List list = subs(cd, isEnum);
|
List<ClassDoc> list = subs(cd, isEnum);
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
cd = (ClassDoc)list.get(i);
|
cd = list.get(i);
|
||||||
List tlist = subs(cd, isEnum);
|
List tlist = subs(cd, isEnum);
|
||||||
for (int j = 0; j < tlist.size(); j++) {
|
for (int j = 0; j < tlist.size(); j++) {
|
||||||
ClassDoc tcd = (ClassDoc)tlist.get(j);
|
ClassDoc tcd = (ClassDoc)tlist.get(j);
|
||||||
|
@ -46,138 +46,138 @@ public class ClassUseMapper {
|
|||||||
* Mapping of ClassDocs to set of PackageDoc used by that class.
|
* Mapping of ClassDocs to set of PackageDoc used by that class.
|
||||||
* Entries may be null.
|
* Entries may be null.
|
||||||
*/
|
*/
|
||||||
public Map classToPackage = new HashMap();
|
public Map<String,Set<PackageDoc>> classToPackage = new HashMap<String,Set<PackageDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of Annotations to set of PackageDoc that use the annotation.
|
* Mapping of Annotations to set of PackageDoc that use the annotation.
|
||||||
*/
|
*/
|
||||||
public Map classToPackageAnnotations = new HashMap();
|
public Map<String,List<PackageDoc>> classToPackageAnnotations = new HashMap<String,List<PackageDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of ClassDocs to set of ClassDoc used by that class.
|
* Mapping of ClassDocs to set of ClassDoc used by that class.
|
||||||
* Entries may be null.
|
* Entries may be null.
|
||||||
*/
|
*/
|
||||||
public Map classToClass = new HashMap();
|
public Map<String,Set<ClassDoc>> classToClass = new HashMap<String,Set<ClassDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of ClassDocs to list of ClassDoc which are direct or
|
* Mapping of ClassDocs to list of ClassDoc which are direct or
|
||||||
* indirect subclasses of that class.
|
* indirect subclasses of that class.
|
||||||
* Entries may be null.
|
* Entries may be null.
|
||||||
*/
|
*/
|
||||||
public Map classToSubclass = new HashMap();
|
public Map<String,List<ClassDoc>> classToSubclass = new HashMap<String,List<ClassDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of ClassDocs to list of ClassDoc which are direct or
|
* Mapping of ClassDocs to list of ClassDoc which are direct or
|
||||||
* indirect subinterfaces of that interface.
|
* indirect subinterfaces of that interface.
|
||||||
* Entries may be null.
|
* Entries may be null.
|
||||||
*/
|
*/
|
||||||
public Map classToSubinterface = new HashMap();
|
public Map<String,List<ClassDoc>> classToSubinterface = new HashMap<String,List<ClassDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of ClassDocs to list of ClassDoc which implement
|
* Mapping of ClassDocs to list of ClassDoc which implement
|
||||||
* this interface.
|
* this interface.
|
||||||
* Entries may be null.
|
* Entries may be null.
|
||||||
*/
|
*/
|
||||||
public Map classToImplementingClass = new HashMap();
|
public Map<String,List<ClassDoc>> classToImplementingClass = new HashMap<String,List<ClassDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of ClassDocs to list of FieldDoc declared as that class.
|
* Mapping of ClassDocs to list of FieldDoc declared as that class.
|
||||||
* Entries may be null.
|
* Entries may be null.
|
||||||
*/
|
*/
|
||||||
public Map classToField = new HashMap();
|
public Map<String,List<FieldDoc>> classToField = new HashMap<String,List<FieldDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of ClassDocs to list of MethodDoc returning that class.
|
* Mapping of ClassDocs to list of MethodDoc returning that class.
|
||||||
* Entries may be null.
|
* Entries may be null.
|
||||||
*/
|
*/
|
||||||
public Map classToMethodReturn = new HashMap();
|
public Map<String,List<MethodDoc>> classToMethodReturn = new HashMap<String,List<MethodDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of ClassDocs to list of MethodDoc having that class
|
* Mapping of ClassDocs to list of MethodDoc having that class
|
||||||
* as an arg.
|
* as an arg.
|
||||||
* Entries may be null.
|
* Entries may be null.
|
||||||
*/
|
*/
|
||||||
public Map classToMethodArgs = new HashMap();
|
public Map<String,List<ExecutableMemberDoc>> classToMethodArgs = new HashMap<String,List<ExecutableMemberDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of ClassDocs to list of MethodDoc which throws that class.
|
* Mapping of ClassDocs to list of MethodDoc which throws that class.
|
||||||
* Entries may be null.
|
* Entries may be null.
|
||||||
*/
|
*/
|
||||||
public Map classToMethodThrows = new HashMap();
|
public Map<String,List<ExecutableMemberDoc>> classToMethodThrows = new HashMap<String,List<ExecutableMemberDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of ClassDocs to list of ConstructorDoc having that class
|
* Mapping of ClassDocs to list of ConstructorDoc having that class
|
||||||
* as an arg.
|
* as an arg.
|
||||||
* Entries may be null.
|
* Entries may be null.
|
||||||
*/
|
*/
|
||||||
public Map classToConstructorArgs = new HashMap();
|
public Map<String,List<ExecutableMemberDoc>> classToConstructorArgs = new HashMap<String,List<ExecutableMemberDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of ClassDocs to list of ConstructorDoc which throws that class.
|
* Mapping of ClassDocs to list of ConstructorDoc which throws that class.
|
||||||
* Entries may be null.
|
* Entries may be null.
|
||||||
*/
|
*/
|
||||||
public Map classToConstructorThrows = new HashMap();
|
public Map<String,List<ExecutableMemberDoc>> classToConstructorThrows = new HashMap<String,List<ExecutableMemberDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of AnnotationTypeDocs to constructors that use them.
|
* The mapping of AnnotationTypeDocs to constructors that use them.
|
||||||
*/
|
*/
|
||||||
public Map classToConstructorAnnotations = new HashMap();
|
public Map<String,List<ConstructorDoc>> classToConstructorAnnotations = new HashMap<String,List<ConstructorDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of AnnotationTypeDocs to Constructor parameters that use them.
|
* The mapping of AnnotationTypeDocs to Constructor parameters that use them.
|
||||||
*/
|
*/
|
||||||
public Map classToConstructorParamAnnotation = new HashMap();
|
public Map<String,List<ExecutableMemberDoc>> classToConstructorParamAnnotation = new HashMap<String,List<ExecutableMemberDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of ClassDocs to Constructor arguments that use them as type parameters.
|
* The mapping of ClassDocs to Constructor arguments that use them as type parameters.
|
||||||
*/
|
*/
|
||||||
public Map classToConstructorDocArgTypeParam = new HashMap();
|
public Map<String,List<ExecutableMemberDoc>> classToConstructorDocArgTypeParam = new HashMap<String,List<ExecutableMemberDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of ClassDocs to ClassDocs that use them as type parameters.
|
* The mapping of ClassDocs to ClassDocs that use them as type parameters.
|
||||||
*/
|
*/
|
||||||
public Map classToClassTypeParam = new HashMap();
|
public Map<String,List<ClassDoc>> classToClassTypeParam = new HashMap<String,List<ClassDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of AnnotationTypeDocs to ClassDocs that use them.
|
* The mapping of AnnotationTypeDocs to ClassDocs that use them.
|
||||||
*/
|
*/
|
||||||
public Map classToClassAnnotations = new HashMap();
|
public Map<String,List<ClassDoc>> classToClassAnnotations = new HashMap<String,List<ClassDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of ClassDocs to ExecutableMemberDocs that use them as type parameters.
|
* The mapping of ClassDocs to ExecutableMemberDocs that use them as type parameters.
|
||||||
*/
|
*/
|
||||||
public Map classToExecMemberDocTypeParam = new HashMap();
|
public Map<String,List<MethodDoc>> classToExecMemberDocTypeParam = new HashMap<String,List<MethodDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of ClassDocs to ExecutableMemberDocs arguments that use them as type parameters.
|
* The mapping of ClassDocs to ExecutableMemberDocs arguments that use them as type parameters.
|
||||||
*/
|
*/
|
||||||
public Map classToExecMemberDocArgTypeParam = new HashMap();
|
public Map<String,List<ExecutableMemberDoc>> classToExecMemberDocArgTypeParam = new HashMap<String,List<ExecutableMemberDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of AnnotationTypeDocs to ExecutableMemberDocs that use them.
|
* The mapping of AnnotationTypeDocs to ExecutableMemberDocs that use them.
|
||||||
*/
|
*/
|
||||||
public Map classToExecMemberDocAnnotations = new HashMap();
|
public Map<String,List<MethodDoc>> classToExecMemberDocAnnotations = new HashMap<String,List<MethodDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of ClassDocs to ExecutableMemberDocs that have return type
|
* The mapping of ClassDocs to ExecutableMemberDocs that have return type
|
||||||
* with type parameters of that class.
|
* with type parameters of that class.
|
||||||
*/
|
*/
|
||||||
public Map classToExecMemberDocReturnTypeParam = new HashMap();
|
public Map<String,List<MethodDoc>> classToExecMemberDocReturnTypeParam = new HashMap<String,List<MethodDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of AnnotationTypeDocs to MethodDoc parameters that use them.
|
* The mapping of AnnotationTypeDocs to MethodDoc parameters that use them.
|
||||||
*/
|
*/
|
||||||
public Map classToExecMemberDocParamAnnotation = new HashMap();
|
public Map<String,List<ExecutableMemberDoc>> classToExecMemberDocParamAnnotation = new HashMap<String,List<ExecutableMemberDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of ClassDocs to FieldDocs that use them as type parameters.
|
* The mapping of ClassDocs to FieldDocs that use them as type parameters.
|
||||||
*/
|
*/
|
||||||
public Map classToFieldDocTypeParam = new HashMap();
|
public Map<String,List<FieldDoc>> classToFieldDocTypeParam = new HashMap<String,List<FieldDoc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapping of AnnotationTypeDocs to FieldDocs that use them.
|
* The mapping of AnnotationTypeDocs to FieldDocs that use them.
|
||||||
*/
|
*/
|
||||||
public Map annotationToFieldDoc = new HashMap();
|
public Map<String,List<FieldDoc>> annotationToFieldDoc = new HashMap<String,List<FieldDoc>>();
|
||||||
|
|
||||||
|
|
||||||
public ClassUseMapper(RootDoc root, ClassTree classtree) {
|
public ClassUseMapper(RootDoc root, ClassTree classtree) {
|
||||||
@ -231,15 +231,15 @@ public class ClassUseMapper {
|
|||||||
/**
|
/**
|
||||||
* Return all subclasses of a class AND fill-in classToSubclass map.
|
* Return all subclasses of a class AND fill-in classToSubclass map.
|
||||||
*/
|
*/
|
||||||
private Collection subclasses(ClassDoc cd) {
|
private Collection<ClassDoc> subclasses(ClassDoc cd) {
|
||||||
Collection ret = (Collection)classToSubclass.get(cd.qualifiedName());
|
Collection<ClassDoc> ret = classToSubclass.get(cd.qualifiedName());
|
||||||
if (ret == null) {
|
if (ret == null) {
|
||||||
ret = new TreeSet();
|
ret = new TreeSet<ClassDoc>();
|
||||||
List subs = classtree.subclasses(cd);
|
List<ClassDoc> subs = classtree.subclasses(cd);
|
||||||
if (subs != null) {
|
if (subs != null) {
|
||||||
ret.addAll(subs);
|
ret.addAll(subs);
|
||||||
for (Iterator it = subs.iterator(); it.hasNext();) {
|
for (Iterator<ClassDoc> it = subs.iterator(); it.hasNext();) {
|
||||||
ret.addAll(subclasses((ClassDoc)it.next()));
|
ret.addAll(subclasses(it.next()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addAll(classToSubclass, cd, ret);
|
addAll(classToSubclass, cd, ret);
|
||||||
@ -250,15 +250,15 @@ public class ClassUseMapper {
|
|||||||
/**
|
/**
|
||||||
* Return all subinterfaces of an interface AND fill-in classToSubinterface map.
|
* Return all subinterfaces of an interface AND fill-in classToSubinterface map.
|
||||||
*/
|
*/
|
||||||
private Collection subinterfaces(ClassDoc cd) {
|
private Collection<ClassDoc> subinterfaces(ClassDoc cd) {
|
||||||
Collection ret = (Collection)classToSubinterface.get(cd.qualifiedName());
|
Collection<ClassDoc> ret = classToSubinterface.get(cd.qualifiedName());
|
||||||
if (ret == null) {
|
if (ret == null) {
|
||||||
ret = new TreeSet();
|
ret = new TreeSet<ClassDoc>();
|
||||||
List subs = classtree.subinterfaces(cd);
|
List<ClassDoc> subs = classtree.subinterfaces(cd);
|
||||||
if (subs != null) {
|
if (subs != null) {
|
||||||
ret.addAll(subs);
|
ret.addAll(subs);
|
||||||
for (Iterator it = subs.iterator(); it.hasNext();) {
|
for (Iterator<ClassDoc> it = subs.iterator(); it.hasNext();) {
|
||||||
ret.addAll(subinterfaces((ClassDoc)it.next()));
|
ret.addAll(subinterfaces(it.next()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addAll(classToSubinterface, cd, ret);
|
addAll(classToSubinterface, cd, ret);
|
||||||
@ -272,11 +272,11 @@ public class ClassUseMapper {
|
|||||||
* implementing subinterfaces) AND fill-in both classToImplementingClass
|
* implementing subinterfaces) AND fill-in both classToImplementingClass
|
||||||
* and classToSubinterface maps.
|
* and classToSubinterface maps.
|
||||||
*/
|
*/
|
||||||
private Collection implementingClasses(ClassDoc cd) {
|
private Collection<ClassDoc> implementingClasses(ClassDoc cd) {
|
||||||
Collection ret = (List)classToImplementingClass.get(cd.qualifiedName());
|
Collection<ClassDoc> ret = classToImplementingClass.get(cd.qualifiedName());
|
||||||
if (ret == null) {
|
if (ret == null) {
|
||||||
ret = new TreeSet();
|
ret = new TreeSet<ClassDoc>();
|
||||||
List impl = classtree.implementingclasses(cd);
|
List<ClassDoc> impl = classtree.implementingclasses(cd);
|
||||||
if (impl != null) {
|
if (impl != null) {
|
||||||
ret.addAll(impl);
|
ret.addAll(impl);
|
||||||
for (Iterator it = impl.iterator(); it.hasNext();) {
|
for (Iterator it = impl.iterator(); it.hasNext();) {
|
||||||
@ -298,7 +298,7 @@ public class ClassUseMapper {
|
|||||||
private void mapExecutable(ExecutableMemberDoc em) {
|
private void mapExecutable(ExecutableMemberDoc em) {
|
||||||
Parameter[] params = em.parameters();
|
Parameter[] params = em.parameters();
|
||||||
boolean isConstructor = em.isConstructor();
|
boolean isConstructor = em.isConstructor();
|
||||||
List classArgs = new ArrayList();
|
List<Type> classArgs = new ArrayList<Type>();
|
||||||
for (int k = 0; k < params.length; k++) {
|
for (int k = 0; k < params.length; k++) {
|
||||||
Type pcd = params[k].type();
|
Type pcd = params[k].type();
|
||||||
// primitives don't get mapped, also avoid dups
|
// primitives don't get mapped, also avoid dups
|
||||||
@ -325,34 +325,38 @@ public class ClassUseMapper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List refList(Map map, ClassDoc cd) {
|
private <T> List<T> refList(Map<String,List<T>> map, ClassDoc cd) {
|
||||||
List list = (List)map.get(cd.qualifiedName());
|
List<T> list = map.get(cd.qualifiedName());
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ArrayList();
|
@SuppressWarnings("unchecked")
|
||||||
|
List<T> l = new ArrayList();
|
||||||
|
list = l;
|
||||||
map.put(cd.qualifiedName(), list);
|
map.put(cd.qualifiedName(), list);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set packageSet(ClassDoc cd) {
|
private Set<PackageDoc> packageSet(ClassDoc cd) {
|
||||||
Set pkgSet = (Set)classToPackage.get(cd.qualifiedName());
|
Set<PackageDoc> pkgSet = classToPackage.get(cd.qualifiedName());
|
||||||
if (pkgSet == null) {
|
if (pkgSet == null) {
|
||||||
pkgSet = new TreeSet();
|
pkgSet = new TreeSet<PackageDoc>();
|
||||||
classToPackage.put(cd.qualifiedName(), pkgSet);
|
classToPackage.put(cd.qualifiedName(), pkgSet);
|
||||||
}
|
}
|
||||||
return pkgSet;
|
return pkgSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set classSet(ClassDoc cd) {
|
private Set<ClassDoc> classSet(ClassDoc cd) {
|
||||||
Set clsSet = (Set)classToClass.get(cd.qualifiedName());
|
Set<ClassDoc> clsSet = classToClass.get(cd.qualifiedName());
|
||||||
if (clsSet == null) {
|
if (clsSet == null) {
|
||||||
clsSet = new TreeSet();
|
@SuppressWarnings("unchecked")
|
||||||
|
Set<ClassDoc> s = new TreeSet();
|
||||||
|
clsSet = s;
|
||||||
classToClass.put(cd.qualifiedName(), clsSet);
|
classToClass.put(cd.qualifiedName(), clsSet);
|
||||||
}
|
}
|
||||||
return clsSet;
|
return clsSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void add(Map map, ClassDoc cd, ProgramElementDoc ref) {
|
private <T extends ProgramElementDoc> void add(Map<String,List<T>> map, ClassDoc cd, T ref) {
|
||||||
// add to specified map
|
// add to specified map
|
||||||
refList(map, cd).add(ref);
|
refList(map, cd).add(ref);
|
||||||
|
|
||||||
@ -361,25 +365,23 @@ public class ClassUseMapper {
|
|||||||
|
|
||||||
classSet(cd).add(ref instanceof MemberDoc?
|
classSet(cd).add(ref instanceof MemberDoc?
|
||||||
((MemberDoc)ref).containingClass() :
|
((MemberDoc)ref).containingClass() :
|
||||||
ref);
|
(ClassDoc)ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAll(Map map, ClassDoc cd, Collection refs) {
|
private void addAll(Map<String,List<ClassDoc>> map, ClassDoc cd, Collection<ClassDoc> refs) {
|
||||||
if (refs == null) {
|
if (refs == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// add to specified map
|
// add to specified map
|
||||||
refList(map, cd).addAll(refs);
|
refList(map, cd).addAll(refs);
|
||||||
|
|
||||||
Set pkgSet = packageSet(cd);
|
Set<PackageDoc> pkgSet = packageSet(cd);
|
||||||
Set clsSet = classSet(cd);
|
Set<ClassDoc> clsSet = classSet(cd);
|
||||||
// add ref's package to package map and class map
|
// add ref's package to package map and class map
|
||||||
for (Iterator it = refs.iterator(); it.hasNext();) {
|
for (Iterator<ClassDoc> it = refs.iterator(); it.hasNext();) {
|
||||||
ProgramElementDoc pedoc = (ProgramElementDoc)it.next();
|
ClassDoc cls = it.next();
|
||||||
pkgSet.add(pedoc.containingPackage());
|
pkgSet.add(cls.containingPackage());
|
||||||
clsSet.add(pedoc instanceof MemberDoc?
|
clsSet.add(cls);
|
||||||
((MemberDoc)pedoc).containingClass() :
|
|
||||||
pedoc);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -392,8 +394,8 @@ public class ClassUseMapper {
|
|||||||
* @param doc the doc whose type parameters are being checked.
|
* @param doc the doc whose type parameters are being checked.
|
||||||
* @param holder the holder that owns the type parameters.
|
* @param holder the holder that owns the type parameters.
|
||||||
*/
|
*/
|
||||||
private void mapTypeParameters(Map map, Object doc,
|
private <T extends ProgramElementDoc> void mapTypeParameters(Map<String,List<T>> map, Object doc,
|
||||||
ProgramElementDoc holder) {
|
T holder) {
|
||||||
TypeVariable[] typeVariables;
|
TypeVariable[] typeVariables;
|
||||||
if (doc instanceof ClassDoc) {
|
if (doc instanceof ClassDoc) {
|
||||||
typeVariables = ((ClassDoc) doc).typeParameters();
|
typeVariables = ((ClassDoc) doc).typeParameters();
|
||||||
@ -438,9 +440,8 @@ public class ClassUseMapper {
|
|||||||
* @param doc the doc whose type parameters are being checked.
|
* @param doc the doc whose type parameters are being checked.
|
||||||
* @param holder the holder that owns the type parameters.
|
* @param holder the holder that owns the type parameters.
|
||||||
*/
|
*/
|
||||||
private void mapAnnotations(Map map, Object doc,
|
private <T extends ProgramElementDoc> void mapAnnotations(Map<String,List<T>> map, Object doc,
|
||||||
Object holder) {
|
T holder) {
|
||||||
TypeVariable[] typeVariables;
|
|
||||||
AnnotationDesc[] annotations;
|
AnnotationDesc[] annotations;
|
||||||
boolean isPackage = false;
|
boolean isPackage = false;
|
||||||
if (doc instanceof ProgramElementDoc) {
|
if (doc instanceof ProgramElementDoc) {
|
||||||
@ -458,12 +459,31 @@ public class ClassUseMapper {
|
|||||||
if (isPackage)
|
if (isPackage)
|
||||||
refList(map, annotationDoc).add(holder);
|
refList(map, annotationDoc).add(holder);
|
||||||
else
|
else
|
||||||
add(map, annotationDoc, (ProgramElementDoc) holder);
|
add(map, annotationDoc, holder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addTypeParameterToMap(Map map, Type type,
|
|
||||||
ProgramElementDoc holder) {
|
/**
|
||||||
|
* Map the AnnotationType to the ProgramElementDocs that use them as
|
||||||
|
* type parameters.
|
||||||
|
*
|
||||||
|
* @param map the map the insert the information into.
|
||||||
|
* @param doc the doc whose type parameters are being checked.
|
||||||
|
* @param holder the holder that owns the type parameters.
|
||||||
|
*/
|
||||||
|
private <T extends PackageDoc> void mapAnnotations(Map<String,List<T>> map, PackageDoc doc,
|
||||||
|
T holder) {
|
||||||
|
AnnotationDesc[] annotations;
|
||||||
|
annotations = doc.annotations();
|
||||||
|
for (int i = 0; i < annotations.length; i++) {
|
||||||
|
AnnotationTypeDoc annotationDoc = annotations[i].annotationType();
|
||||||
|
refList(map, annotationDoc).add(holder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T extends ProgramElementDoc> void addTypeParameterToMap(Map<String,List<T>> map, Type type,
|
||||||
|
T holder) {
|
||||||
if (type instanceof ClassDoc) {
|
if (type instanceof ClassDoc) {
|
||||||
add(map, (ClassDoc) type, holder);
|
add(map, (ClassDoc) type, holder);
|
||||||
} else if (type instanceof ParameterizedType) {
|
} else if (type instanceof ParameterizedType) {
|
||||||
|
@ -52,7 +52,7 @@ public class DeprecatedAPIListBuilder {
|
|||||||
/**
|
/**
|
||||||
* List of deprecated type Lists.
|
* List of deprecated type Lists.
|
||||||
*/
|
*/
|
||||||
private List deprecatedLists;
|
private List<List<Doc>> deprecatedLists;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,9 +61,9 @@ public class DeprecatedAPIListBuilder {
|
|||||||
* @param root Root of the tree.
|
* @param root Root of the tree.
|
||||||
*/
|
*/
|
||||||
public DeprecatedAPIListBuilder(RootDoc root) {
|
public DeprecatedAPIListBuilder(RootDoc root) {
|
||||||
deprecatedLists = new ArrayList();
|
deprecatedLists = new ArrayList<List<Doc>>();
|
||||||
for (int i = 0; i < NUM_TYPES; i++) {
|
for (int i = 0; i < NUM_TYPES; i++) {
|
||||||
deprecatedLists.add(i, new ArrayList());
|
deprecatedLists.add(i, new ArrayList<Doc>());
|
||||||
}
|
}
|
||||||
buildDeprecatedAPIInfo(root);
|
buildDeprecatedAPIInfo(root);
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ public class DeprecatedAPIListBuilder {
|
|||||||
* @param list List of all the particular deprecated members, e.g. methods.
|
* @param list List of all the particular deprecated members, e.g. methods.
|
||||||
* @param members members to be added in the list.
|
* @param members members to be added in the list.
|
||||||
*/
|
*/
|
||||||
private void composeDeprecatedList(List list, MemberDoc[] members) {
|
private void composeDeprecatedList(List<Doc> list, MemberDoc[] members) {
|
||||||
for (int i = 0; i < members.length; i++) {
|
for (int i = 0; i < members.length; i++) {
|
||||||
if (Util.isDeprecated(members[i])) {
|
if (Util.isDeprecated(members[i])) {
|
||||||
list.add(members[i]);
|
list.add(members[i]);
|
||||||
@ -137,8 +137,8 @@ public class DeprecatedAPIListBuilder {
|
|||||||
*
|
*
|
||||||
* @param the constant representing the type of list being returned.
|
* @param the constant representing the type of list being returned.
|
||||||
*/
|
*/
|
||||||
public List getList(int type) {
|
public List<Doc> getList(int type) {
|
||||||
return (List) deprecatedLists.get(type);
|
return deprecatedLists.get(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -147,6 +147,6 @@ public class DeprecatedAPIListBuilder {
|
|||||||
* @param type the type of list being checked.
|
* @param type the type of list being checked.
|
||||||
*/
|
*/
|
||||||
public boolean hasDocumentation(int type) {
|
public boolean hasDocumentation(int type) {
|
||||||
return ((List) deprecatedLists.get(type)).size() > 0;
|
return (deprecatedLists.get(type)).size() > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ public class DocFinder {
|
|||||||
* subclass of IOException. This subclass of DocFinder.Output allows
|
* subclass of IOException. This subclass of DocFinder.Output allows
|
||||||
* multiple tag inheritence.
|
* multiple tag inheritence.
|
||||||
*/
|
*/
|
||||||
public List tagList = new ArrayList();
|
public List<Tag> tagList = new ArrayList<Tag>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,7 +53,7 @@ public class Extern {
|
|||||||
* Map package names onto Extern Item objects.
|
* Map package names onto Extern Item objects.
|
||||||
* Lazily initialized.
|
* Lazily initialized.
|
||||||
*/
|
*/
|
||||||
private Map packageToItemMap;
|
private Map<String,Item> packageToItemMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The global configuration information for this run.
|
* The global configuration information for this run.
|
||||||
@ -101,7 +101,7 @@ public class Extern {
|
|||||||
this.path = path;
|
this.path = path;
|
||||||
this.relative = relative;
|
this.relative = relative;
|
||||||
if (packageToItemMap == null) {
|
if (packageToItemMap == null) {
|
||||||
packageToItemMap = new HashMap();
|
packageToItemMap = new HashMap<String,Item>();
|
||||||
}
|
}
|
||||||
if (!packageToItemMap.containsKey(packageName)) { // save the previous
|
if (!packageToItemMap.containsKey(packageName)) { // save the previous
|
||||||
packageToItemMap.put(packageName, this); // mapped location
|
packageToItemMap.put(packageName, this); // mapped location
|
||||||
@ -185,7 +185,7 @@ public class Extern {
|
|||||||
if (packageToItemMap == null) {
|
if (packageToItemMap == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (Item)packageToItemMap.get(pkgName);
|
return packageToItemMap.get(pkgName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,24 +61,24 @@ public class Group {
|
|||||||
/**
|
/**
|
||||||
* Map of regular expressions with the corresponding group name.
|
* Map of regular expressions with the corresponding group name.
|
||||||
*/
|
*/
|
||||||
private Map regExpGroupMap = new HashMap();
|
private Map<String,String> regExpGroupMap = new HashMap<String,String>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of regular expressions sorted according to the length. Regular
|
* List of regular expressions sorted according to the length. Regular
|
||||||
* expression with longest length will be first in the sorted order.
|
* expression with longest length will be first in the sorted order.
|
||||||
*/
|
*/
|
||||||
private List sortedRegExpList = new ArrayList();
|
private List<String> sortedRegExpList = new ArrayList<String>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of group names in the same order as given on the command line.
|
* List of group names in the same order as given on the command line.
|
||||||
*/
|
*/
|
||||||
private List groupList = new ArrayList();
|
private List<String> groupList = new ArrayList<String>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of non-regular expressions(possible package names) with the
|
* Map of non-regular expressions(possible package names) with the
|
||||||
* corresponding group name.
|
* corresponding group name.
|
||||||
*/
|
*/
|
||||||
private Map pkgNameGroupMap = new HashMap();
|
private Map<String,String> pkgNameGroupMap = new HashMap<String,String>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The global configuration information for this run.
|
* The global configuration information for this run.
|
||||||
@ -90,9 +90,9 @@ public class Group {
|
|||||||
* the compare method in the implementing class is doing the reverse
|
* the compare method in the implementing class is doing the reverse
|
||||||
* comparison.
|
* comparison.
|
||||||
*/
|
*/
|
||||||
private static class MapKeyComparator implements Comparator {
|
private static class MapKeyComparator implements Comparator<String> {
|
||||||
public int compare(Object key1, Object key2) {
|
public int compare(String key1, String key2) {
|
||||||
return ((String)key2).length() - ((String)key1).length();
|
return key2.length() - key1.length();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,8 +182,8 @@ public class Group {
|
|||||||
*
|
*
|
||||||
* @param packages Packages specified on the command line.
|
* @param packages Packages specified on the command line.
|
||||||
*/
|
*/
|
||||||
public Map groupPackages(PackageDoc[] packages) {
|
public Map<String,List<PackageDoc>> groupPackages(PackageDoc[] packages) {
|
||||||
Map groupPackageMap = new HashMap();
|
Map<String,List<PackageDoc>> groupPackageMap = new HashMap<String,List<PackageDoc>>();
|
||||||
String defaultGroupName =
|
String defaultGroupName =
|
||||||
(pkgNameGroupMap.isEmpty() && regExpGroupMap.isEmpty())?
|
(pkgNameGroupMap.isEmpty() && regExpGroupMap.isEmpty())?
|
||||||
configuration.message.getText("doclet.Packages") :
|
configuration.message.getText("doclet.Packages") :
|
||||||
@ -195,7 +195,7 @@ public class Group {
|
|||||||
for (int i = 0; i < packages.length; i++) {
|
for (int i = 0; i < packages.length; i++) {
|
||||||
PackageDoc pkg = packages[i];
|
PackageDoc pkg = packages[i];
|
||||||
String pkgName = pkg.name();
|
String pkgName = pkg.name();
|
||||||
String groupName = (String)pkgNameGroupMap.get(pkgName);
|
String groupName = pkgNameGroupMap.get(pkgName);
|
||||||
// if this package is not explicitly assigned to a group,
|
// if this package is not explicitly assigned to a group,
|
||||||
// try matching it to group specified by regular expression
|
// try matching it to group specified by regular expression
|
||||||
if (groupName == null) {
|
if (groupName == null) {
|
||||||
@ -220,9 +220,9 @@ public class Group {
|
|||||||
*/
|
*/
|
||||||
String regExpGroupName(String pkgName) {
|
String regExpGroupName(String pkgName) {
|
||||||
for (int j = 0; j < sortedRegExpList.size(); j++) {
|
for (int j = 0; j < sortedRegExpList.size(); j++) {
|
||||||
String regexp = (String)sortedRegExpList.get(j);
|
String regexp = sortedRegExpList.get(j);
|
||||||
if (pkgName.startsWith(regexp)) {
|
if (pkgName.startsWith(regexp)) {
|
||||||
return (String)regExpGroupMap.get(regexp);
|
return regExpGroupMap.get(regexp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -235,10 +235,10 @@ public class Group {
|
|||||||
* @param map Map to be searched for gorup name.
|
* @param map Map to be searched for gorup name.
|
||||||
* @param groupname Group name to search.
|
* @param groupname Group name to search.
|
||||||
*/
|
*/
|
||||||
List getPkgList(Map map, String groupname) {
|
List<PackageDoc> getPkgList(Map<String,List<PackageDoc>> map, String groupname) {
|
||||||
List list = (List)map.get(groupname);
|
List<PackageDoc> list = map.get(groupname);
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ArrayList();
|
list = new ArrayList<PackageDoc>();
|
||||||
map.put(groupname, list);
|
map.put(groupname, list);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
@ -41,8 +41,8 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
public class ImplementedMethods {
|
public class ImplementedMethods {
|
||||||
|
|
||||||
private Map interfaces = new HashMap();
|
private Map<MethodDoc,Type> interfaces = new HashMap<MethodDoc,Type>();
|
||||||
private List methlist = new ArrayList();
|
private List<MethodDoc> methlist = new ArrayList<MethodDoc>();
|
||||||
private Configuration configuration;
|
private Configuration configuration;
|
||||||
private final ClassDoc classdoc;
|
private final ClassDoc classdoc;
|
||||||
private final MethodDoc method;
|
private final MethodDoc method;
|
||||||
@ -67,7 +67,7 @@ public class ImplementedMethods {
|
|||||||
*/
|
*/
|
||||||
public MethodDoc[] build(boolean sort) {
|
public MethodDoc[] build(boolean sort) {
|
||||||
buildImplementedMethodList(sort);
|
buildImplementedMethodList(sort);
|
||||||
return (MethodDoc[])methlist.toArray(new MethodDoc[methlist.size()]);
|
return methlist.toArray(new MethodDoc[methlist.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MethodDoc[] build() {
|
public MethodDoc[] build() {
|
||||||
@ -75,7 +75,7 @@ public class ImplementedMethods {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Type getMethodHolder(MethodDoc methodDoc) {
|
public Type getMethodHolder(MethodDoc methodDoc) {
|
||||||
return (Type) interfaces.get(methodDoc);
|
return interfaces.get(methodDoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,7 +111,7 @@ public class ImplementedMethods {
|
|||||||
ClassDoc overriddenClass = method.overriddenClass();
|
ClassDoc overriddenClass = method.overriddenClass();
|
||||||
if (overriddenClass != null) {
|
if (overriddenClass != null) {
|
||||||
for (int i = 0; i < methlist.size(); i++) {
|
for (int i = 0; i < methlist.size(); i++) {
|
||||||
ClassDoc cd = ((MethodDoc)methlist.get(i)).containingClass();
|
ClassDoc cd = methlist.get(i).containingClass();
|
||||||
if (cd == overriddenClass || overriddenClass.subclassOf(cd)) {
|
if (cd == overriddenClass || overriddenClass.subclassOf(cd)) {
|
||||||
methlist.remove(i); // remove overridden method
|
methlist.remove(i); // remove overridden method
|
||||||
return;
|
return;
|
||||||
@ -131,7 +131,7 @@ public class ImplementedMethods {
|
|||||||
private boolean overridingMethodFound(MethodDoc method) {
|
private boolean overridingMethodFound(MethodDoc method) {
|
||||||
ClassDoc containingClass = method.containingClass();
|
ClassDoc containingClass = method.containingClass();
|
||||||
for (int i = 0; i < methlist.size(); i++) {
|
for (int i = 0; i < methlist.size(); i++) {
|
||||||
MethodDoc listmethod = (MethodDoc)methlist.get(i);
|
MethodDoc listmethod = methlist.get(i);
|
||||||
if (containingClass == listmethod.containingClass()) {
|
if (containingClass == listmethod.containingClass()) {
|
||||||
// it's the same method.
|
// it's the same method.
|
||||||
return true;
|
return true;
|
||||||
|
@ -49,7 +49,7 @@ public class IndexBuilder {
|
|||||||
* Mapping of each Unicode Character with the member list containing
|
* Mapping of each Unicode Character with the member list containing
|
||||||
* members with names starting with it.
|
* members with names starting with it.
|
||||||
*/
|
*/
|
||||||
private Map indexmap = new HashMap();
|
private Map<Character,List<Doc>> indexmap = new HashMap<Character,List<Doc>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't generate deprecated information if true.
|
* Don't generate deprecated information if true.
|
||||||
@ -68,10 +68,10 @@ public class IndexBuilder {
|
|||||||
* A comparator used to sort classes and members.
|
* A comparator used to sort classes and members.
|
||||||
* Note: Maybe this compare code belongs in the tool?
|
* Note: Maybe this compare code belongs in the tool?
|
||||||
*/
|
*/
|
||||||
private class DocComparator implements Comparator {
|
private class DocComparator implements Comparator<Doc> {
|
||||||
public int compare(Object d1, Object d2) {
|
public int compare(Doc d1, Doc d2) {
|
||||||
String doc1 = (((Doc) d1).name());
|
String doc1 = d1.name();
|
||||||
String doc2 = (((Doc) d2).name());
|
String doc2 = d2.name();
|
||||||
int compareResult;
|
int compareResult;
|
||||||
if ((compareResult = doc1.compareToIgnoreCase(doc2)) != 0) {
|
if ((compareResult = doc1.compareToIgnoreCase(doc2)) != 0) {
|
||||||
return compareResult;
|
return compareResult;
|
||||||
@ -124,8 +124,8 @@ public class IndexBuilder {
|
|||||||
* sort each element which is a list.
|
* sort each element which is a list.
|
||||||
*/
|
*/
|
||||||
protected void sortIndexMap() {
|
protected void sortIndexMap() {
|
||||||
for (Iterator it = indexmap.values().iterator(); it.hasNext(); ) {
|
for (Iterator<List<Doc>> it = indexmap.values().iterator(); it.hasNext(); ) {
|
||||||
Collections.sort((List)it.next(), new DocComparator());
|
Collections.sort(it.next(), new DocComparator());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ public class IndexBuilder {
|
|||||||
ClassDoc[] classes = root.classes();
|
ClassDoc[] classes = root.classes();
|
||||||
if (!classesOnly) {
|
if (!classesOnly) {
|
||||||
if (packages.length == 0) {
|
if (packages.length == 0) {
|
||||||
Set set = new HashSet();
|
Set<PackageDoc> set = new HashSet<PackageDoc>();
|
||||||
PackageDoc pd;
|
PackageDoc pd;
|
||||||
for (int i = 0; i < classes.length; i++) {
|
for (int i = 0; i < classes.length; i++) {
|
||||||
pd = classes[i].containingPackage();
|
pd = classes[i].containingPackage();
|
||||||
@ -149,7 +149,7 @@ public class IndexBuilder {
|
|||||||
set.add(pd);
|
set.add(pd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
adjustIndexMap((PackageDoc[]) set.toArray(packages));
|
adjustIndexMap(set.toArray(packages));
|
||||||
} else {
|
} else {
|
||||||
adjustIndexMap(packages);
|
adjustIndexMap(packages);
|
||||||
}
|
}
|
||||||
@ -193,9 +193,9 @@ public class IndexBuilder {
|
|||||||
'*' :
|
'*' :
|
||||||
Character.toUpperCase(name.charAt(0));
|
Character.toUpperCase(name.charAt(0));
|
||||||
Character unicode = new Character(ch);
|
Character unicode = new Character(ch);
|
||||||
List list = (List)indexmap.get(unicode);
|
List<Doc> list = indexmap.get(unicode);
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ArrayList();
|
list = new ArrayList<Doc>();
|
||||||
indexmap.put(unicode, list);
|
indexmap.put(unicode, list);
|
||||||
}
|
}
|
||||||
list.add(elements[i]);
|
list.add(elements[i]);
|
||||||
|
@ -82,7 +82,7 @@ public class MetaKeywords {
|
|||||||
* definitions are on separate pages.
|
* definitions are on separate pages.
|
||||||
*/
|
*/
|
||||||
public String[] getMetaKeywords(ClassDoc classdoc) {
|
public String[] getMetaKeywords(ClassDoc classdoc) {
|
||||||
ArrayList results = new ArrayList();
|
ArrayList<String> results = new ArrayList<String>();
|
||||||
|
|
||||||
// Add field and method keywords only if -keywords option is used
|
// Add field and method keywords only if -keywords option is used
|
||||||
if( configuration.keywords ) {
|
if( configuration.keywords ) {
|
||||||
@ -90,16 +90,16 @@ public class MetaKeywords {
|
|||||||
results.addAll(getMemberKeywords(classdoc.fields()));
|
results.addAll(getMemberKeywords(classdoc.fields()));
|
||||||
results.addAll(getMemberKeywords(classdoc.methods()));
|
results.addAll(getMemberKeywords(classdoc.methods()));
|
||||||
}
|
}
|
||||||
return (String[]) results.toArray(new String[]{});
|
return results.toArray(new String[]{});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current class for a meta tag keyword, as the first
|
* Get the current class for a meta tag keyword, as the first
|
||||||
* and only element of an array list.
|
* and only element of an array list.
|
||||||
*/
|
*/
|
||||||
protected ArrayList getClassKeyword(ClassDoc classdoc) {
|
protected ArrayList<String> getClassKeyword(ClassDoc classdoc) {
|
||||||
String cltypelower = classdoc.isInterface() ? "interface" : "class";
|
String cltypelower = classdoc.isInterface() ? "interface" : "class";
|
||||||
ArrayList metakeywords = new ArrayList(1);
|
ArrayList<String> metakeywords = new ArrayList<String>(1);
|
||||||
metakeywords.add(classdoc.qualifiedName() + " " + cltypelower);
|
metakeywords.add(classdoc.qualifiedName() + " " + cltypelower);
|
||||||
return metakeywords;
|
return metakeywords;
|
||||||
}
|
}
|
||||||
@ -141,8 +141,8 @@ public class MetaKeywords {
|
|||||||
*
|
*
|
||||||
* @param memberdocs array of MemberDoc objects to be added to keywords
|
* @param memberdocs array of MemberDoc objects to be added to keywords
|
||||||
*/
|
*/
|
||||||
protected ArrayList getMemberKeywords(MemberDoc[] memberdocs) {
|
protected ArrayList<String> getMemberKeywords(MemberDoc[] memberdocs) {
|
||||||
ArrayList results = new ArrayList();
|
ArrayList<String> results = new ArrayList<String>();
|
||||||
String membername;
|
String membername;
|
||||||
for (int i=0; i < memberdocs.length; i++) {
|
for (int i=0; i < memberdocs.length; i++) {
|
||||||
membername = memberdocs[i].name()
|
membername = memberdocs[i].name()
|
||||||
|
@ -260,12 +260,12 @@ public class SourceToHTMLConverter {
|
|||||||
* @param docs the array of <code>Doc</code>s to add anchors for.
|
* @param docs the array of <code>Doc</code>s to add anchors for.
|
||||||
* @param hash the <code>HashMap</code> to add to.
|
* @param hash the <code>HashMap</code> to add to.
|
||||||
*/
|
*/
|
||||||
protected static void addToHash(Doc[] docs, HashMap hash) {
|
protected static void addToHash(Doc[] docs, HashMap<Integer,String> hash) {
|
||||||
if(docs == null) {
|
if(docs == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for(int i = 0; i < docs.length; i++) {
|
for(int i = 0; i < docs.length; i++) {
|
||||||
hash.put(new Integer(docs[i].position().line()), getAnchor(docs[i]));
|
hash.put(docs[i].position().line(), getAnchor(docs[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,9 +73,9 @@ public class Util {
|
|||||||
* @return List List of eligible members for whom
|
* @return List List of eligible members for whom
|
||||||
* documentation is getting generated.
|
* documentation is getting generated.
|
||||||
*/
|
*/
|
||||||
public static List excludeDeprecatedMembersAsList(
|
public static List<ProgramElementDoc> excludeDeprecatedMembersAsList(
|
||||||
ProgramElementDoc[] members) {
|
ProgramElementDoc[] members) {
|
||||||
List list = new ArrayList();
|
List<ProgramElementDoc> list = new ArrayList<ProgramElementDoc>();
|
||||||
for (int i = 0; i < members.length; i++) {
|
for (int i = 0; i < members.length; i++) {
|
||||||
if (members[i].tags("deprecated").length == 0) {
|
if (members[i].tags("deprecated").length == 0) {
|
||||||
list.add(members[i]);
|
list.add(members[i]);
|
||||||
@ -372,10 +372,10 @@ public class Util {
|
|||||||
* We want the list of types in alphabetical order. However, types are not
|
* We want the list of types in alphabetical order. However, types are not
|
||||||
* comparable. We need a comparator for now.
|
* comparable. We need a comparator for now.
|
||||||
*/
|
*/
|
||||||
private static class TypeComparator implements Comparator {
|
private static class TypeComparator implements Comparator<Type> {
|
||||||
public int compare(Object type1, Object type2) {
|
public int compare(Type type1, Type type2) {
|
||||||
return ((Type) type1).qualifiedTypeName().toLowerCase().compareTo(
|
return type1.qualifiedTypeName().toLowerCase().compareTo(
|
||||||
((Type) type2).qualifiedTypeName().toLowerCase());
|
type2.qualifiedTypeName().toLowerCase());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,9 +391,9 @@ public class Util {
|
|||||||
* @param sort if true, return list of interfaces sorted alphabetically.
|
* @param sort if true, return list of interfaces sorted alphabetically.
|
||||||
* @return List of all the required interfaces.
|
* @return List of all the required interfaces.
|
||||||
*/
|
*/
|
||||||
public static List getAllInterfaces(Type type,
|
public static List<Type> getAllInterfaces(Type type,
|
||||||
Configuration configuration, boolean sort) {
|
Configuration configuration, boolean sort) {
|
||||||
Map results = sort ? new TreeMap() : new LinkedHashMap();
|
Map<ClassDoc,Type> results = sort ? new TreeMap<ClassDoc,Type>() : new LinkedHashMap<ClassDoc,Type>();
|
||||||
Type[] interfaceTypes = null;
|
Type[] interfaceTypes = null;
|
||||||
Type superType = null;
|
Type superType = null;
|
||||||
if (type instanceof ParameterizedType) {
|
if (type instanceof ParameterizedType) {
|
||||||
@ -423,7 +423,7 @@ public class Util {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (superType == null)
|
if (superType == null)
|
||||||
return new ArrayList(results.values());
|
return new ArrayList<Type>(results.values());
|
||||||
//Try walking the tree.
|
//Try walking the tree.
|
||||||
addAllInterfaceTypes(results,
|
addAllInterfaceTypes(results,
|
||||||
superType,
|
superType,
|
||||||
@ -431,7 +431,7 @@ public class Util {
|
|||||||
((ClassDoc) superType).interfaceTypes() :
|
((ClassDoc) superType).interfaceTypes() :
|
||||||
((ParameterizedType) superType).interfaceTypes(),
|
((ParameterizedType) superType).interfaceTypes(),
|
||||||
false, configuration);
|
false, configuration);
|
||||||
List resultsList = new ArrayList(results.values());
|
List<Type> resultsList = new ArrayList<Type>(results.values());
|
||||||
if (sort) {
|
if (sort) {
|
||||||
Collections.sort(resultsList, new TypeComparator());
|
Collections.sort(resultsList, new TypeComparator());
|
||||||
}
|
}
|
||||||
@ -442,7 +442,7 @@ public class Util {
|
|||||||
return getAllInterfaces(type, configuration, true);
|
return getAllInterfaces(type, configuration, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void findAllInterfaceTypes(Map results, ClassDoc c, boolean raw,
|
private static void findAllInterfaceTypes(Map<ClassDoc,Type> results, ClassDoc c, boolean raw,
|
||||||
Configuration configuration) {
|
Configuration configuration) {
|
||||||
Type superType = c.superclassType();
|
Type superType = c.superclassType();
|
||||||
if (superType == null)
|
if (superType == null)
|
||||||
@ -454,7 +454,7 @@ public class Util {
|
|||||||
raw, configuration);
|
raw, configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void findAllInterfaceTypes(Map results, ParameterizedType p,
|
private static void findAllInterfaceTypes(Map<ClassDoc,Type> results, ParameterizedType p,
|
||||||
Configuration configuration) {
|
Configuration configuration) {
|
||||||
Type superType = p.superclassType();
|
Type superType = p.superclassType();
|
||||||
if (superType == null)
|
if (superType == null)
|
||||||
@ -466,7 +466,7 @@ public class Util {
|
|||||||
false, configuration);
|
false, configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addAllInterfaceTypes(Map results, Type type,
|
private static void addAllInterfaceTypes(Map<ClassDoc,Type> results, Type type,
|
||||||
Type[] interfaceTypes, boolean raw,
|
Type[] interfaceTypes, boolean raw,
|
||||||
Configuration configuration) {
|
Configuration configuration) {
|
||||||
for (int i = 0; i < interfaceTypes.length; i++) {
|
for (int i = 0; i < interfaceTypes.length; i++) {
|
||||||
@ -495,8 +495,8 @@ public class Util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static List asList(ProgramElementDoc[] members) {
|
public static List<ProgramElementDoc> asList(ProgramElementDoc[] members) {
|
||||||
List list = new ArrayList();
|
List<ProgramElementDoc> list = new ArrayList<ProgramElementDoc>();
|
||||||
for (int i = 0; i < members.length; i++) {
|
for (int i = 0; i < members.length; i++) {
|
||||||
list.add(members[i]);
|
list.add(members[i]);
|
||||||
}
|
}
|
||||||
@ -639,7 +639,7 @@ public class Util {
|
|||||||
* @return an array of tokens.
|
* @return an array of tokens.
|
||||||
*/
|
*/
|
||||||
public static String[] tokenize(String s, char separator, int maxTokens) {
|
public static String[] tokenize(String s, char separator, int maxTokens) {
|
||||||
List tokens = new ArrayList();
|
List<String> tokens = new ArrayList<String>();
|
||||||
StringBuilder token = new StringBuilder ();
|
StringBuilder token = new StringBuilder ();
|
||||||
boolean prevIsEscapeChar = false;
|
boolean prevIsEscapeChar = false;
|
||||||
for (int i = 0; i < s.length(); i += Character.charCount(i)) {
|
for (int i = 0; i < s.length(); i += Character.charCount(i)) {
|
||||||
@ -663,7 +663,7 @@ public class Util {
|
|||||||
if (token.length() > 0) {
|
if (token.length() > 0) {
|
||||||
tokens.add(token.toString());
|
tokens.add(token.toString());
|
||||||
}
|
}
|
||||||
return (String[]) tokens.toArray(new String[] {});
|
return tokens.toArray(new String[] {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,19 +65,19 @@ public class VisibleMemberMap {
|
|||||||
/**
|
/**
|
||||||
* List of ClassDoc objects for which ClassMembers objects are built.
|
* List of ClassDoc objects for which ClassMembers objects are built.
|
||||||
*/
|
*/
|
||||||
private final List visibleClasses = new ArrayList();
|
private final List<ClassDoc> visibleClasses = new ArrayList<ClassDoc>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map for each member name on to a map which contains members with same
|
* Map for each member name on to a map which contains members with same
|
||||||
* name-signature. The mapped map will contain mapping for each MemberDoc
|
* name-signature. The mapped map will contain mapping for each MemberDoc
|
||||||
* onto it's respecive level string.
|
* onto it's respecive level string.
|
||||||
*/
|
*/
|
||||||
private final Map memberNameMap = new HashMap();
|
private final Map<Object,Map<ProgramElementDoc,String>> memberNameMap = new HashMap<Object,Map<ProgramElementDoc,String>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of class and it's ClassMembers object.
|
* Map of class and it's ClassMembers object.
|
||||||
*/
|
*/
|
||||||
private final Map classMap = new HashMap();
|
private final Map<ClassDoc,ClassMembers> classMap = new HashMap<ClassDoc,ClassMembers>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type whose visible members are requested. This is the leaf of
|
* Type whose visible members are requested. This is the leaf of
|
||||||
@ -128,8 +128,8 @@ public class VisibleMemberMap {
|
|||||||
* @param configuation the current configuration of the doclet.
|
* @param configuation the current configuration of the doclet.
|
||||||
* @return the package private members inherited by the class.
|
* @return the package private members inherited by the class.
|
||||||
*/
|
*/
|
||||||
private List getInheritedPackagePrivateMethods(Configuration configuration) {
|
private List<ProgramElementDoc> getInheritedPackagePrivateMethods(Configuration configuration) {
|
||||||
List results = new ArrayList();
|
List<ProgramElementDoc> results = new ArrayList<ProgramElementDoc>();
|
||||||
for (Iterator iter = visibleClasses.iterator(); iter.hasNext(); ) {
|
for (Iterator iter = visibleClasses.iterator(); iter.hasNext(); ) {
|
||||||
ClassDoc currentClass = (ClassDoc) iter.next();
|
ClassDoc currentClass = (ClassDoc) iter.next();
|
||||||
if (currentClass != classdoc &&
|
if (currentClass != classdoc &&
|
||||||
@ -150,8 +150,8 @@ public class VisibleMemberMap {
|
|||||||
*
|
*
|
||||||
* @param configuation the current configuration of the doclet.
|
* @param configuation the current configuration of the doclet.
|
||||||
*/
|
*/
|
||||||
public List getLeafClassMembers(Configuration configuration) {
|
public List<ProgramElementDoc> getLeafClassMembers(Configuration configuration) {
|
||||||
List result = getMembersFor(classdoc);
|
List<ProgramElementDoc> result = getMembersFor(classdoc);
|
||||||
result.addAll(getInheritedPackagePrivateMethods(configuration));
|
result.addAll(getInheritedPackagePrivateMethods(configuration));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -163,10 +163,10 @@ public class VisibleMemberMap {
|
|||||||
*
|
*
|
||||||
* @return the list of members for the given class.
|
* @return the list of members for the given class.
|
||||||
*/
|
*/
|
||||||
public List getMembersFor(ClassDoc cd) {
|
public List<ProgramElementDoc> getMembersFor(ClassDoc cd) {
|
||||||
ClassMembers clmembers = (ClassMembers)(classMap.get(cd));
|
ClassMembers clmembers = classMap.get(cd);
|
||||||
if (clmembers == null) {
|
if (clmembers == null) {
|
||||||
return new ArrayList();
|
return new ArrayList<ProgramElementDoc>();
|
||||||
}
|
}
|
||||||
return clmembers.getMembers();
|
return clmembers.getMembers();
|
||||||
}
|
}
|
||||||
@ -175,11 +175,11 @@ public class VisibleMemberMap {
|
|||||||
* Sort the given mixed list of classes and interfaces to a list of
|
* Sort the given mixed list of classes and interfaces to a list of
|
||||||
* classes followed by interfaces traversed. Don't sort alphabetically.
|
* classes followed by interfaces traversed. Don't sort alphabetically.
|
||||||
*/
|
*/
|
||||||
private void sort(List list) {
|
private void sort(List<ClassDoc> list) {
|
||||||
List classes = new ArrayList();
|
List<ClassDoc> classes = new ArrayList<ClassDoc>();
|
||||||
List interfaces = new ArrayList();
|
List<ClassDoc> interfaces = new ArrayList<ClassDoc>();
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
ClassDoc cd = (ClassDoc)list.get(i);
|
ClassDoc cd = list.get(i);
|
||||||
if (cd.isClass()) {
|
if (cd.isClass()) {
|
||||||
classes.add(cd);
|
classes.add(cd);
|
||||||
} else {
|
} else {
|
||||||
@ -191,12 +191,12 @@ public class VisibleMemberMap {
|
|||||||
list.addAll(interfaces);
|
list.addAll(interfaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fillMemberLevelMap(List list, String level) {
|
private void fillMemberLevelMap(List<ProgramElementDoc> list, String level) {
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
Object key = getMemberKey((ProgramElementDoc)list.get(i));
|
Object key = getMemberKey(list.get(i));
|
||||||
Map memberLevelMap = (Map) memberNameMap.get(key);
|
Map<ProgramElementDoc,String> memberLevelMap = memberNameMap.get(key);
|
||||||
if (memberLevelMap == null) {
|
if (memberLevelMap == null) {
|
||||||
memberLevelMap = new HashMap();
|
memberLevelMap = new HashMap<ProgramElementDoc,String>();
|
||||||
memberNameMap.put(key, memberLevelMap);
|
memberNameMap.put(key, memberLevelMap);
|
||||||
}
|
}
|
||||||
memberLevelMap.put(list.get(i), level);
|
memberLevelMap.put(list.get(i), level);
|
||||||
@ -218,10 +218,10 @@ public class VisibleMemberMap {
|
|||||||
* type variables in consideration when comparing.
|
* type variables in consideration when comparing.
|
||||||
*/
|
*/
|
||||||
private class ClassMember {
|
private class ClassMember {
|
||||||
private Set members;
|
private Set<ProgramElementDoc> members;
|
||||||
|
|
||||||
public ClassMember(ProgramElementDoc programElementDoc) {
|
public ClassMember(ProgramElementDoc programElementDoc) {
|
||||||
members = new HashSet();
|
members = new HashSet<ProgramElementDoc>();
|
||||||
members.add(programElementDoc);
|
members.add(programElementDoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ public class VisibleMemberMap {
|
|||||||
/**
|
/**
|
||||||
* List of inherited members from the mapping class.
|
* List of inherited members from the mapping class.
|
||||||
*/
|
*/
|
||||||
private List members = new ArrayList();
|
private List<ProgramElementDoc> members = new ArrayList<ProgramElementDoc>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Level/Depth of inheritance.
|
* Level/Depth of inheritance.
|
||||||
@ -268,7 +268,7 @@ public class VisibleMemberMap {
|
|||||||
*
|
*
|
||||||
* @return List Inherited members.
|
* @return List Inherited members.
|
||||||
*/
|
*/
|
||||||
public List getMembers() {
|
public List<ProgramElementDoc> getMembers() {
|
||||||
return members;
|
return members;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,11 +276,11 @@ public class VisibleMemberMap {
|
|||||||
this.mappingClass = mappingClass;
|
this.mappingClass = mappingClass;
|
||||||
this.level = level;
|
this.level = level;
|
||||||
if (classMap.containsKey(mappingClass) &&
|
if (classMap.containsKey(mappingClass) &&
|
||||||
level.startsWith(((ClassMembers) classMap.get(mappingClass)).level)) {
|
level.startsWith(classMap.get(mappingClass).level)) {
|
||||||
//Remove lower level class so that it can be replaced with
|
//Remove lower level class so that it can be replaced with
|
||||||
//same class found at higher level.
|
//same class found at higher level.
|
||||||
purgeMemberLevelMap(getClassMembers(mappingClass, false),
|
purgeMemberLevelMap(getClassMembers(mappingClass, false),
|
||||||
((ClassMembers) classMap.get(mappingClass)).level);
|
classMap.get(mappingClass).level);
|
||||||
classMap.remove(mappingClass);
|
classMap.remove(mappingClass);
|
||||||
visibleClasses.remove(mappingClass);
|
visibleClasses.remove(mappingClass);
|
||||||
}
|
}
|
||||||
@ -326,11 +326,10 @@ public class VisibleMemberMap {
|
|||||||
* Adjust member-level-map, class-map.
|
* Adjust member-level-map, class-map.
|
||||||
*/
|
*/
|
||||||
private void addMembers(ClassDoc fromClass) {
|
private void addMembers(ClassDoc fromClass) {
|
||||||
List cdmembers = getClassMembers(fromClass, true);
|
List<ProgramElementDoc> cdmembers = getClassMembers(fromClass, true);
|
||||||
List incllist = new ArrayList();
|
List<ProgramElementDoc> incllist = new ArrayList<ProgramElementDoc>();
|
||||||
for (int i = 0; i < cdmembers.size(); i++) {
|
for (int i = 0; i < cdmembers.size(); i++) {
|
||||||
ProgramElementDoc pgmelem =
|
ProgramElementDoc pgmelem = cdmembers.get(i);
|
||||||
(ProgramElementDoc)(cdmembers.get(i));
|
|
||||||
if (!found(members, pgmelem) &&
|
if (!found(members, pgmelem) &&
|
||||||
memberIsVisible(pgmelem) &&
|
memberIsVisible(pgmelem) &&
|
||||||
!isOverridden(pgmelem, level)) {
|
!isOverridden(pgmelem, level)) {
|
||||||
@ -373,7 +372,7 @@ public class VisibleMemberMap {
|
|||||||
/**
|
/**
|
||||||
* Return all available class members.
|
* Return all available class members.
|
||||||
*/
|
*/
|
||||||
private List getClassMembers(ClassDoc cd, boolean filter) {
|
private List<ProgramElementDoc> getClassMembers(ClassDoc cd, boolean filter) {
|
||||||
if (cd.isEnum() && kind == CONSTRUCTORS) {
|
if (cd.isEnum() && kind == CONSTRUCTORS) {
|
||||||
//If any of these rules are hit, return empty array because
|
//If any of these rules are hit, return empty array because
|
||||||
//we don't document these members ever.
|
//we don't document these members ever.
|
||||||
@ -428,16 +427,15 @@ public class VisibleMemberMap {
|
|||||||
*/
|
*/
|
||||||
private AnnotationTypeElementDoc[] filter(AnnotationTypeDoc doc,
|
private AnnotationTypeElementDoc[] filter(AnnotationTypeDoc doc,
|
||||||
boolean required) {
|
boolean required) {
|
||||||
AnnotationTypeElementDoc[] members = ((AnnotationTypeDoc) doc).elements();
|
AnnotationTypeElementDoc[] members = doc.elements();
|
||||||
List targetMembers = new ArrayList();
|
List<AnnotationTypeElementDoc> targetMembers = new ArrayList<AnnotationTypeElementDoc>();
|
||||||
for (int i = 0; i < members.length; i++) {
|
for (int i = 0; i < members.length; i++) {
|
||||||
if ((required && members[i].defaultValue() == null) ||
|
if ((required && members[i].defaultValue() == null) ||
|
||||||
((!required) && members[i].defaultValue() != null)){
|
((!required) && members[i].defaultValue() != null)){
|
||||||
targetMembers.add(members[i]);
|
targetMembers.add(members[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (AnnotationTypeElementDoc[])
|
return targetMembers.toArray(new AnnotationTypeElementDoc[]{});
|
||||||
targetMembers.toArray(new AnnotationTypeElementDoc[]{});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean found(List list, ProgramElementDoc elem) {
|
private boolean found(List list, ProgramElementDoc elem) {
|
||||||
|
@ -84,7 +84,7 @@ public abstract class LinkFactory {
|
|||||||
owner instanceof ClassDoc) {
|
owner instanceof ClassDoc) {
|
||||||
linkInfo.classDoc = (ClassDoc) owner;
|
linkInfo.classDoc = (ClassDoc) owner;
|
||||||
linkInfo.label = type.typeName();
|
linkInfo.label = type.typeName();
|
||||||
linkOutput.append(getClassLink((LinkInfo) linkInfo));
|
linkOutput.append(getClassLink(linkInfo));
|
||||||
} else {
|
} else {
|
||||||
//No need to link method type parameters.
|
//No need to link method type parameters.
|
||||||
linkInfo.displayLength += type.typeName().length();
|
linkInfo.displayLength += type.typeName().length();
|
||||||
@ -113,7 +113,7 @@ public abstract class LinkFactory {
|
|||||||
return linkOutput;
|
return linkOutput;
|
||||||
} else {
|
} else {
|
||||||
linkInfo.classDoc = type.asClassDoc();
|
linkInfo.classDoc = type.asClassDoc();
|
||||||
linkOutput = getClassLink((LinkInfo) linkInfo);
|
linkOutput = getClassLink(linkInfo);
|
||||||
if (linkInfo.includeTypeAsSepLink) {
|
if (linkInfo.includeTypeAsSepLink) {
|
||||||
linkOutput.append(getTypeParameterLinks(linkInfo, false));
|
linkOutput.append(getTypeParameterLinks(linkInfo, false));
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ public abstract class LinkFactory {
|
|||||||
return linkOutput;
|
return linkOutput;
|
||||||
} else if (linkInfo.classDoc != null) {
|
} else if (linkInfo.classDoc != null) {
|
||||||
//Just a class link
|
//Just a class link
|
||||||
LinkOutput linkOutput = getClassLink((LinkInfo) linkInfo);
|
LinkOutput linkOutput = getClassLink(linkInfo);
|
||||||
if (linkInfo.includeTypeAsSepLink) {
|
if (linkInfo.includeTypeAsSepLink) {
|
||||||
linkOutput.append(getTypeParameterLinks(linkInfo, false));
|
linkOutput.append(getTypeParameterLinks(linkInfo, false));
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ import java.util.StringTokenizer;
|
|||||||
*/
|
*/
|
||||||
public class DocletInvoker {
|
public class DocletInvoker {
|
||||||
|
|
||||||
private final Class docletClass;
|
private final Class<?> docletClass;
|
||||||
|
|
||||||
private final String docletClassName;
|
private final String docletClassName;
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ public abstract class ExecutableMemberDocImpl
|
|||||||
StringBuffer result = new StringBuffer();
|
StringBuffer result = new StringBuffer();
|
||||||
result.append("(");
|
result.append("(");
|
||||||
for (List<Type> types = sym.type.getParameterTypes(); types.nonEmpty(); ) {
|
for (List<Type> types = sym.type.getParameterTypes(); types.nonEmpty(); ) {
|
||||||
Type t = (Type)types.head;
|
Type t = types.head;
|
||||||
result.append(TypeMaker.getTypeString(env, t, full));
|
result.append(TypeMaker.getTypeString(env, t, full));
|
||||||
types = types.tail;
|
types = types.tail;
|
||||||
if (types.nonEmpty()) {
|
if (types.nonEmpty()) {
|
||||||
|
@ -86,7 +86,7 @@ public class JavadocEnter extends Enter {
|
|||||||
if (tree.sym != null && tree.sym.kind == Kinds.TYP) {
|
if (tree.sym != null && tree.sym.kind == Kinds.TYP) {
|
||||||
if (tree.sym == null) return;
|
if (tree.sym == null) return;
|
||||||
String comment = env.toplevel.docComments.get(tree);
|
String comment = env.toplevel.docComments.get(tree);
|
||||||
ClassSymbol c = (ClassSymbol)tree.sym;
|
ClassSymbol c = tree.sym;
|
||||||
docenv.makeClassDoc(c, comment, tree, env.toplevel.lineMap);
|
docenv.makeClassDoc(c, comment, tree, env.toplevel.lineMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ class JavadocMemberEnter extends MemberEnter {
|
|||||||
|
|
||||||
public void visitMethodDef(JCMethodDecl tree) {
|
public void visitMethodDef(JCMethodDecl tree) {
|
||||||
super.visitMethodDef(tree);
|
super.visitMethodDef(tree);
|
||||||
MethodSymbol meth = (MethodSymbol)tree.sym;
|
MethodSymbol meth = tree.sym;
|
||||||
if (meth == null || meth.kind != Kinds.MTH) return;
|
if (meth == null || meth.kind != Kinds.MTH) return;
|
||||||
String docComment = env.toplevel.docComments.get(tree);
|
String docComment = env.toplevel.docComments.get(tree);
|
||||||
Position.LineMap lineMap = env.toplevel.lineMap;
|
Position.LineMap lineMap = env.toplevel.lineMap;
|
||||||
@ -82,7 +82,7 @@ class JavadocMemberEnter extends MemberEnter {
|
|||||||
!isParameter(tree.sym)) {
|
!isParameter(tree.sym)) {
|
||||||
String docComment = env.toplevel.docComments.get(tree);
|
String docComment = env.toplevel.docComments.get(tree);
|
||||||
Position.LineMap lineMap = env.toplevel.lineMap;
|
Position.LineMap lineMap = env.toplevel.lineMap;
|
||||||
docenv.makeFieldDoc((VarSymbol)tree.sym, docComment, tree, lineMap);
|
docenv.makeFieldDoc(tree.sym, docComment, tree, lineMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -450,7 +450,7 @@ class SeeTagImpl extends TagImpl implements SeeTag, LayoutCharacters {
|
|||||||
if (typeId.length() > 0) {
|
if (typeId.length() > 0) {
|
||||||
paramList.append(typeId.toString());
|
paramList.append(typeId.toString());
|
||||||
}
|
}
|
||||||
return (String[])paramList.toArray(new String[paramList.length()]);
|
return paramList.toArray(new String[paramList.length()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addTypeToParamList() {
|
void addTypeToParamList() {
|
||||||
|
@ -267,7 +267,7 @@ class SerializedForm {
|
|||||||
* @return an array of MethodDocImpl for serialization methods in this class.
|
* @return an array of MethodDocImpl for serialization methods in this class.
|
||||||
*/
|
*/
|
||||||
MethodDoc[] methods() {
|
MethodDoc[] methods() {
|
||||||
return (MethodDoc[])methods.toArray(new MethodDoc[methods.length()]);
|
return methods.toArray(new MethodDoc[methods.length()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -324,7 +324,7 @@ public abstract class Gen {
|
|||||||
|
|
||||||
FieldDoc[] getAllFields(ClassDoc subclazz)
|
FieldDoc[] getAllFields(ClassDoc subclazz)
|
||||||
throws ClassNotFoundException {
|
throws ClassNotFoundException {
|
||||||
Vector fields = new Vector();
|
Vector<FieldDoc> fields = new Vector<FieldDoc>();
|
||||||
ClassDoc cd = null;
|
ClassDoc cd = null;
|
||||||
Stack s = new Stack();
|
Stack s = new Stack();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user