Class Utils
java.lang.Object
gw.gosudoc.com.sun.tools.doclets.internal.toolkit.util.Utils
Deprecated.
Utilities Class for Doclets.
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Utils.DocComparator<T extends Doc>
Deprecated.A general purpose comparator to sort Doc entities, basically provides the building blocks for creating specific comparators for an use-case.private static class
Deprecated.We want the list of types in alphabetical order. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addAllInterfaceTypes
(Map<ClassDoc, Type> results, Type type, Type[] interfaceTypes, boolean raw, Configuration configuration) Deprecated.static int
compareCaseCompare
(String s1, String s2) Deprecated.A general purpose case sensitive String comparator, which compares two Strings using a Collator strength of "SECONDARY".private static int
compareStrings
(boolean caseSensitive, String s1, String s2) Deprecated.static int
compareStrings
(String s1, String s2) Deprecated.A general purpose case insensitive String comparator, which compares two Strings using a Collator strength of "TERTIARY".void
copyDocFiles
(Configuration configuration, PackageDoc pd) Deprecated.Copy the given directory contents from the source package directory to the generated documentation directory.void
copyDocFiles
(Configuration configuration, JavaFileManager.Location locn, DocPath dir) Deprecated.excludeDeprecatedMembers
(ProgramElementDoc[] members) Deprecated.Return array of class members whose documentation is to be generated.excludeDeprecatedMembersAsList
(ProgramElementDoc[] members) Deprecated.Return array of class members whose documentation is to be generated.boolean
executableMembersEqual
(ExecutableMemberDoc member1, ExecutableMemberDoc member2) Deprecated.ClassDoc[]
filterOutPrivateClasses
(ClassDoc[] classes, boolean javafx) Deprecated.In case of JavaFX mode on, filters out classes that are private, package private or having the @treatAsPrivate annotation.private void
findAllInterfaceTypes
(Map<ClassDoc, Type> results, ClassDoc c, boolean raw, Configuration configuration) Deprecated.private void
findAllInterfaceTypes
(Map<ClassDoc, Type> results, ParameterizedType p, Configuration configuration) Deprecated.findMethod
(ClassDoc cd, MethodDoc method) Deprecated.Search for the given method in the given class.getAllInterfaces
(Type type, Configuration configuration) Deprecated.getAllInterfaces
(Type type, Configuration configuration, boolean sort) Deprecated.For the class return all implemented interfaces including the superinterfaces of the implementing interfaces, also iterate over for all the superclasses.getFirstVisibleSuperClass
(ClassDoc classDoc, Configuration configuration) Deprecated.Given a class, return the closest visible super class.getFirstVisibleSuperClassCD
(ClassDoc classDoc, Configuration configuration) Deprecated.Given a class, return the closest visible super class.getPackageFileHeadName
(PackageDoc packageDoc) Deprecated.Given a package, return its file name without the extension.getPackageName
(PackageDoc packageDoc) Deprecated.Given a package, return its name.getTypeName
(Configuration config, ClassDoc cd, boolean lowerCaseOnly) Deprecated.Given a ClassDoc, return the name of its type (Class, Interface, etc.).private Type[]
interfaceTypesOf
(Type type) Deprecated.boolean
isCoreClass
(ClassDoc cd) Deprecated.According to The Java™ Language Specification, all the outer classes and static inner classes are core classes.boolean
isDeclarationAnnotation
(AnnotationTypeDoc annotationDoc, boolean isJava5DeclarationLocation) Deprecated.Returns true if theannotationDoc
is to be treated as a declaration annotation, when targeting theelemType
element type.private boolean
isDeclarationTarget
(AnnotationDesc targetAnno) Deprecated.boolean
isDeprecated
(Doc doc) Deprecated.Return true if the given Doc is deprecated.boolean
isDocumentedAnnotation
(AnnotationTypeDoc annotationDoc) Deprecated.Given an annotation, return true if it should be documented and false otherwise.boolean
Deprecated.Test whether the given FieldDoc is one of the declaration annotation ElementTypes defined in Java 5.boolean
isLinkable
(ClassDoc classDoc, Configuration configuration) Deprecated.Return true if this class is linkable and false if we can't link to the desired class.Deprecated.Comparator for ClassUse presentations, and sorted as follows, 1.Deprecated.A comparator for index file presentations, and are sorted as follows: 1.Deprecated.A simple comparator which compares simple names, then the fully qualified names and finally the kinds, ClassUse comparator works well for this purpose.Deprecated.Returns a TypeComparator object suitable for sorting Types.boolean
matches
(ProgramElementDoc doc1, ProgramElementDoc doc2) Deprecated.boolean
nonPublicMemberFound
(ProgramElementDoc[] members) Deprecated.Return true if a non-public member found in the given array.normalizeNewlines
(String text) Deprecated.propertyNameFromMethodName
(Configuration configuration, String name) Deprecated.A convenience method to get property name from the name of the getter or setter method.Deprecated.Enclose in quotes, used for paths and filenames that contains spacesreplaceTabs
(Configuration configuration, String text) Deprecated.Replace all tabs in a string with the appropriate number of spaces.replaceText
(String originalStr, String oldStr, String newStr) Deprecated.Given a string, replace all occurrences of 'newStr' with 'oldStr'.void
setEnumDocumentation
(Configuration configuration, ClassDoc classDoc) Deprecated.The documentation for values() and valueOf() in Enums are set by the doclet.Deprecated.Return the list of ProgramElementDoc objects as Array.
-
Constructor Details
-
Utils
public Utils()Deprecated.
-
-
Method Details
-
excludeDeprecatedMembers
Deprecated.Return array of class members whose documentation is to be generated. If the member is deprecated do not include such a member in the returned array.- Parameters:
members
- Array of members to choose from.- Returns:
- ProgramElementDoc[] Array of eligible members for whom documentation is getting generated.
-
excludeDeprecatedMembersAsList
Deprecated.Return array of class members whose documentation is to be generated. If the member is deprecated do not include such a member in the returned array.- Parameters:
members
- Array of members to choose from.- Returns:
- List List of eligible members for whom documentation is getting generated.
-
toProgramElementDocArray
Deprecated.Return the list of ProgramElementDoc objects as Array. -
nonPublicMemberFound
Deprecated.Return true if a non-public member found in the given array.- Parameters:
members
- Array of members to look into.- Returns:
- boolean True if non-public member found, false otherwise.
-
findMethod
Deprecated.Search for the given method in the given class.- Parameters:
cd
- Class to search into.method
- Method to be searched.- Returns:
- MethodDoc Method found, null otherwise.
-
executableMembersEqual
Deprecated.- Parameters:
member1
- the first method to compare.member2
- the second method to compare.- Returns:
- true if member1 overrides/hides or is overriden/hidden by member2.
-
isCoreClass
Deprecated.According to The Java™ Language Specification, all the outer classes and static inner classes are core classes. -
matches
Deprecated. -
copyDocFiles
Deprecated.Copy the given directory contents from the source package directory to the generated documentation directory. For example for a package java.lang this method find out the source location of the package usingSourcePath
and if given directory is found in the source directory structure, copy the entire directory, to the generated documentation hierarchy.- Parameters:
configuration
- The configuration of the current doclet.path
- The relative path to the directory to be copied.dir
- The original directory name to copy from.overwrite
- Overwrite files if true.
-
copyDocFiles
Deprecated. -
makeTypeComparator
Deprecated.Returns a TypeComparator object suitable for sorting Types.- Returns:
- a TypeComparator objectt
-
getAllInterfaces
Deprecated.For the class return all implemented interfaces including the superinterfaces of the implementing interfaces, also iterate over for all the superclasses. For interface return all the extended interfaces as well as superinterfaces for those extended interfaces.- Parameters:
type
- type whose implemented or super interfaces are sought.configuration
- the current configuration of the doclet.sort
- if true, return list of interfaces sorted alphabetically.- Returns:
- List of all the required interfaces.
-
interfaceTypesOf
Deprecated. -
getAllInterfaces
Deprecated. -
findAllInterfaceTypes
private void findAllInterfaceTypes(Map<ClassDoc, Type> results, ClassDoc c, boolean raw, Configuration configuration) Deprecated. -
findAllInterfaceTypes
private void findAllInterfaceTypes(Map<ClassDoc, Type> results, ParameterizedType p, Configuration configuration) Deprecated. -
addAllInterfaceTypes
private void addAllInterfaceTypes(Map<ClassDoc, Type> results, Type type, Type[] interfaceTypes, boolean raw, Configuration configuration) Deprecated. -
quote
Deprecated.Enclose in quotes, used for paths and filenames that contains spaces -
getPackageName
Deprecated.Given a package, return its name.- Parameters:
packageDoc
- the package to check.- Returns:
- the name of the given package.
-
getPackageFileHeadName
Deprecated.Given a package, return its file name without the extension.- Parameters:
packageDoc
- the package to check.- Returns:
- the file name of the given package.
-
replaceText
Deprecated.Given a string, replace all occurrences of 'newStr' with 'oldStr'.- Parameters:
originalStr
- the string to modify.oldStr
- the string to replace.newStr
- the string to insert in place of the old string.
-
isDocumentedAnnotation
Deprecated.Given an annotation, return true if it should be documented and false otherwise.- Parameters:
annotationDoc
- the annotation to check.- Returns:
- true return true if it should be documented and false otherwise.
-
isDeclarationTarget
Deprecated. -
isDeclarationAnnotation
public boolean isDeclarationAnnotation(AnnotationTypeDoc annotationDoc, boolean isJava5DeclarationLocation) Deprecated.Returns true if theannotationDoc
is to be treated as a declaration annotation, when targeting theelemType
element type.- Parameters:
annotationDoc
- the annotationDoc to checkelemType
- the targeted elemType- Returns:
- true if annotationDoc is a declaration annotation
-
isLinkable
Deprecated.Return true if this class is linkable and false if we can't link to the desired class.
NOTE: You can only link to external classes if they are public or protected.- Parameters:
classDoc
- the class to check.configuration
- the current configuration of the doclet.- Returns:
- true if this class is linkable and false if we can't link to the desired class.
-
getFirstVisibleSuperClass
Deprecated.Given a class, return the closest visible super class.- Parameters:
classDoc
- the class we are searching the parent for.configuration
- the current configuration of the doclet.- Returns:
- the closest visible super class. Return null if it cannot be found (i.e. classDoc is java.lang.Object).
-
getFirstVisibleSuperClassCD
Deprecated.Given a class, return the closest visible super class.- Parameters:
classDoc
- the class we are searching the parent for.configuration
- the current configuration of the doclet.- Returns:
- the closest visible super class. Return null if it cannot be found (i.e. classDoc is java.lang.Object).
-
getTypeName
Deprecated.Given a ClassDoc, return the name of its type (Class, Interface, etc.).- Parameters:
cd
- the ClassDoc to check.lowerCaseOnly
- true if you want the name returned in lower case. If false, the first letter of the name is capitalized.- Returns:
-
replaceTabs
Deprecated.Replace all tabs in a string with the appropriate number of spaces. The string may be a multi-line string.- Parameters:
configuration
- the doclet configuration defining the setting for the tab length.text
- the text for which the tabs should be expanded- Returns:
- the text with all tabs expanded
-
normalizeNewlines
Deprecated. -
setEnumDocumentation
Deprecated.The documentation for values() and valueOf() in Enums are set by the doclet. -
isDeprecated
Deprecated.Return true if the given Doc is deprecated.- Parameters:
doc
- the Doc to check.- Returns:
- true if the given Doc is deprecated.
-
propertyNameFromMethodName
Deprecated.A convenience method to get property name from the name of the getter or setter method.- Parameters:
name
- name of the getter or setter method.- Returns:
- the name of the property of the given setter of getter.
-
filterOutPrivateClasses
Deprecated.In case of JavaFX mode on, filters out classes that are private, package private or having the @treatAsPrivate annotation. Those are not documented in JavaFX mode.- Parameters:
classes
- array of classes to be filtered.javafx
- set to true if in JavaFX mode.- Returns:
- list of filtered classes.
-
isJava5DeclarationElementType
Deprecated.Test whether the given FieldDoc is one of the declaration annotation ElementTypes defined in Java 5. Instead of testing for one of the new enum constants added in Java 8, test for the old constants. This prevents bootstrapping problems.- Parameters:
elt
- The FieldDoc to test- Returns:
- true, iff the given ElementType is one of the constants defined in Java 5
- Since:
- 1.8
-
compareStrings
Deprecated.A general purpose case insensitive String comparator, which compares two Strings using a Collator strength of "TERTIARY".- Parameters:
s1
- first String to compare.s2
- second String to compare.- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
-
compareCaseCompare
Deprecated.A general purpose case sensitive String comparator, which compares two Strings using a Collator strength of "SECONDARY".- Parameters:
s1
- first String to compare.s2
- second String to compare.- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
-
compareStrings
Deprecated. -
makeGeneralPurposeComparator
Deprecated.A simple comparator which compares simple names, then the fully qualified names and finally the kinds, ClassUse comparator works well for this purpose.- Returns:
- a simple general purpose doc comparator
-
makeComparatorForIndexUse
Deprecated.A comparator for index file presentations, and are sorted as follows: 1. sort on simple names of entities 2. if equal, then compare the DocKind ex: Package, Interface etc. 3a. if equal and if the type is of ExecutableMemberDoc(Constructor, Methods), a case insensitive comparison of parameter the type signatures 3b. if equal, case sensitive comparison of the type signatures 4. finally, if equal, compare the FQNs of the entities- Returns:
- a comparator for index file use
-
makeComparatorForClassUse
Deprecated.Comparator for ClassUse presentations, and sorted as follows, 1. compares simple names of entities 2. if equal, the fully qualified names of the entities 3. if equal and if applicable, the string representation of parameter types 3a. first by using case insensitive comparison 3b. second by using a case sensitive comparison 4. finally the Doc kinds ie. package, class, interface etc.- Returns:
- a comparator to sort classes and members for class use
-