Class AbstractTypeResolver
java.lang.Object
com.buschmais.jqassistant.plugin.java.api.scanner.AbstractTypeResolver
- All Implemented Interfaces:
TypeResolver
- Direct Known Subclasses:
AbstractArtifactScopedTypeResolver
Abstract base implementation of a type resolver.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddContainedType(String fqn, TypeDescriptor typeDescriptor) Mark a type descriptor as contained by the current scope.protected abstract voidaddRequiredType(String fqn, TypeDescriptor typeDescriptor) Mark a type descriptor as required by the current scope.<T extends ClassFileDescriptor>
TypeCache.CachedType<T>create(String fullQualifiedName, com.buschmais.jqassistant.plugin.common.api.model.FileDescriptor fileDescriptor, Class<T> descriptorType, com.buschmais.jqassistant.core.scanner.api.ScannerContext context) Resolve or create the descriptor for a Java type name.protected abstract TypeDescriptorfindInArtifact(String fullQualifiedName, com.buschmais.jqassistant.core.scanner.api.ScannerContext context) Find a type descriptor in the current scope (e.g. the containing artifact).protected abstract TypeDescriptorfindInDependencies(String fullQualifiedName, com.buschmais.jqassistant.core.scanner.api.ScannerContext context) Find a type descriptor outside the current scope (e.g. the known dependencies).protected abstract StringgetContainedFileName(String requiredFileName) protected abstract <T extends TypeDescriptor>
voidremoveRequiredType(String fqn, T typeDescriptor) Mark a type descriptor as no longer required by the current scope.resolve(String fullQualifiedName, com.buschmais.jqassistant.core.scanner.api.ScannerContext context) Resolve or create the descriptor for Java type name to be used as dependency.
-
Constructor Details
-
AbstractTypeResolver
protected AbstractTypeResolver()Constructor.
-
-
Method Details
-
create
public <T extends ClassFileDescriptor> TypeCache.CachedType<T> create(String fullQualifiedName, com.buschmais.jqassistant.plugin.common.api.model.FileDescriptor fileDescriptor, Class<T> descriptorType, com.buschmais.jqassistant.core.scanner.api.ScannerContext context) Description copied from interface:TypeResolverResolve or create the descriptor for a Java type name.If a the descriptor already exists it will be used and migrated to the given type.
- Specified by:
createin interfaceTypeResolver- Type Parameters:
T- The expected type of the descriptor.- Parameters:
fullQualifiedName- The fully qualified type name, e.g. "java.lang.Object".fileDescriptor- The file descriptor.descriptorType- The expected type of the descriptor.context- The scanner context. @return The type descriptor.
-
resolve
public TypeCache.CachedType<TypeDescriptor> resolve(String fullQualifiedName, com.buschmais.jqassistant.core.scanner.api.ScannerContext context) Description copied from interface:TypeResolverResolve or create the descriptor for Java type name to be used as dependency.- Specified by:
resolvein interfaceTypeResolver- Parameters:
fullQualifiedName- The fully qualified type name, e.g. "java.lang.Object".context- The scanner context.
-
getContainedFileName
-
findInArtifact
protected abstract TypeDescriptor findInArtifact(String fullQualifiedName, com.buschmais.jqassistant.core.scanner.api.ScannerContext context) Find a type descriptor in the current scope (e.g. the containing artifact).- Parameters:
fullQualifiedName- The name.context- The scanner context.- Returns:
- The type descriptor.
-
findInDependencies
protected abstract TypeDescriptor findInDependencies(String fullQualifiedName, com.buschmais.jqassistant.core.scanner.api.ScannerContext context) Find a type descriptor outside the current scope (e.g. the known dependencies).- Parameters:
fullQualifiedName- The name.context- The scanner context.- Returns:
- The type descriptor.
-
addRequiredType
Mark a type descriptor as required by the current scope.- Parameters:
fqn- The name.typeDescriptor- The descriptor.
-
addContainedType
Mark a type descriptor as contained by the current scope.- Parameters:
fqn- The name.typeDescriptor- The descriptor.
-
removeRequiredType
Mark a type descriptor as no longer required by the current scope.- Parameters:
fqn- The name.typeDescriptor- The descriptor.
-