Search in sources :

Example 1 with TypeDefinition

use of com.palantir.conjure.spec.TypeDefinition in project conjure-java by palantir.

the class JerseyServiceGenerator method generate.

@Override
public Stream<JavaFile> generate(ConjureDefinition conjureDefinition) {
    ClassName binaryReturnType = options.jerseyBinaryAsResponse() ? BINARY_RETURN_TYPE_RESPONSE : BINARY_RETURN_TYPE_OUTPUT;
    TypeName optionalBinaryReturnType = options.jerseyBinaryAsResponse() ? BINARY_RETURN_TYPE_RESPONSE : OPTIONAL_BINARY_RETURN_TYPE;
    Map<com.palantir.conjure.spec.TypeName, TypeDefinition> types = TypeFunctions.toTypesMap(conjureDefinition);
    ClassNameVisitor defaultVisitor = new DefaultClassNameVisitor(types.keySet(), options);
    TypeMapper returnTypeMapper = new TypeMapper(types, new SpecializeBinaryClassNameVisitor(defaultVisitor, types, binaryReturnType, optionalBinaryReturnType));
    TypeMapper argumentTypeMapper = new TypeMapper(types, new SpecializeBinaryClassNameVisitor(defaultVisitor, types, BINARY_ARGUMENT_TYPE));
    return conjureDefinition.getServices().stream().map(serviceDef -> generateService(serviceDef, returnTypeMapper, argumentTypeMapper));
}
Also used : TypeMapper(com.palantir.conjure.java.types.TypeMapper) DefaultClassNameVisitor(com.palantir.conjure.java.types.DefaultClassNameVisitor) ParameterizedTypeName(com.squareup.javapoet.ParameterizedTypeName) TypeName(com.squareup.javapoet.TypeName) ClassName(com.squareup.javapoet.ClassName) ClassNameVisitor(com.palantir.conjure.java.types.ClassNameVisitor) SpecializeBinaryClassNameVisitor(com.palantir.conjure.java.types.SpecializeBinaryClassNameVisitor) DefaultClassNameVisitor(com.palantir.conjure.java.types.DefaultClassNameVisitor) SpecializeBinaryClassNameVisitor(com.palantir.conjure.java.types.SpecializeBinaryClassNameVisitor) TypeDefinition(com.palantir.conjure.spec.TypeDefinition)

Example 2 with TypeDefinition

use of com.palantir.conjure.spec.TypeDefinition in project conjure-java by palantir.

the class BeanGenerator method generateBeanType.

@SuppressWarnings("CyclomaticComplexity")
public static JavaFile generateBeanType(TypeMapper typeMapper, ObjectDefinition typeDef, Map<com.palantir.conjure.spec.TypeName, TypeDefinition> typesMap, Options options) {
    ImmutableList<EnrichedField> fields = createFields(typeMapper, typeDef.getFields());
    ImmutableList<FieldSpec> poetFields = EnrichedField.toPoetSpecs(fields);
    ImmutableList<EnrichedField> nonPrimitiveEnrichedFields = fields.stream().filter(field -> !field.isPrimitive()).collect(ImmutableList.toImmutableList());
    com.palantir.conjure.spec.TypeName prefixedName = Packages.getPrefixedName(typeDef.getTypeName(), options.packagePrefix());
    ClassName objectClass = ClassName.get(prefixedName.getPackage(), prefixedName.getName());
    ClassName builderClass = ClassName.get(objectClass.packageName(), objectClass.simpleName(), "Builder");
    ClassName builderImplementation = options.useStagedBuilders() && fields.stream().anyMatch(field -> !fieldShouldBeInFinalStage(field)) ? ClassName.get(objectClass.packageName(), objectClass.simpleName(), "DefaultBuilder") : builderClass;
    TypeSpec.Builder typeBuilder = TypeSpec.classBuilder(prefixedName.getName()).addModifiers(Modifier.PUBLIC, Modifier.FINAL).addFields(poetFields).addMethod(createConstructor(fields, poetFields)).addMethods(createGetters(fields, typesMap, options));
    if (!poetFields.isEmpty()) {
        typeBuilder.addMethod(MethodSpecs.createEquals(objectClass)).addMethod(MethodSpecs.createEqualTo(objectClass, poetFields));
        if (useCachedHashCode(fields)) {
            MethodSpecs.addCachedHashCode(typeBuilder, poetFields);
        } else {
            typeBuilder.addMethod(MethodSpecs.createHashCode(poetFields));
        }
    }
    typeBuilder.addMethod(MethodSpecs.createToString(prefixedName.getName(), fields.stream().map(EnrichedField::fieldName).collect(Collectors.toList())));
    if (poetFields.size() <= MAX_NUM_PARAMS_FOR_FACTORY) {
        typeBuilder.addMethod(createStaticFactoryMethod(fields, objectClass));
    }
    if (!nonPrimitiveEnrichedFields.isEmpty()) {
        typeBuilder.addMethod(createValidateFields(nonPrimitiveEnrichedFields)).addMethod(createAddFieldIfMissing(nonPrimitiveEnrichedFields.size()));
    }
    if (poetFields.isEmpty()) {
        // Need to add JsonSerialize annotation which indicates that the empty bean serializer should be used to
        // serialize this class. Without this annotation no serializer will be set for this class, thus preventing
        // serialization.
        typeBuilder.addAnnotation(JsonSerialize.class).addField(createSingletonField(objectClass));
        if (!options.strictObjects()) {
            typeBuilder.addAnnotation(AnnotationSpec.builder(JsonIgnoreProperties.class).addMember("ignoreUnknown", "$L", true).build());
        }
    } else {
        ImmutableList<EnrichedField> fieldsNeedingBuilderStage = fields.stream().filter(field -> !fieldShouldBeInFinalStage(field)).collect(ImmutableList.toImmutableList());
        typeBuilder.addAnnotation(AnnotationSpec.builder(JsonDeserialize.class).addMember("builder", "$T.class", builderImplementation).build());
        if (!options.useStagedBuilders() || fieldsNeedingBuilderStage.isEmpty()) {
            typeBuilder.addMethod(createBuilder(builderClass)).addType(BeanBuilderGenerator.generate(typeMapper, objectClass, builderClass, typeDef, typesMap, options, Optional.empty()));
        } else {
            List<TypeSpec> interfaces = generateStageInterfaces(objectClass, builderClass, typeMapper, fieldsNeedingBuilderStage, fields.stream().filter(BeanGenerator::fieldShouldBeInFinalStage).collect(ImmutableList.toImmutableList()));
            List<ClassName> interfacesAsClasses = interfaces.stream().map(stageInterface -> ClassName.get(objectClass.packageName(), objectClass.simpleName(), stageInterface.name)).collect(Collectors.toList());
            TypeSpec builderInterface = TypeSpec.interfaceBuilder("Builder").addModifiers(Modifier.PUBLIC).addMethods(interfaces.stream().map(stageInterface -> stageInterface.methodSpecs).flatMap(List::stream).map(method -> method.toBuilder().addAnnotation(Override.class).returns(method.name.equals("build") ? method.returnType : ClassName.get(objectClass.packageName(), objectClass.simpleName(), "Builder")).build()).collect(Collectors.toSet())).addSuperinterfaces(interfacesAsClasses.stream().map(ClassName::box).collect(Collectors.toList())).build();
            typeBuilder.addTypes(interfaces).addType(builderInterface).addMethod(MethodSpec.methodBuilder("builder").addModifiers(Modifier.PUBLIC, Modifier.STATIC).returns(interfacesAsClasses.get(0)).addStatement("return new DefaultBuilder()").build()).addType(BeanBuilderGenerator.generate(typeMapper, objectClass, builderClass, typeDef, typesMap, options, Optional.of(ClassName.get(objectClass.packageName(), objectClass.simpleName(), builderInterface.name))));
        }
    }
    typeBuilder.addAnnotation(ConjureAnnotations.getConjureGeneratedAnnotation(BeanGenerator.class));
    typeDef.getDocs().ifPresent(docs -> typeBuilder.addJavadoc("$L", Javadoc.render(docs)));
    return JavaFile.builder(prefixedName.getPackage(), typeBuilder.build()).skipJavaLangImports(true).indent("    ").build();
}
Also used : DefaultTypeVisitor(com.palantir.conjure.java.visitor.DefaultTypeVisitor) JsonProperty(com.fasterxml.jackson.annotation.JsonProperty) TypeVisitor(com.palantir.conjure.visitor.TypeVisitor) Modifier(javax.lang.model.element.Modifier) Javadoc(com.palantir.conjure.java.util.Javadoc) ClassName(com.squareup.javapoet.ClassName) Collections2(com.google.common.collect.Collections2) PeekingIterator(com.google.common.collect.PeekingIterator) StringUtils(org.apache.commons.lang3.StringUtils) Options(com.palantir.conjure.java.Options) MapType(com.palantir.conjure.spec.MapType) Map(java.util.Map) OptionalType(com.palantir.conjure.spec.OptionalType) MoreVisitors(com.palantir.conjure.java.visitor.MoreVisitors) ObjectDefinition(com.palantir.conjure.spec.ObjectDefinition) ParameterSpec(com.squareup.javapoet.ParameterSpec) Collection(java.util.Collection) SafeIllegalArgumentException(com.palantir.logsafe.exceptions.SafeIllegalArgumentException) FieldDefinition(com.palantir.conjure.spec.FieldDefinition) Collectors(java.util.stream.Collectors) JavaFile(com.squareup.javapoet.JavaFile) List(java.util.List) Stream(java.util.stream.Stream) TypeName(com.squareup.javapoet.TypeName) Optional(java.util.Optional) CaseConverter(com.palantir.conjure.CaseConverter) PrimitiveType(com.palantir.conjure.spec.PrimitiveType) JsonDeserialize(com.fasterxml.jackson.databind.annotation.JsonDeserialize) JsonIgnoreProperties(com.fasterxml.jackson.annotation.JsonIgnoreProperties) Iterables(com.google.common.collect.Iterables) ListType(com.palantir.conjure.spec.ListType) TypeFunctions(com.palantir.conjure.java.util.TypeFunctions) FieldSpec(com.squareup.javapoet.FieldSpec) Type(com.palantir.conjure.spec.Type) Iterators(com.google.common.collect.Iterators) ArrayList(java.util.ArrayList) SafeArg(com.palantir.logsafe.SafeArg) ImmutableList(com.google.common.collect.ImmutableList) Value(org.immutables.value.Value) JsonSerialize(com.fasterxml.jackson.databind.annotation.JsonSerialize) SetType(com.palantir.conjure.spec.SetType) Nonnull(javax.annotation.Nonnull) CodeBlock(com.squareup.javapoet.CodeBlock) TypeDefinition(com.palantir.conjure.spec.TypeDefinition) MethodSpec(com.squareup.javapoet.MethodSpec) Packages(com.palantir.conjure.java.util.Packages) JavaNameSanitizer(com.palantir.conjure.java.util.JavaNameSanitizer) ParameterizedTypeName(com.squareup.javapoet.ParameterizedTypeName) TypeSpec(com.squareup.javapoet.TypeSpec) AnnotationSpec(com.squareup.javapoet.AnnotationSpec) ConjureAnnotations(com.palantir.conjure.java.ConjureAnnotations) JsonInclude(com.fasterxml.jackson.annotation.JsonInclude) FieldName(com.palantir.conjure.spec.FieldName) Comparator(java.util.Comparator) Collections(java.util.Collections) JsonDeserialize(com.fasterxml.jackson.databind.annotation.JsonDeserialize) FieldSpec(com.squareup.javapoet.FieldSpec) JsonIgnoreProperties(com.fasterxml.jackson.annotation.JsonIgnoreProperties) JsonSerialize(com.fasterxml.jackson.databind.annotation.JsonSerialize) ClassName(com.squareup.javapoet.ClassName) TypeSpec(com.squareup.javapoet.TypeSpec)

Example 3 with TypeDefinition

use of com.palantir.conjure.spec.TypeDefinition in project conjure-java by palantir.

the class DialogueServiceGenerator method generate.

@Override
public Stream<JavaFile> generate(ConjureDefinition conjureDefinition) {
    Map<TypeName, TypeDefinition> types = TypeFunctions.toTypesMap(conjureDefinition);
    DialogueEndpointsGenerator endpoints = new DialogueEndpointsGenerator(options);
    TypeMapper parameterTypes = new TypeMapper(types, new SpecializeBinaryClassNameVisitor(new DefaultClassNameVisitor(types.keySet(), options), types, ClassName.get(BinaryRequestBody.class)));
    TypeMapper returnTypes = new TypeMapper(types, new SpecializeBinaryClassNameVisitor(new DefaultClassNameVisitor(types.keySet(), options), types, ClassName.get(InputStream.class)));
    Map<TypeName, TypeDefinition> typeDefinitionsByName = conjureDefinition.getTypes().stream().collect(Collectors.toMap(type -> type.accept(TypeDefinitionVisitor.TYPE_NAME), Function.identity()));
    DialogueInterfaceGenerator interfaceGenerator = new DialogueInterfaceGenerator(options, new ParameterTypeMapper(parameterTypes), new ReturnTypeMapper(returnTypes));
    TypeNameResolver typeNameResolver = typeName -> Preconditions.checkNotNull(typeDefinitionsByName.get(typeName), "Referenced unknown TypeName", SafeArg.of("typeName", typeName));
    StaticFactoryMethodGenerator asyncGenerator = new DefaultStaticFactoryMethodGenerator(options, typeNameResolver, new ParameterTypeMapper(parameterTypes), new ReturnTypeMapper(returnTypes), StaticFactoryMethodType.ASYNC);
    StaticFactoryMethodGenerator blockingGenerator = new DefaultStaticFactoryMethodGenerator(options, typeNameResolver, new ParameterTypeMapper(parameterTypes), new ReturnTypeMapper(returnTypes), StaticFactoryMethodType.BLOCKING);
    return conjureDefinition.getServices().stream().flatMap(serviceDef -> Stream.of(endpoints.endpointsClass(serviceDef), interfaceGenerator.generateBlocking(serviceDef, blockingGenerator), interfaceGenerator.generateAsync(serviceDef, asyncGenerator)));
}
Also used : TypeMapper(com.palantir.conjure.java.types.TypeMapper) TypeDefinition(com.palantir.conjure.spec.TypeDefinition) SpecializeBinaryClassNameVisitor(com.palantir.conjure.java.types.SpecializeBinaryClassNameVisitor) DefaultClassNameVisitor(com.palantir.conjure.java.types.DefaultClassNameVisitor) TypeFunctions(com.palantir.conjure.java.util.TypeFunctions) ClassName(com.squareup.javapoet.ClassName) TypeMapper(com.palantir.conjure.java.types.TypeMapper) TypeDefinitionVisitor(com.palantir.conjure.visitor.TypeDefinitionVisitor) ConjureDefinition(com.palantir.conjure.spec.ConjureDefinition) BinaryRequestBody(com.palantir.dialogue.BinaryRequestBody) Function(java.util.function.Function) Collectors(java.util.stream.Collectors) Options(com.palantir.conjure.java.Options) JavaFile(com.squareup.javapoet.JavaFile) SafeArg(com.palantir.logsafe.SafeArg) Stream(java.util.stream.Stream) Generator(com.palantir.conjure.java.Generator) TypeName(com.palantir.conjure.spec.TypeName) Map(java.util.Map) Preconditions(com.palantir.logsafe.Preconditions) InputStream(java.io.InputStream) DefaultClassNameVisitor(com.palantir.conjure.java.types.DefaultClassNameVisitor) TypeName(com.palantir.conjure.spec.TypeName) SpecializeBinaryClassNameVisitor(com.palantir.conjure.java.types.SpecializeBinaryClassNameVisitor) TypeDefinition(com.palantir.conjure.spec.TypeDefinition)

Example 4 with TypeDefinition

use of com.palantir.conjure.spec.TypeDefinition in project conjure-java by palantir.

the class UnionGenerator method generateUnionType.

public static JavaFile generateUnionType(TypeMapper typeMapper, Map<com.palantir.conjure.spec.TypeName, TypeDefinition> typesMap, UnionDefinition typeDef, Options options) {
    com.palantir.conjure.spec.TypeName prefixedTypeName = Packages.getPrefixedName(typeDef.getTypeName(), options.packagePrefix());
    ClassName unionClass = ClassName.get(prefixedTypeName.getPackage(), prefixedTypeName.getName());
    ClassName baseClass = unionClass.nestedClass("Base");
    ClassName visitorClass = unionClass.nestedClass("Visitor");
    ClassName visitorBuilderClass = unionClass.nestedClass("VisitorBuilder");
    Map<FieldDefinition, TypeName> memberTypes = typeDef.getUnion().stream().collect(StableCollectors.toLinkedMap(Function.identity(), entry -> typeMapper.getClassName(entry.getType())));
    List<FieldSpec> fields = ImmutableList.of(FieldSpec.builder(baseClass, VALUE_FIELD_NAME, Modifier.PRIVATE, Modifier.FINAL).build());
    TypeSpec.Builder typeBuilder = TypeSpec.classBuilder(typeDef.getTypeName().getName()).addAnnotation(ConjureAnnotations.getConjureGeneratedAnnotation(UnionGenerator.class)).addModifiers(Modifier.PUBLIC, Modifier.FINAL).addFields(fields).addMethod(generateConstructor(baseClass)).addMethod(generateGetValue(baseClass)).addMethods(generateStaticFactories(typeMapper, unionClass, typeDef.getUnion())).addMethod(generateAcceptVisitMethod(visitorClass)).addType(generateVisitor(unionClass, visitorClass, memberTypes, visitorBuilderClass, options)).addType(generateVisitorBuilder(unionClass, visitorClass, visitorBuilderClass, memberTypes, options)).addTypes(generateVisitorBuilderStageInterfaces(unionClass, visitorClass, memberTypes, options)).addType(generateBase(baseClass, visitorClass, memberTypes)).addTypes(generateWrapperClasses(typeMapper, typesMap, baseClass, visitorClass, typeDef.getUnion(), options)).addType(generateUnknownWrapper(baseClass, visitorClass, options)).addMethod(generateEquals(unionClass)).addMethod(MethodSpecs.createEqualTo(unionClass, fields)).addMethod(MethodSpecs.createHashCode(fields)).addMethod(MethodSpecs.createToString(unionClass.simpleName(), fields.stream().map(fieldSpec -> FieldName.of(fieldSpec.name)).collect(Collectors.toList())));
    typeDef.getDocs().ifPresent(docs -> typeBuilder.addJavadoc("$L", Javadoc.render(docs)));
    return JavaFile.builder(prefixedTypeName.getPackage(), typeBuilder.build()).skipJavaLangImports(true).indent("    ").build();
}
Also used : JsonProperty(com.fasterxml.jackson.annotation.JsonProperty) Modifier(javax.lang.model.element.Modifier) Javadoc(com.palantir.conjure.java.util.Javadoc) DefaultableTypeVisitor(com.palantir.conjure.java.visitor.DefaultableTypeVisitor) BiFunction(java.util.function.BiFunction) ClassName(com.squareup.javapoet.ClassName) PeekingIterator(com.google.common.collect.PeekingIterator) StringUtils(org.apache.commons.lang3.StringUtils) Options(com.palantir.conjure.java.Options) JsonValue(com.fasterxml.jackson.annotation.JsonValue) Map(java.util.Map) JsonAnyGetter(com.fasterxml.jackson.annotation.JsonAnyGetter) StableCollectors(com.palantir.conjure.java.util.StableCollectors) ParameterSpec(com.squareup.javapoet.ParameterSpec) SafeIllegalArgumentException(com.palantir.logsafe.exceptions.SafeIllegalArgumentException) FieldDefinition(com.palantir.conjure.spec.FieldDefinition) Collectors(java.util.stream.Collectors) JavaFile(com.squareup.javapoet.JavaFile) JsonAnySetter(com.fasterxml.jackson.annotation.JsonAnySetter) List(java.util.List) Stream(java.util.stream.Stream) JsonTypeInfo(com.fasterxml.jackson.annotation.JsonTypeInfo) TypeName(com.squareup.javapoet.TypeName) JsonIgnoreProperties(com.fasterxml.jackson.annotation.JsonIgnoreProperties) Nulls(com.fasterxml.jackson.annotation.Nulls) TypeFunctions(com.palantir.conjure.java.util.TypeFunctions) FieldSpec(com.squareup.javapoet.FieldSpec) Type(com.palantir.conjure.spec.Type) DoubleFunction(java.util.function.DoubleFunction) HashMap(java.util.HashMap) Function(java.util.function.Function) Iterators(com.google.common.collect.Iterators) ArrayList(java.util.ArrayList) UnionDefinition(com.palantir.conjure.spec.UnionDefinition) JsonTypeName(com.fasterxml.jackson.annotation.JsonTypeName) SafeArg(com.palantir.logsafe.SafeArg) ImmutableList(com.google.common.collect.ImmutableList) Nonnull(javax.annotation.Nonnull) CodeBlock(com.squareup.javapoet.CodeBlock) IntFunction(java.util.function.IntFunction) TypeVariableName(com.squareup.javapoet.TypeVariableName) TypeDefinition(com.palantir.conjure.spec.TypeDefinition) JsonSubTypes(com.fasterxml.jackson.annotation.JsonSubTypes) MethodSpec(com.squareup.javapoet.MethodSpec) Packages(com.palantir.conjure.java.util.Packages) JavaNameSanitizer(com.palantir.conjure.java.util.JavaNameSanitizer) ParameterizedTypeName(com.squareup.javapoet.ParameterizedTypeName) TypeSpec(com.squareup.javapoet.TypeSpec) AnnotationSpec(com.squareup.javapoet.AnnotationSpec) ConjureAnnotations(com.palantir.conjure.java.ConjureAnnotations) FieldName(com.palantir.conjure.spec.FieldName) Comparator(java.util.Comparator) Collections(java.util.Collections) JsonSetter(com.fasterxml.jackson.annotation.JsonSetter) TypeName(com.squareup.javapoet.TypeName) JsonTypeName(com.fasterxml.jackson.annotation.JsonTypeName) ParameterizedTypeName(com.squareup.javapoet.ParameterizedTypeName) FieldDefinition(com.palantir.conjure.spec.FieldDefinition) FieldSpec(com.squareup.javapoet.FieldSpec) ClassName(com.squareup.javapoet.ClassName) TypeSpec(com.squareup.javapoet.TypeSpec)

Example 5 with TypeDefinition

use of com.palantir.conjure.spec.TypeDefinition in project conjure by palantir.

the class ConjureParserUtils method parseConjureDef.

static ConjureDefinition parseConjureDef(Map<String, AnnotatedConjureSourceFile> annotatedParsedDefs) {
    ImmutableList.Builder<ServiceDefinition> servicesBuilder = ImmutableList.builder();
    ImmutableList.Builder<ErrorDefinition> errorsBuilder = ImmutableList.builder();
    ImmutableList.Builder<TypeDefinition> typesBuilder = ImmutableList.builder();
    annotatedParsedDefs.values().forEach(annotatedParsed -> {
        ConjureSourceFile parsed = annotatedParsed.conjureSourceFile();
        try {
            ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver = new ConjureTypeParserVisitor.ByParsedRepresentationTypeNameResolver(parsed.types(), annotatedParsed.importProviders(), annotatedParsedDefs);
            // Resolve objects first, so we can use them in service validations
            Map<TypeName, TypeDefinition> objects = parseObjects(parsed.types(), typeResolver);
            Map<TypeName, TypeDefinition> importedObjects = parseImportObjects(parsed.types().conjureImports(), annotatedParsedDefs);
            Map<TypeName, TypeDefinition> allObjects = new HashMap<>();
            allObjects.putAll(objects);
            allObjects.putAll(importedObjects);
            DealiasingTypeVisitor dealiasingVisitor = new DealiasingTypeVisitor(allObjects);
            parsed.services().forEach((serviceName, service) -> {
                servicesBuilder.add(parseService(service, TypeName.of(serviceName.name(), parseConjurePackage(service.conjurePackage())), typeResolver, dealiasingVisitor));
            });
            typesBuilder.addAll(objects.values());
            errorsBuilder.addAll(parseErrors(parsed.types().definitions(), typeResolver));
        } catch (RuntimeException e) {
            throw new ConjureRuntimeException(String.format("Encountered error trying to parse file '%s'", annotatedParsed.sourceFile()), e);
        }
    });
    ConjureDefinition definition = ConjureDefinition.builder().version(Conjure.SUPPORTED_IR_VERSION).types(typesBuilder.build()).errors(errorsBuilder.build()).services(servicesBuilder.build()).build();
    ConjureDefinitionValidator.validateAll(definition);
    return definition;
}
Also used : ErrorDefinition(com.palantir.conjure.spec.ErrorDefinition) AnnotatedConjureSourceFile(com.palantir.conjure.parser.AnnotatedConjureSourceFile) ConjureSourceFile(com.palantir.conjure.parser.ConjureSourceFile) TypeName(com.palantir.conjure.spec.TypeName) ReferenceTypeResolver(com.palantir.conjure.defs.ConjureTypeParserVisitor.ReferenceTypeResolver) HashMap(java.util.HashMap) ImmutableList(com.google.common.collect.ImmutableList) ConjureRuntimeException(com.palantir.conjure.exceptions.ConjureRuntimeException) DealiasingTypeVisitor(com.palantir.conjure.visitor.DealiasingTypeVisitor) TypeDefinition(com.palantir.conjure.spec.TypeDefinition) ConjureRuntimeException(com.palantir.conjure.exceptions.ConjureRuntimeException) ConjureDefinition(com.palantir.conjure.spec.ConjureDefinition) ServiceDefinition(com.palantir.conjure.spec.ServiceDefinition)

Aggregations

TypeDefinition (com.palantir.conjure.spec.TypeDefinition)15 ImmutableList (com.google.common.collect.ImmutableList)6 TypeMapper (com.palantir.conjure.java.types.TypeMapper)6 ParameterizedTypeName (com.squareup.javapoet.ParameterizedTypeName)6 TypeName (com.squareup.javapoet.TypeName)6 Options (com.palantir.conjure.java.Options)5 TypeFunctions (com.palantir.conjure.java.util.TypeFunctions)5 ConjureAnnotations (com.palantir.conjure.java.ConjureAnnotations)4 DefaultClassNameVisitor (com.palantir.conjure.java.types.DefaultClassNameVisitor)4 SpecializeBinaryClassNameVisitor (com.palantir.conjure.java.types.SpecializeBinaryClassNameVisitor)4 JavaNameSanitizer (com.palantir.conjure.java.util.JavaNameSanitizer)4 Packages (com.palantir.conjure.java.util.Packages)4 Type (com.palantir.conjure.spec.Type)4 TypeName (com.palantir.conjure.spec.TypeName)4 ClassName (com.squareup.javapoet.ClassName)4 Map (java.util.Map)4 Collectors (java.util.stream.Collectors)4 ConjureDefinition (com.palantir.conjure.spec.ConjureDefinition)3 FieldDefinition (com.palantir.conjure.spec.FieldDefinition)3 FieldName (com.palantir.conjure.spec.FieldName)3