Package com.thoughtworks.qdox.type
Class TypeResolver
java.lang.Object
com.thoughtworks.qdox.type.TypeResolver
A per JavaClass resolver of types
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassLibrary
private final String
private final Collection<String>
private final String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
TypeResolver
(String pckg, String declaringClass, ClassLibrary classLibrary, Collection<String> imports) -
Method Summary
Modifier and TypeMethodDescriptionstatic TypeResolver
byClassName
(String binaryName, ClassLibrary classLibrary, Collection<String> imports) static TypeResolver
byPackageName
(String binaryName, ClassLibrary classLibrary, Collection<String> imports) Type resolver in case there's no declaring class, e.g.getJavaClass
(String binaryName) private String
resolveFromLibrary
(String typeName) private String
resolveFullyQualifiedType
(String typeName) private String
resolveImportedType
(String importSpec, String typeName, boolean fullMatch) resolveJavaClass
(String typeName) resolveType
(String typeName) private String
resolveTypeInternal
(String typeName) Resolves a type name
-
Field Details
-
PRIMITIVE_TYPES
-
resolvedTypeCache
-
pckg
-
declaringClass
-
classLibrary
-
imports
-
-
Constructor Details
-
TypeResolver
private TypeResolver(String pckg, String declaringClass, ClassLibrary classLibrary, Collection<String> imports)
-
-
Method Details
-
byPackageName
public static TypeResolver byPackageName(String binaryName, ClassLibrary classLibrary, Collection<String> imports) Type resolver in case there's no declaring class, e.g. using extends, implements and annotations on a toplevel class- Parameters:
binaryName
- the binary name of the packageclassLibrary
- the class libraryimports
- the imports, can benull
- Returns:
- the typeResolver
-
byClassName
public static TypeResolver byClassName(String binaryName, ClassLibrary classLibrary, Collection<String> imports) - Parameters:
binaryName
- the class in which context a type is used.classLibrary
- the class libraryimports
- the imports, can benull
- Returns:
- the typeResolver
-
resolveJavaClass
-
getJavaClass
-
resolveType
-
resolveTypeInternal
Resolves a type nameFollows the Java Language Specification, Version 3.0.
Current resolution order is:
- Single-Type-Import Declaration
- Type-Import-on-Demand Declaration
- Automatic Imports
- Parameters:
typeName
- the name to resolve- Returns:
- the resolved type name, otherwise
null
-
resolveImportedType
-
resolveFromLibrary
-
resolveFullyQualifiedType
-