diff options
Diffstat (limited to 'tools/gnu/classpath/tools/doclets/AbstractDoclet.java')
-rw-r--r-- | tools/gnu/classpath/tools/doclets/AbstractDoclet.java | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/tools/gnu/classpath/tools/doclets/AbstractDoclet.java b/tools/gnu/classpath/tools/doclets/AbstractDoclet.java index 8ac9add68..4369782f9 100644 --- a/tools/gnu/classpath/tools/doclets/AbstractDoclet.java +++ b/tools/gnu/classpath/tools/doclets/AbstractDoclet.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -16,7 +16,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. +02111-1307 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and @@ -141,7 +141,7 @@ public abstract class AbstractDoclet protected abstract void run() throws DocletConfigurationException, IOException; - public static boolean start(RootDoc rootDoc) + public static boolean start(RootDoc rootDoc) { try { @@ -189,7 +189,7 @@ public abstract class AbstractDoclet // Process command line options for (int i=0, ilim=rootDoc.options().length; i<ilim; ++i) { - + String[] optionArr = rootDoc.options()[i]; String _optionTag = optionArr[0]; @@ -209,7 +209,7 @@ public abstract class AbstractDoclet if (!getTargetDirectory().exists()) { if (!getTargetDirectory().mkdirs()) { - throw new DocletConfigurationException("Cannot create target directory " + throw new DocletConfigurationException("Cannot create target directory " + getTargetDirectory()); } } @@ -222,44 +222,44 @@ public abstract class AbstractDoclet return optionTargetDirectory.getValue(); } - private DocletOptionFile optionTargetDirectory = - new DocletOptionFile("-d", + private DocletOptionFile optionTargetDirectory = + new DocletOptionFile("-d", new File(System.getProperty("user.dir"))); - private DocletOptionFlag optionNoEmailWarn = + private DocletOptionFlag optionNoEmailWarn = new DocletOptionFlag("-noemailwarn"); - private DocletOptionFlag optionAuthor = + private DocletOptionFlag optionAuthor = new DocletOptionFlag("-author"); - private DocletOptionFlag optionVersion = + private DocletOptionFlag optionVersion = new DocletOptionFlag("-version"); - private DocletOptionFlag optionNoSince = + private DocletOptionFlag optionNoSince = new DocletOptionFlag("-nosince"); - private DocletOptionFlag optionNoDeprecated = + private DocletOptionFlag optionNoDeprecated = new DocletOptionFlag("-nodeprecated"); - private DocletOptionGroup optionGroup = + private DocletOptionGroup optionGroup = new DocletOptionGroup("-group"); - private DocletOptionPackageWildcard optionNoQualifier = + private DocletOptionPackageWildcard optionNoQualifier = new DocletOptionPackageWildcard("-noqualifier", true); - private DocletOptionFlag optionDocFilesSubDirs = + private DocletOptionFlag optionDocFilesSubDirs = new DocletOptionFlag("-docfilessubdirs"); - private DocletOptionColonSeparated optionExcludeDocFilesSubDir = + private DocletOptionColonSeparated optionExcludeDocFilesSubDir = new DocletOptionColonSeparated("-excludedocfilessubdir"); - private DocletOptionTagletPath optionTagletPath = + private DocletOptionTagletPath optionTagletPath = new DocletOptionTagletPath("-tagletpath"); - private DocletOptionTag optionTaglet = + private DocletOptionTag optionTaglet = new DocletOptionTag("-taglet"); - private DocletOptionTag optionTag = + private DocletOptionTag optionTag = new DocletOptionTag("-tag"); private class DocletOptionTaglet @@ -269,7 +269,7 @@ public abstract class AbstractDoclet { super(optionName); } - + public int getLength() { return 2; @@ -340,14 +340,14 @@ public abstract class AbstractDoclet } } - private class DocletOptionGroup + private class DocletOptionGroup extends DocletOption { DocletOptionGroup(String optionName) { super(optionName); } - + public int getLength() { return 3; @@ -363,7 +363,7 @@ public abstract class AbstractDoclet String packageWildcard = tokenizer.nextToken(); packageMatcher.addWildcard(packageWildcard); } - + SortedSet groupPackages = packageMatcher.filter(rootDoc.specifiedPackages()); packageGroups.add(new PackageGroup(optionArr[1], groupPackages)); @@ -384,7 +384,7 @@ public abstract class AbstractDoclet { super(optionName); } - + public int getLength() { return 2; @@ -404,7 +404,7 @@ public abstract class AbstractDoclet { super(optionName); } - + public int getLength() { return 2; @@ -426,7 +426,7 @@ public abstract class AbstractDoclet } else { mentionedTags.add(taglet); - + // re-append taglet tagletMap.remove(tagSpec); tagletMap.put(tagSpec, taglet); @@ -456,11 +456,11 @@ public abstract class AbstractDoclet boolean tagScopeMethods = false; boolean tagScopeFields = false; boolean tagDisabled = false; - + tag_option_loop: for (int n=ndx1+1; n<ndx2; ++n) { switch (tagSpec.charAt(n)) { - case 'X': + case 'X': tagDisabled = true; break; case 'a': @@ -494,7 +494,7 @@ public abstract class AbstractDoclet break tag_option_loop; } } - + if (validTagSpec) { GenericTaglet taglet = new GenericTaglet(tagName, @@ -518,7 +518,7 @@ public abstract class AbstractDoclet } } - private DocletOption[] commonOptions = + private DocletOption[] commonOptions = { optionTargetDirectory, optionAuthor, @@ -553,7 +553,7 @@ public abstract class AbstractDoclet private boolean optionsRegistered = false; - private void registerOption(DocletOption option) + private void registerOption(DocletOption option) { nameToOptionMap.put(option.getName(), option); } @@ -618,14 +618,14 @@ public abstract class AbstractDoclet return name; } } - + private Map categorizedIndex; protected Map getCategorizedIndex() { if (null == categorizedIndex) { categorizedIndex = new LinkedHashMap(); - + Map indexMap = getIndexByName(); LinkedList keys = new LinkedList(); //indexMap.keySet().size()); keys.addAll(indexMap.keySet()); @@ -658,7 +658,7 @@ public abstract class AbstractDoclet // Create index // Collect index - + indexByName = new HashMap(); //TreeMap(); // Add packages to index @@ -707,7 +707,7 @@ public abstract class AbstractDoclet tagletMap.put(taglet.getName(), taglet); } - protected void printTaglets(Tag[] tags, TagletContext context, TagletPrinter output, boolean inline) + protected void printTaglets(Tag[] tags, TagletContext context, TagletPrinter output, boolean inline) { for (Iterator it = tagletMap.keySet().iterator(); it.hasNext(); ) { String tagName = (String)it.next(); @@ -715,9 +715,9 @@ public abstract class AbstractDoclet Taglet taglet = (Taglet)o; Doc doc = context.getDoc(); if (inline == taglet.isInlineTag() - && ((doc == null + && ((doc == null && taglet.inOverview()) - || (doc != null + || (doc != null && ((doc.isConstructor() && taglet.inConstructor()) || (doc.isField() && taglet.inField()) || (doc.isMethod() && taglet.inMethod()) @@ -750,7 +750,7 @@ public abstract class AbstractDoclet } } - protected void printInlineTaglet(Tag tag, TagletContext context, TagletPrinter output) + protected void printInlineTaglet(Tag tag, TagletContext context, TagletPrinter output) { Taglet taglet = (Taglet)tagletMap.get(tag.name().substring(1)); if (null != taglet) { @@ -770,7 +770,7 @@ public abstract class AbstractDoclet } } - protected void printMainTaglets(Tag[] tags, TagletContext context, TagletPrinter output) + protected void printMainTaglets(Tag[] tags, TagletContext context, TagletPrinter output) { printTaglets(tags, context, output, false); } @@ -811,7 +811,7 @@ public abstract class AbstractDoclet ClassDoc[] classes = rootDoc.classes(); for (int i = 0, ilim = classes.length; i < ilim; ++ i) { ClassDoc clazz = classes[i]; - + if (clazz.isInterface()) { // classes implementing InterfaceRelation relation @@ -825,7 +825,7 @@ public abstract class AbstractDoclet } else { // classes derived from - for (ClassDoc superclass = clazz.superclass(); superclass != null; + for (ClassDoc superclass = clazz.superclass(); superclass != null; superclass = superclass.superclass()) { addUsedBy(_usedClassToPackagesMap, superclass, UsageType.CLASS_DERIVED_FROM, clazz, clazz.containingPackage()); @@ -836,11 +836,11 @@ public abstract class AbstractDoclet for (int j = 0, jlim = fields.length; j < jlim; ++ j) { FieldDoc field = fields[j]; - // fields of type + // fields of type ClassDoc fieldType = field.type().asClassDoc(); if (null != fieldType) { addUsedBy(_usedClassToPackagesMap, - fieldType, UsageType.FIELD_OF_TYPE, + fieldType, UsageType.FIELD_OF_TYPE, field, clazz.containingPackage()); } } @@ -854,7 +854,7 @@ public abstract class AbstractDoclet ClassDoc returnType = method.returnType().asClassDoc(); if (null != returnType) { addUsedBy(_usedClassToPackagesMap, - returnType, UsageType.METHOD_WITH_RETURN_TYPE, + returnType, UsageType.METHOD_WITH_RETURN_TYPE, method, clazz.containingPackage()); } Parameter[] parameters = method.parameters(); @@ -866,7 +866,7 @@ public abstract class AbstractDoclet ClassDoc parameterType = parameter.type().asClassDoc(); if (null != parameterType) { addUsedBy(_usedClassToPackagesMap, - parameterType, UsageType.METHOD_WITH_PARAMETER_TYPE, + parameterType, UsageType.METHOD_WITH_PARAMETER_TYPE, method, clazz.containingPackage()); } } @@ -877,11 +877,11 @@ public abstract class AbstractDoclet for (int k = 0, klim = thrownExceptions.length; k < klim; ++ k) { ClassDoc thrownException = thrownExceptions[k]; addUsedBy(_usedClassToPackagesMap, - thrownException, UsageType.METHOD_WITH_THROWN_TYPE, + thrownException, UsageType.METHOD_WITH_THROWN_TYPE, method, clazz.containingPackage()); } } - + ConstructorDoc[] constructors = clazz.constructors(); for (int j = 0, jlim = constructors.length; j < jlim; ++ j) { @@ -891,12 +891,12 @@ public abstract class AbstractDoclet for (int k = 0, klim = parameters.length; k < klim; ++ k) { // constructors with parameter type - + Parameter parameter = parameters[k]; ClassDoc parameterType = parameter.type().asClassDoc(); if (null != parameterType) { addUsedBy(_usedClassToPackagesMap, - parameterType, UsageType.CONSTRUCTOR_WITH_PARAMETER_TYPE, + parameterType, UsageType.CONSTRUCTOR_WITH_PARAMETER_TYPE, constructor, clazz.containingPackage()); } } @@ -907,7 +907,7 @@ public abstract class AbstractDoclet for (int k = 0, klim = thrownExceptions.length; k < klim; ++ k) { ClassDoc thrownException = thrownExceptions[k]; addUsedBy(_usedClassToPackagesMap, - thrownException, UsageType.CONSTRUCTOR_WITH_THROWN_TYPE, + thrownException, UsageType.CONSTRUCTOR_WITH_THROWN_TYPE, constructor, clazz.containingPackage()); } } @@ -948,8 +948,8 @@ public abstract class AbstractDoclet return this.id.compareTo(((UsageType)other).id); } - public String toString() { - return "UsageType{id=" + id + "}"; + public String toString() { + return "UsageType{id=" + id + "}"; } public String getId() { @@ -1062,33 +1062,33 @@ public abstract class AbstractDoclet throw new IOException("Couldn't locate source file for class " + classDoc.qualifiedTypeName()); } - protected void printError(String error) + protected void printError(String error) { if (null != rootDoc) { - rootDoc.printError(error); + rootDoc.printError(error); } else { - System.err.println("ERROR: "+error); + System.err.println("ERROR: "+error); } } - protected void printWarning(String warning) + protected void printWarning(String warning) { if (null != rootDoc) { - rootDoc.printWarning(warning); + rootDoc.printWarning(warning); } else { - System.err.println("WARNING: "+warning); + System.err.println("WARNING: "+warning); } } - protected void printNotice(String notice) + protected void printNotice(String notice) { if (null != rootDoc) { - rootDoc.printNotice(notice); + rootDoc.printNotice(notice); } else { - System.err.println(notice); + System.err.println(notice); } } @@ -1130,7 +1130,7 @@ public abstract class AbstractDoclet protected String possiblyQualifiedName(Type type) { - if (null == type.asClassDoc() + if (null == type.asClassDoc() || !omitPackageQualifier(type.asClassDoc().containingPackage())) { return type.qualifiedTypeName(); } @@ -1224,7 +1224,7 @@ public abstract class AbstractDoclet Iterator it = interfaceRelations.keySet().iterator(); while (it.hasNext()) { ClassDoc interfaceDoc = (ClassDoc)it.next(); - InterfaceRelation relation + InterfaceRelation relation = (InterfaceRelation)interfaceRelations.get(interfaceDoc); Iterator superIt = relation.superInterfaces.iterator(); while (superIt.hasNext()) { @@ -1306,7 +1306,7 @@ public abstract class AbstractDoclet } protected abstract String renderTag(String tagName, Tag[] tags, TagletContext context); - + protected abstract String getDocletVersion(); protected SortedSet getThrownExceptions(ExecutableMemberDoc execMemberDoc) @@ -1319,7 +1319,7 @@ public abstract class AbstractDoclet return result; } - protected boolean isUncheckedException(ClassDoc classDoc) + protected boolean isUncheckedException(ClassDoc classDoc) { if (classDoc.isException()) { while (null != classDoc) { @@ -1360,7 +1360,7 @@ public abstract class AbstractDoclet ClassDoc[] interfaces = cd.interfaces(); for (int i=0; i<interfaces.length; ++i) { result.add(interfaces[i]); - InterfaceRelation relation + InterfaceRelation relation = (InterfaceRelation)getInterfaceRelations().get(interfaces[i]); if (null != relation) { result.addAll(relation.superInterfaces); |