Search in sources :

Example 1 with TypeParameter

use of io.github.classgraph.TypeParameter in project conquery by bakdata.

the class GroupHandler method printType.

private String printType(Ctx ctx, TypeArgument type) {
    if (type.getTypeSignature() == null) {
        return "UNKNWON";
    }
    if (type.getTypeSignature() instanceof TypeVariableSignature) {
        String v = type.getTypeSignature().toString();
        TypeParameter typeParam = ctx.getField().getClassInfo().getTypeSignature().getTypeParameters().stream().filter(tp -> tp.getName().equals(v)).collect(MoreCollectors.onlyElement());
        if (typeParam.getClassBound() != null) {
            return printType(ctx, typeParam.getClassBound());
        }
        return printType(ctx, typeParam.getInterfaceBounds().get(0));
    }
    return printType(ctx, type.getTypeSignature());
}
Also used : Arrays(java.util.Arrays) BaseTypeSignature(io.github.classgraph.BaseTypeSignature) RequiredArgsConstructor(lombok.RequiredArgsConstructor) MethodInfo(io.github.classgraph.MethodInfo) IId(com.bakdata.conquery.models.identifiable.ids.IId) VariableDefaultValue(com.bakdata.conquery.util.VariableDefaultValue) StringUtils(org.apache.commons.lang3.StringUtils) HashMultimap(com.google.common.collect.HashMultimap) Pair(org.apache.commons.lang3.tuple.Pair) Map(java.util.Map) UriBuilder(javax.ws.rs.core.UriBuilder) JsonNode(com.fasterxml.jackson.databind.JsonNode) Path(java.nio.file.Path) BiMap(com.google.common.collect.BiMap) CPSType(com.bakdata.conquery.io.cps.CPSType) MoreCollectors(com.google.common.collect.MoreCollectors) Set(java.util.Set) PrettyPrinter(com.bakdata.conquery.util.PrettyPrinter) MethodParameterInfo(io.github.classgraph.MethodParameterInfo) Collectors(java.util.stream.Collectors) Base(com.bakdata.conquery.model.Base) List(java.util.List) TypeSignature(io.github.classgraph.TypeSignature) Slf4j(lombok.extern.slf4j.Slf4j) JsonTypeInfo(com.fasterxml.jackson.annotation.JsonTypeInfo) Optional(java.util.Optional) Jackson(com.bakdata.conquery.io.jackson.Jackson) ArrayTypeSignature(io.github.classgraph.ArrayTypeSignature) FilenameUtils(org.apache.commons.io.FilenameUtils) TypeParameter(io.github.classgraph.TypeParameter) Constants(com.bakdata.conquery.Constants) Multimap(com.google.common.collect.Multimap) ClassRefTypeSignature(io.github.classgraph.ClassRefTypeSignature) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Strings(com.google.common.base.Strings) ClassToInstanceMap(com.google.common.collect.ClassToInstanceMap) Group(com.bakdata.conquery.model.Group) Introspection(com.bakdata.conquery.introspection.Introspection) ScanResult(io.github.classgraph.ScanResult) FieldInfo(io.github.classgraph.FieldInfo) TypeVariableSignature(io.github.classgraph.TypeVariableSignature) ClassInfo(io.github.classgraph.ClassInfo) IOException(java.io.IOException) TypeArgument(io.github.classgraph.TypeArgument) File(java.io.File) Primitives(com.google.common.primitives.Primitives) Closeable(java.io.Closeable) Comparator(java.util.Comparator) TypeParameter(io.github.classgraph.TypeParameter) TypeVariableSignature(io.github.classgraph.TypeVariableSignature)

Aggregations

Constants (com.bakdata.conquery.Constants)1 Introspection (com.bakdata.conquery.introspection.Introspection)1 CPSType (com.bakdata.conquery.io.cps.CPSType)1 Jackson (com.bakdata.conquery.io.jackson.Jackson)1 Base (com.bakdata.conquery.model.Base)1 Group (com.bakdata.conquery.model.Group)1 IId (com.bakdata.conquery.models.identifiable.ids.IId)1 PrettyPrinter (com.bakdata.conquery.util.PrettyPrinter)1 VariableDefaultValue (com.bakdata.conquery.util.VariableDefaultValue)1 JsonTypeInfo (com.fasterxml.jackson.annotation.JsonTypeInfo)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 Strings (com.google.common.base.Strings)1 BiMap (com.google.common.collect.BiMap)1 ClassToInstanceMap (com.google.common.collect.ClassToInstanceMap)1 HashMultimap (com.google.common.collect.HashMultimap)1 MoreCollectors (com.google.common.collect.MoreCollectors)1 Multimap (com.google.common.collect.Multimap)1 Primitives (com.google.common.primitives.Primitives)1 ArrayTypeSignature (io.github.classgraph.ArrayTypeSignature)1 BaseTypeSignature (io.github.classgraph.BaseTypeSignature)1