Search in sources :

Example 6 with TypeDescriptor

use of com.buschmais.jqassistant.plugin.java.api.model.TypeDescriptor in project jqa-java-plugin by buschmais.

the class MethodSignatureVisitor method visitParameterType.

@Override
public SignatureVisitor visitParameterType() {
    final ParameterDescriptor parameterDescriptor = visitorHelper.addParameterDescriptor(methodDescriptor, parameterIndex);
    parameterIndex++;
    return new AbstractTypeSignatureVisitor(containingType, visitorHelper) {

        @Override
        public SignatureVisitor visitArrayType() {
            return dependentTypeSignatureVisitor;
        }

        @Override
        public SignatureVisitor visitTypeArgument(char wildcard) {
            return dependentTypeSignatureVisitor;
        }

        @Override
        public void visitEnd(TypeDescriptor resolvedTypeDescriptor) {
            parameterDescriptor.setType(resolvedTypeDescriptor);
        }
    };
}
Also used : TypeDescriptor(com.buschmais.jqassistant.plugin.java.api.model.TypeDescriptor) ParameterDescriptor(com.buschmais.jqassistant.plugin.java.api.model.ParameterDescriptor)

Example 7 with TypeDescriptor

use of com.buschmais.jqassistant.plugin.java.api.model.TypeDescriptor in project jqa-java-plugin by buschmais.

the class AbstractArtifactScopedTypeResolver method addToCache.

private void addToCache(List<FileDescriptor> fileDescriptors) {
    for (FileDescriptor fileDescriptor : fileDescriptors) {
        if (fileDescriptor instanceof TypeDescriptor) {
            TypeDescriptor typeDescriptor = (TypeDescriptor) fileDescriptor;
            artifactTypes.put(typeDescriptor.getFullQualifiedName(), typeDescriptor);
        }
    }
}
Also used : TypeDescriptor(com.buschmais.jqassistant.plugin.java.api.model.TypeDescriptor) FileDescriptor(com.buschmais.jqassistant.plugin.common.api.model.FileDescriptor) JavaArtifactFileDescriptor(com.buschmais.jqassistant.plugin.java.api.model.JavaArtifactFileDescriptor)

Example 8 with TypeDescriptor

use of com.buschmais.jqassistant.plugin.java.api.model.TypeDescriptor in project jqa-java-plugin by buschmais.

the class AbstractTypeResolver method resolve.

@Override
public CachedType<TypeDescriptor> resolve(String fullQualifiedName, ScannerContext context) {
    CachedType<TypeDescriptor> cachedType = typeCache.get(fullQualifiedName);
    if (cachedType == null) {
        TypeDescriptor typeDescriptor = findInArtifact(fullQualifiedName, context);
        if (typeDescriptor == null) {
            typeDescriptor = findInDependencies(fullQualifiedName, context);
        }
        if (typeDescriptor == null) {
            String requiredFileName = "/" + fullQualifiedName.replace(".", "/") + ".class";
            String containedFileName = getContainedFileName(requiredFileName);
            typeDescriptor = context.peek(FileResolver.class).require(requiredFileName, containedFileName, ClassFileDescriptor.class, context);
            setTypeProperties(typeDescriptor, fullQualifiedName);
            addRequiredType(fullQualifiedName, typeDescriptor);
        }
        cachedType = getCachedType(fullQualifiedName, typeDescriptor);
    }
    return cachedType;
}
Also used : TypeDescriptor(com.buschmais.jqassistant.plugin.java.api.model.TypeDescriptor) ClassFileDescriptor(com.buschmais.jqassistant.plugin.java.api.model.ClassFileDescriptor)

Aggregations

TypeDescriptor (com.buschmais.jqassistant.plugin.java.api.model.TypeDescriptor)8 FileDescriptor (com.buschmais.jqassistant.plugin.common.api.model.FileDescriptor)3 JavaArtifactFileDescriptor (com.buschmais.jqassistant.plugin.java.api.model.JavaArtifactFileDescriptor)2 ServiceLoaderDescriptor (com.buschmais.jqassistant.plugin.java.api.model.ServiceLoaderDescriptor)2 Scanner (com.buschmais.jqassistant.core.scanner.api.Scanner)1 ScannerContext (com.buschmais.jqassistant.core.scanner.api.ScannerContext)1 ArtifactFileDescriptor (com.buschmais.jqassistant.plugin.common.api.model.ArtifactFileDescriptor)1 ClassFileDescriptor (com.buschmais.jqassistant.plugin.java.api.model.ClassFileDescriptor)1 MethodDescriptor (com.buschmais.jqassistant.plugin.java.api.model.MethodDescriptor)1 ParameterDescriptor (com.buschmais.jqassistant.plugin.java.api.model.ParameterDescriptor)1 AnonymousInnerClass (com.buschmais.jqassistant.plugin.java.test.set.scanner.innerclass.AnonymousInnerClass)1 A (com.buschmais.jqassistant.plugin.java.test.set.scanner.resolver.A)1 OuterClass (com.buschmais.jqassistant.plugin.java.test.set.scanner.serviceloader.OuterClass)1 Service (com.buschmais.jqassistant.plugin.java.test.set.scanner.serviceloader.Service)1 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 ArrayList (java.util.ArrayList)1