APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.javadoc.internal.doclets.toolkit.util

public Class ClassUseMapper

extends Object
Class Inheritance
Imports
java.util.*, javax.lang.model.element.AnnotationMirror, .Element, .ExecutableElement, .PackageElement, .TypeElement, .TypeParameterElement, .VariableElement, javax.lang.model.type.ArrayType, .DeclaredType, .ErrorType, .TypeMirror, .TypeVariable, .WildcardType, javax.lang.model.util.ElementFilter, .Elements, .SimpleElementVisitor14, .SimpleTypeVisitor9, .Types, jdk.javadoc.doclet.DocletEnvironment, jdk.javadoc.internal.doclets.toolkit.BaseConfiguration

Map all class uses for a given class.

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.

Field Summary

Modifier and TypeField and Description
public final Map<TypeElement, List<VariableElement>>
annotationToField

The mapping of TypeElements representing annotation to fields that use them.

public final Map<TypeElement, Set<TypeElement>>
classToClass

Mapping of TypeElements to a set of TypeElements used by that class.

public final Map<TypeElement, List<TypeElement>>
classToClassAnnotations

The mapping of TypeElement representing annotation to TypeElements that use them.

public final Map<TypeElement, List<TypeElement>>
classToClassTypeParam

The mapping of TypeElement to TypeElement that use them as type parameters.

public final Map<TypeElement, List<ExecutableElement>>
classToConstructorAnnotations

The mapping of TypeElements representing annotations to constructors that use them.

public final Map<TypeElement, List<ExecutableElement>>
classToConstructorArgs

Mapping of TypeElements to list of ExecutableElements (constructors) having that class as an arg.

public final Map<TypeElement, List<ExecutableElement>>
classToConstructorArgTypeParam

The mapping of TypeElements to constructor arguments that use them as type parameters.

public final Map<TypeElement, List<ExecutableElement>>
classToConstructorParamAnnotation

The mapping of TypeElement representing annotations to constructor parameters that use them.

public final Map<TypeElement, List<ExecutableElement>>
classToConstructorThrows

Mapping of TypeElements to list of constructors which throws that class.

public final Map<TypeElement, List<VariableElement>>
classToField

Mapping of TypeElements to list of VariableElements declared as that class.

public final Map<TypeElement, List<VariableElement>>
classToFieldTypeParam

The mapping of TypeElements to fields that use them as type parameters.

public final Map<TypeElement, List<TypeElement>>
classToImplementingClass

Mapping of TypeElements to list of TypeElements which implement this interface.

public final Map<TypeElement, List<TypeElement>>
classToImplementsTypeParam

Mapping of TypeElements to list of TypeElements which use them in implemented interface type parameters.

public final Map<TypeElement, List<ExecutableElement>>
classToMethodAnnotations

The mapping of TypeElement representing annotation to methods that use them.

public final Map<TypeElement, List<ExecutableElement>>
classToMethodArgs

Mapping of TypeElements to list of ExecutableElements having that class as an arg.

public final Map<TypeElement, List<ExecutableElement>>
classToMethodArgTypeParam

The mapping of TypeElement to method arguments that use them as type parameters.

public final Map<TypeElement, List<ExecutableElement>>
classToMethodParamAnnotation

The mapping of TypeElements representing annotations to method parameters that use them.

public final Map<TypeElement, List<ExecutableElement>>
classToMethodReturn

Mapping of TypeElements to list of ExecutableElements returning that class.

public final Map<TypeElement, List<ExecutableElement>>
classToMethodReturnTypeParam

The mapping of TypeElements to methods that have return type with type parameters of that class.

public final Map<TypeElement, List<ExecutableElement>>
classToMethodThrows

Mapping of TypeElements to list of ExecutableElements which throws that class.

public final Map<TypeElement, List<ExecutableElement>>
classToMethodTypeParam

The mapping of TypeElement to methods that use them as type parameters.

public final Map<TypeElement, Set<PackageElement>>
classToPackage

Mapping of TypeElements to set of PackageElements used by that class.

public final Map<TypeElement, List<PackageElement>>
classToPackageAnnotations

Mapping of TypeElements representing annotations to a set of PackageElements that use the annotation.

public final Map<TypeElement, List<TypeElement>>
classToSubclass

Mapping of TypeElements to a list of TypeElements which are direct or indirect subClasses of that class.

public final Map<TypeElement, List<TypeElement>>
classToSubclassTypeParam

Mapping of TypeElements to list of TypeElements which use them in superclass type parameters.

public final Map<TypeElement, List<TypeElement>>
classToSubinterface

Mapping of TypeElements to list of TypeElements which are direct or indirect subInterfaces of that interface.

public final Map<TypeElement, List<TypeElement>>
classToSubinterfaceTypeParam

Mapping of TypeElements to list of TypeElements which use them in superinterface type parameters.

private final ClassTree
private final Comparators
private final DocletEnvironment
private final Elements
private final Types
private final Utils

Constructor Summary

AccessConstructor and Description
public
ClassUseMapper(BaseConfiguration configuration, ClassTree classTree)

Method Summary

Modifier and TypeMethod and Description
private <T extends Element> void
add(Map<TypeElement, List<T>> map, TypeElement te, T ref)

private void
private <T extends Element> void
addTypeParameterToMap(final Map<TypeElement, List<T>> map, TypeMirror type, final T holder)

private Set<TypeElement>
private Collection<TypeElement>
implementingClasses(TypeElement te)

Return all implementing classes of an interface (including all subClasses of implementing classes and all classes implementing subInterfaces) AND fill-in both classToImplementingClass and classToSubinterface maps.

private <T extends Element> void
mapAnnotations(final Map<TypeElement, List<T>>
the map the insert the information into.
map
,
Element
whose type parameters are being checked.
e
,
final T
owning the type parameters.
holder
)

Map the AnnotationType to the members that use them as type parameters.

private void
mapExecutable(ExecutableElement ee)

Determine classes used by a method or constructor, so they can be inverse mapped.

private <T extends Element> void
mapTypeParameters(final Map<TypeElement, List<T>>
the map the insert the information into.
map
,
Element
the te whose type parameters are being checked.
element
,
final T
the holder that owns the type parameters.
holder
)

Map the TypeElements to the members that use them as type parameters.

private <T extends Element> void
mapTypeParameters(final Map<TypeElement, List<T>> map, TypeMirror aType, final T holder)

private Set<PackageElement>
private <T> List<T>
refList(Map<TypeElement, List<T>> map, TypeElement element)

private Collection<TypeElement>
subclasses(TypeElement te)

Return all subClasses of a class AND fill-in classToSubclass map.

private Collection<TypeElement>
subinterfaces(TypeElement te)

Return all subInterfaces of an interface AND fill-in classToSubinterface map.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

annotationToFieldback to summary
public final Map<TypeElement, List<VariableElement>> annotationToField

The mapping of TypeElements representing annotation to fields that use them.

classToClassback to summary
public final Map<TypeElement, Set<TypeElement>> classToClass

Mapping of TypeElements to a set of TypeElements used by that class.

classToClassAnnotationsback to summary
public final Map<TypeElement, List<TypeElement>> classToClassAnnotations

The mapping of TypeElement representing annotation to TypeElements that use them.

classToClassTypeParamback to summary
public final Map<TypeElement, List<TypeElement>> classToClassTypeParam

The mapping of TypeElement to TypeElement that use them as type parameters.

classToConstructorAnnotationsback to summary
public final Map<TypeElement, List<ExecutableElement>> classToConstructorAnnotations

The mapping of TypeElements representing annotations to constructors that use them.

classToConstructorArgsback to summary
public final Map<TypeElement, List<ExecutableElement>> classToConstructorArgs

Mapping of TypeElements to list of ExecutableElements (constructors) having that class as an arg.

classToConstructorArgTypeParamback to summary
public final Map<TypeElement, List<ExecutableElement>> classToConstructorArgTypeParam

The mapping of TypeElements to constructor arguments that use them as type parameters.

classToConstructorParamAnnotationback to summary
public final Map<TypeElement, List<ExecutableElement>> classToConstructorParamAnnotation

The mapping of TypeElement representing annotations to constructor parameters that use them.

classToConstructorThrowsback to summary
public final Map<TypeElement, List<ExecutableElement>> classToConstructorThrows

Mapping of TypeElements to list of constructors which throws that class.

classToFieldback to summary
public final Map<TypeElement, List<VariableElement>> classToField

Mapping of TypeElements to list of VariableElements declared as that class.

classToFieldTypeParamback to summary
public final Map<TypeElement, List<VariableElement>> classToFieldTypeParam

The mapping of TypeElements to fields that use them as type parameters.

classToImplementingClassback to summary
public final Map<TypeElement, List<TypeElement>> classToImplementingClass

Mapping of TypeElements to list of TypeElements which implement this interface.

classToImplementsTypeParamback to summary
public final Map<TypeElement, List<TypeElement>> classToImplementsTypeParam

Mapping of TypeElements to list of TypeElements which use them in implemented interface type parameters.

classToMethodAnnotationsback to summary
public final Map<TypeElement, List<ExecutableElement>> classToMethodAnnotations

The mapping of TypeElement representing annotation to methods that use them.

classToMethodArgsback to summary
public final Map<TypeElement, List<ExecutableElement>> classToMethodArgs

Mapping of TypeElements to list of ExecutableElements having that class as an arg.

classToMethodArgTypeParamback to summary
public final Map<TypeElement, List<ExecutableElement>> classToMethodArgTypeParam

The mapping of TypeElement to method arguments that use them as type parameters.

classToMethodParamAnnotationback to summary
public final Map<TypeElement, List<ExecutableElement>> classToMethodParamAnnotation

The mapping of TypeElements representing annotations to method parameters that use them.

classToMethodReturnback to summary
public final Map<TypeElement, List<ExecutableElement>> classToMethodReturn

Mapping of TypeElements to list of ExecutableElements returning that class.

classToMethodReturnTypeParamback to summary
public final Map<TypeElement, List<ExecutableElement>> classToMethodReturnTypeParam

The mapping of TypeElements to methods that have return type with type parameters of that class.

classToMethodThrowsback to summary
public final Map<TypeElement, List<ExecutableElement>> classToMethodThrows

Mapping of TypeElements to list of ExecutableElements which throws that class.

classToMethodTypeParamback to summary
public final Map<TypeElement, List<ExecutableElement>> classToMethodTypeParam

The mapping of TypeElement to methods that use them as type parameters.

classToPackageback to summary
public final Map<TypeElement, Set<PackageElement>> classToPackage

Mapping of TypeElements to set of PackageElements used by that class.

classToPackageAnnotationsback to summary
public final Map<TypeElement, List<PackageElement>> classToPackageAnnotations

Mapping of TypeElements representing annotations to a set of PackageElements that use the annotation.

classToSubclassback to summary
public final Map<TypeElement, List<TypeElement>> classToSubclass

Mapping of TypeElements to a list of TypeElements which are direct or indirect subClasses of that class.

classToSubclassTypeParamback to summary
public final Map<TypeElement, List<TypeElement>> classToSubclassTypeParam

Mapping of TypeElements to list of TypeElements which use them in superclass type parameters.

classToSubinterfaceback to summary
public final Map<TypeElement, List<TypeElement>> classToSubinterface

Mapping of TypeElements to list of TypeElements which are direct or indirect subInterfaces of that interface.

classToSubinterfaceTypeParamback to summary
public final Map<TypeElement, List<TypeElement>> classToSubinterfaceTypeParam

Mapping of TypeElements to list of TypeElements which use them in superinterface type parameters.

classTreeback to summary
private final ClassTree classTree
comparatorsback to summary
private final Comparators comparators
docEnvback to summary
private final DocletEnvironment docEnv
elementUtilsback to summary
private final Elements elementUtils
typeUtilsback to summary
private final Types typeUtils
utilsback to summary
private final Utils utils

Constructor Detail

ClassUseMapperback to summary
public ClassUseMapper(BaseConfiguration configuration, ClassTree classTree)

Method Detail

addback to summary
private <T extends Element> void add(Map<TypeElement, List<T>> map, TypeElement te, T ref)
addAllback to summary
private void addAll(Map<TypeElement, List<TypeElement>> map, TypeElement te, Collection<TypeElement> refs)
addTypeParameterToMapback to summary
private <T extends Element> void addTypeParameterToMap(final Map<TypeElement, List<T>> map, TypeMirror type, final T holder)
classSetback to summary
private Set<TypeElement> classSet(TypeElement te)
implementingClassesback to summary
private Collection<TypeElement> implementingClasses(TypeElement te)

Return all implementing classes of an interface (including all subClasses of implementing classes and all classes implementing subInterfaces) AND fill-in both classToImplementingClass and classToSubinterface maps.

mapAnnotationsback to summary
private <T extends Element> void mapAnnotations(final Map<TypeElement, List<T>> map, Element e, final T holder)

Map the AnnotationType to the members that use them as type parameters.

Parameters
map:Map<TypeElement, List<T>>

the map the insert the information into.

e:Element

whose type parameters are being checked.

holder:T

owning the type parameters.

mapExecutableback to summary
private void mapExecutable(ExecutableElement ee)

Determine classes used by a method or constructor, so they can be inverse mapped.

mapTypeParametersback to summary
private <T extends Element> void mapTypeParameters(final Map<TypeElement, List<T>> map, Element element, final T holder)

Map the TypeElements to the members that use them as type parameters.

Parameters
map:Map<TypeElement, List<T>>

the map the insert the information into.

element:Element

the te whose type parameters are being checked.

holder:T

the holder that owns the type parameters.

mapTypeParametersback to summary
private <T extends Element> void mapTypeParameters(final Map<TypeElement, List<T>> map, TypeMirror aType, final T holder)
packageSetback to summary
private Set<PackageElement> packageSet(TypeElement te)
refListback to summary
private <T> List<T> refList(Map<TypeElement, List<T>> map, TypeElement element)
subclassesback to summary
private Collection<TypeElement> subclasses(TypeElement te)

Return all subClasses of a class AND fill-in classToSubclass map.

subinterfacesback to summary
private Collection<TypeElement> subinterfaces(TypeElement te)

Return all subInterfaces of an interface AND fill-in classToSubinterface map.