Search in sources :

Example 86 with Schema

use of com.reprezen.kaizen.oasparser.model3.Schema in project odata-client by davidmoten.

the class Generator method printNavigationPropertyGetters.

private void printNavigationPropertyGetters(Structure<?> structure, Imports imports, Indent indent, PrintWriter p, List<TNavigationProperty> properties, Set<String> methodNames) {
    // write getters
    // 
    properties.forEach(x -> {
        String typeName = toClassName(x, imports);
        String methodName = Names.getGetterMethod(x.getName());
        methodNames.add(methodName);
        structure.printPropertyJavadoc(p, indent, x.getName(), "navigational property " + x.getName(), Collections.emptyMap());
        addNavigationPropertyAnnotation(imports, indent, p, x.getName());
        p.format("%s@%s\n", indent, imports.add(JsonIgnore.class));
        p.format("%spublic %s %s() {\n", indent, typeName, methodName);
        if (isCollection(x)) {
            if (names.isEntityWithNamespace(names.getType(x))) {
                p.format("%sreturn new %s(\n", indent.right(), toClassName(x, imports));
                // 
                p.format(// 
                "%scontextPath.addSegment(\"%s\"), %s.getValue(unmappedFields, \"%s\"));\n", indent.right().right().right().right(), x.getName(), imports.add(RequestHelper.class), x.getName());
                indent.left().left().left().left();
            } else {
                throw new RuntimeException("unexpected");
            }
        } else {
            if (names.isEntityWithNamespace(names.getType(x))) {
                Schema sch = names.getSchema(names.getInnerType(names.getType(x)));
                // 
                p.format(// 
                "%sreturn new %s(contextPath.addSegment(\"%s\"), %s.getValue(unmappedFields, \"%s\"));\n", // 
                indent.right(), imports.add(names.getFullClassNameEntityRequestFromTypeWithNamespace(sch, names.getInnerType(names.getType(x)))), // 
                x.getName(), // 
                imports.add(RequestHelper.class), x.getName());
            } else {
                throw new RuntimeException("unexpected");
            }
        }
        p.format("%s}\n", indent.left());
    });
}
Also used : JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore) RequestHelper(com.github.davidmoten.odata.client.internal.RequestHelper) Schema(org.oasisopen.odata.csdl.v4.Schema)

Example 87 with Schema

use of com.reprezen.kaizen.oasparser.model3.Schema in project odata-client by davidmoten.

the class Generator method writeEnum.

private void writeEnum(Schema schema, TEnumType t) {
    names.getDirectoryEnum(schema).mkdirs();
    String simpleClassName = names.getSimpleClassNameEnum(schema, t.getName());
    Imports imports = new Imports(names.getFullClassNameEnum(schema, t.getName()));
    Indent indent = new Indent();
    try {
        StringWriter w = new StringWriter();
        try (PrintWriter p = new PrintWriter(w)) {
            p.format("package %s;\n\n", names.getPackageEnum(schema));
            p.format(IMPORTSHERE);
            p.format("public enum %s implements %s {\n", simpleClassName, imports.add(com.github.davidmoten.odata.client.Enum.class));
            // add members
            indent.right();
            String s = // 
            Util.filter(t.getMemberOrAnnotation(), TEnumTypeMember.class).map(x -> // 
            String.format(// 
            "%s@%s(\"%s\")\n%s%s(\"%s\", \"%s\")", // 
            indent, // 
            imports.add(JsonProperty.class), // 
            x.getName(), // 
            indent, // 
            names.getEnumInstanceName(t, x.getName()), // 
            x.getName(), x.getValue())).collect(Collectors.joining(",\n\n"));
            indent.left();
            p.format("\n%s;\n\n", s);
            // add fields
            p.format("%sprivate final %s name;\n", indent.right(), imports.add(String.class));
            p.format("%sprivate final %s value;\n\n", indent, imports.add(String.class));
            // add constructor
            p.format("%sprivate %s(%s name, %s value) {\n", indent, simpleClassName, imports.add(String.class), imports.add(String.class));
            p.format("%sthis.name = name;\n", indent.right());
            p.format("%sthis.value = value;\n", indent);
            p.format("%s}\n\n", indent.left());
            // add methods
            p.format("%s@%s\n", indent, imports.add(Override.class));
            p.format("%spublic %s enumName() {\n", indent, imports.add(String.class));
            p.format("%sreturn name;\n", indent.right());
            p.format("%s}\n\n", indent.left());
            p.format("%s@%s\n", indent, imports.add(Override.class));
            p.format("%spublic %s enumValue() {\n", indent, imports.add(String.class));
            p.format("%sreturn value;\n", indent.right());
            p.format("%s}\n\n", indent.left());
            // close class
            p.format("}\n");
        }
        byte[] bytes = w.toString().replace(IMPORTSHERE, imports.toString()).getBytes(StandardCharsets.UTF_8);
        Files.write(names.getClassFileEnum(schema, t.getName()).toPath(), bytes);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : JsonProperty(com.fasterxml.jackson.annotation.JsonProperty) StreamProvider(com.github.davidmoten.odata.client.StreamProvider) Arrays(java.util.Arrays) HasNameJavaHasNullable(com.github.davidmoten.odata.client.generator.model.HasNameJavaHasNullable) HasContext(com.github.davidmoten.odata.client.HasContext) HttpService(com.github.davidmoten.odata.client.HttpService) TEnumType(org.oasisopen.odata.csdl.v4.TEnumType) Map(java.util.Map) Parameter(com.github.davidmoten.odata.client.generator.model.Action.Parameter) PrintWriter(java.io.PrintWriter) FunctionRequestReturningNonCollection(com.github.davidmoten.odata.client.FunctionRequestReturningNonCollection) SchemaAndType(com.github.davidmoten.odata.client.generator.Names.SchemaAndType) JacksonInject(com.fasterxml.jackson.annotation.JacksonInject) TEntitySet(org.oasisopen.odata.csdl.v4.TEntitySet) NameValue(com.github.davidmoten.odata.client.NameValue) RequestHelper(com.github.davidmoten.odata.client.internal.RequestHelper) Set(java.util.Set) ODataType(com.github.davidmoten.odata.client.ODataType) StandardCharsets(java.nio.charset.StandardCharsets) UncheckedIOException(java.io.UncheckedIOException) Stream(java.util.stream.Stream) Lists(com.github.davidmoten.guavamini.Lists) CollectionPageEntityRequest(com.github.davidmoten.odata.client.CollectionPageEntityRequest) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) SchemaInfo(com.github.davidmoten.odata.client.SchemaInfo) TProperty(org.oasisopen.odata.csdl.v4.TProperty) Checks(com.github.davidmoten.odata.client.internal.Checks) Files(java.nio.file.Files) TNavigationProperty(org.oasisopen.odata.csdl.v4.TNavigationProperty) Function(com.github.davidmoten.odata.client.generator.model.Function) StringWriter(java.io.StringWriter) TSingleton(org.oasisopen.odata.csdl.v4.TSingleton) HttpMethod(com.github.davidmoten.odata.client.HttpMethod) IOException(java.io.IOException) Include(com.fasterxml.jackson.annotation.JsonInclude.Include) ContainerBuilder(com.github.davidmoten.odata.client.TestingService.ContainerBuilder) File(java.io.File) ChangedFields(com.github.davidmoten.odata.client.internal.ChangedFields) NavigationProperty(com.github.davidmoten.odata.client.annotation.NavigationProperty) TNavigationPropertyBinding(org.oasisopen.odata.csdl.v4.TNavigationPropertyBinding) RequestOptions(com.github.davidmoten.odata.client.RequestOptions) ParameterMap(com.github.davidmoten.odata.client.internal.ParameterMap) TEnumTypeMember(org.oasisopen.odata.csdl.v4.TEnumTypeMember) HttpRequestOptions(com.github.davidmoten.odata.client.HttpRequestOptions) CollectionPage(com.github.davidmoten.odata.client.CollectionPage) FieldName(com.github.davidmoten.odata.client.generator.model.Structure.FieldName) ActionRequestNoReturn(com.github.davidmoten.odata.client.ActionRequestNoReturn) Action(com.github.davidmoten.odata.client.generator.model.Action) Field(com.github.davidmoten.odata.client.generator.model.Field) UploadStrategy(com.github.davidmoten.odata.client.UploadStrategy) TComplexType(org.oasisopen.odata.csdl.v4.TComplexType) JsonAnyGetter(com.fasterxml.jackson.annotation.JsonAnyGetter) ActionRequestReturningNonCollection(com.github.davidmoten.odata.client.ActionRequestReturningNonCollection) ReturnType(com.github.davidmoten.odata.client.generator.model.Action.ReturnType) UnmappedFields(com.github.davidmoten.odata.client.UnmappedFields) Collectors(java.util.stream.Collectors) EntityType(com.github.davidmoten.odata.client.generator.model.EntityType) JsonAnySetter(com.fasterxml.jackson.annotation.JsonAnySetter) Context(com.github.davidmoten.odata.client.Context) List(java.util.List) KeyElement(com.github.davidmoten.odata.client.generator.model.KeyElement) Method(com.github.davidmoten.odata.client.generator.model.Method) PropertyRef(com.github.davidmoten.odata.client.generator.model.PropertyRef) Structure(com.github.davidmoten.odata.client.generator.model.Structure) StreamUploaderChunked(com.github.davidmoten.odata.client.StreamUploaderChunked) Optional(java.util.Optional) ClientException(com.github.davidmoten.odata.client.ClientException) ContextPath(com.github.davidmoten.odata.client.ContextPath) JsonPropertyOrder(com.fasterxml.jackson.annotation.JsonPropertyOrder) ComplexType(com.github.davidmoten.odata.client.generator.model.ComplexType) Preconditions(com.github.davidmoten.guavamini.Preconditions) TypedObject(com.github.davidmoten.odata.client.internal.TypedObject) HashMap(java.util.HashMap) TActionFunctionParameter(org.oasisopen.odata.csdl.v4.TActionFunctionParameter) HashSet(java.util.HashSet) TActionFunctionReturnType(org.oasisopen.odata.csdl.v4.TActionFunctionReturnType) TFunction(org.oasisopen.odata.csdl.v4.TFunction) EntityRequest(com.github.davidmoten.odata.client.EntityRequest) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore) TAction(org.oasisopen.odata.csdl.v4.TAction) Path(com.github.davidmoten.odata.client.Path) Schema(org.oasisopen.odata.csdl.v4.Schema) StreamUploaderSingleCall(com.github.davidmoten.odata.client.StreamUploaderSingleCall) EntitySet(com.github.davidmoten.odata.client.generator.model.EntitySet) ODataEntityType(com.github.davidmoten.odata.client.ODataEntityType) BuilderBase(com.github.davidmoten.odata.client.TestingService.BuilderBase) ActionRequestReturningNonCollectionUnwrapped(com.github.davidmoten.odata.client.ActionRequestReturningNonCollectionUnwrapped) TEntityContainer(org.oasisopen.odata.csdl.v4.TEntityContainer) UnmappedFieldsImpl(com.github.davidmoten.odata.client.internal.UnmappedFieldsImpl) StreamUploader(com.github.davidmoten.odata.client.StreamUploader) JsonInclude(com.fasterxml.jackson.annotation.JsonInclude) FunctionRequestReturningStream(com.github.davidmoten.odata.client.FunctionRequestReturningStream) JsonIgnoreType(com.fasterxml.jackson.annotation.JsonIgnoreType) CollectionPageNonEntityRequest(com.github.davidmoten.odata.client.CollectionPageNonEntityRequest) FunctionRequestReturningNonCollectionUnwrapped(com.github.davidmoten.odata.client.FunctionRequestReturningNonCollectionUnwrapped) Property(com.github.davidmoten.odata.client.annotation.Property) Collections(java.util.Collections) TEntityType(org.oasisopen.odata.csdl.v4.TEntityType) JsonProperty(com.fasterxml.jackson.annotation.JsonProperty) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) StringWriter(java.io.StringWriter) PrintWriter(java.io.PrintWriter)

Example 88 with Schema

use of com.reprezen.kaizen.oasparser.model3.Schema in project odata-client by davidmoten.

the class Generator method generate.

public void generate() {
    log("-----------------------------------");
    log("Generating code for namespaces:");
    // 
    schemas.forEach(s -> log("  " + s.getNamespace()));
    log("Types:");
    // 
    schemas.stream().flatMap(s -> Util.filter(s.getComplexTypeOrEntityTypeOrTypeDefinition(), TEntityType.class).map(// 
    t -> new SchemaAndType<TEntityType>(s, t))).map(// 
    x -> names.toTypeWithNamespace(x.schema, x.type.getName())).forEach(x -> log("  " + x));
    log("-----------------------------------");
    log("Replacing aliases");
    Util.replaceAliases(schemas);
    log("Finding collection types");
    Set<String> collectionTypes = findTypesUsedInCollections(names, schemas);
    for (Schema schema : schemas) {
        log("Generating for namespace=" + schema.getNamespace());
        log("  creating maps");
        Map<String, List<Action>> typeActions = createTypeActions(schema, names, false);
        log("    entity actions count = " + typeActions.size());
        Map<String, List<Function>> typeFunctions = createTypeFunctions(schema, names, false);
        log("    entity functions count = " + typeFunctions.size());
        Map<String, List<Action>> collectionTypeActions = createTypeActions(schema, names, true);
        log("    collection actions count = " + collectionTypeActions.size());
        Map<String, List<Function>> collectionTypeFunctions = createTypeFunctions(schema, names, true);
        System.out.println("    collection functions count = " + collectionTypeFunctions.size());
        log("  checking entities have keys");
        // 
        Util.types(schema, TEntityType.class).map(// 
        x -> new EntityType(x, names)).filter(// 
        x -> !x.hasKey()).forEach(x -> log("    " + x.getFullType() + " has no keys"));
        log("  writing schema info");
        writeSchemaInfo(schema);
        // write enums
        log("  writing enums");
        // 
        Util.types(schema, TEnumType.class).forEach(x -> writeEnum(schema, x));
        // write entityTypes
        log("  writing entities");
        // 
        Util.types(schema, TEntityType.class).forEach(x -> writeEntity(x, typeActions, typeFunctions));
        // write complexTypes
        log("  writing complex types");
        // 
        Util.types(schema, TComplexType.class).forEach(x -> writeComplexType(schema, x));
        // write entity collection requests
        log("  writing entity collection requests");
        // 
        Util.types(schema, TEntityType.class).forEach(x -> writeEntityCollectionRequest(schema, x, collectionTypeActions, collectionTypeFunctions, collectionTypes));
        log("writing entity set requests");
        // 
        Util.types(schema, TEntityContainer.class).flatMap(c -> // 
        Util.filter(c.getEntitySetOrActionImportOrFunctionImport(), // 
        TEntitySet.class).map(// 
        x -> new Pair<TEntityContainer, TEntitySet>(c, x))).forEach(x -> writeEntitySet(schema, x));
        // write containers
        log("  writing container");
        // 
        Util.types(schema, TEntityContainer.class).forEach(x -> writeContainer(schema, x));
        // write single requests
        log("  writing entity requests");
        // 
        Util.types(schema, TEntityType.class).forEach(x -> writeEntityRequest(schema, x, typeActions, typeFunctions));
        log("  writing complex type requests");
        // 
        Util.types(schema, TComplexType.class).forEach(x -> writeComplexTypeRequest(schema, x));
    }
}
Also used : JsonProperty(com.fasterxml.jackson.annotation.JsonProperty) StreamProvider(com.github.davidmoten.odata.client.StreamProvider) Arrays(java.util.Arrays) HasNameJavaHasNullable(com.github.davidmoten.odata.client.generator.model.HasNameJavaHasNullable) HasContext(com.github.davidmoten.odata.client.HasContext) HttpService(com.github.davidmoten.odata.client.HttpService) TEnumType(org.oasisopen.odata.csdl.v4.TEnumType) Map(java.util.Map) Parameter(com.github.davidmoten.odata.client.generator.model.Action.Parameter) PrintWriter(java.io.PrintWriter) FunctionRequestReturningNonCollection(com.github.davidmoten.odata.client.FunctionRequestReturningNonCollection) SchemaAndType(com.github.davidmoten.odata.client.generator.Names.SchemaAndType) JacksonInject(com.fasterxml.jackson.annotation.JacksonInject) TEntitySet(org.oasisopen.odata.csdl.v4.TEntitySet) NameValue(com.github.davidmoten.odata.client.NameValue) RequestHelper(com.github.davidmoten.odata.client.internal.RequestHelper) Set(java.util.Set) ODataType(com.github.davidmoten.odata.client.ODataType) StandardCharsets(java.nio.charset.StandardCharsets) UncheckedIOException(java.io.UncheckedIOException) Stream(java.util.stream.Stream) Lists(com.github.davidmoten.guavamini.Lists) CollectionPageEntityRequest(com.github.davidmoten.odata.client.CollectionPageEntityRequest) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) SchemaInfo(com.github.davidmoten.odata.client.SchemaInfo) TProperty(org.oasisopen.odata.csdl.v4.TProperty) Checks(com.github.davidmoten.odata.client.internal.Checks) Files(java.nio.file.Files) TNavigationProperty(org.oasisopen.odata.csdl.v4.TNavigationProperty) Function(com.github.davidmoten.odata.client.generator.model.Function) StringWriter(java.io.StringWriter) TSingleton(org.oasisopen.odata.csdl.v4.TSingleton) HttpMethod(com.github.davidmoten.odata.client.HttpMethod) IOException(java.io.IOException) Include(com.fasterxml.jackson.annotation.JsonInclude.Include) ContainerBuilder(com.github.davidmoten.odata.client.TestingService.ContainerBuilder) File(java.io.File) ChangedFields(com.github.davidmoten.odata.client.internal.ChangedFields) NavigationProperty(com.github.davidmoten.odata.client.annotation.NavigationProperty) TNavigationPropertyBinding(org.oasisopen.odata.csdl.v4.TNavigationPropertyBinding) RequestOptions(com.github.davidmoten.odata.client.RequestOptions) ParameterMap(com.github.davidmoten.odata.client.internal.ParameterMap) TEnumTypeMember(org.oasisopen.odata.csdl.v4.TEnumTypeMember) HttpRequestOptions(com.github.davidmoten.odata.client.HttpRequestOptions) CollectionPage(com.github.davidmoten.odata.client.CollectionPage) FieldName(com.github.davidmoten.odata.client.generator.model.Structure.FieldName) ActionRequestNoReturn(com.github.davidmoten.odata.client.ActionRequestNoReturn) Action(com.github.davidmoten.odata.client.generator.model.Action) Field(com.github.davidmoten.odata.client.generator.model.Field) UploadStrategy(com.github.davidmoten.odata.client.UploadStrategy) TComplexType(org.oasisopen.odata.csdl.v4.TComplexType) JsonAnyGetter(com.fasterxml.jackson.annotation.JsonAnyGetter) ActionRequestReturningNonCollection(com.github.davidmoten.odata.client.ActionRequestReturningNonCollection) ReturnType(com.github.davidmoten.odata.client.generator.model.Action.ReturnType) UnmappedFields(com.github.davidmoten.odata.client.UnmappedFields) Collectors(java.util.stream.Collectors) EntityType(com.github.davidmoten.odata.client.generator.model.EntityType) JsonAnySetter(com.fasterxml.jackson.annotation.JsonAnySetter) Context(com.github.davidmoten.odata.client.Context) List(java.util.List) KeyElement(com.github.davidmoten.odata.client.generator.model.KeyElement) Method(com.github.davidmoten.odata.client.generator.model.Method) PropertyRef(com.github.davidmoten.odata.client.generator.model.PropertyRef) Structure(com.github.davidmoten.odata.client.generator.model.Structure) StreamUploaderChunked(com.github.davidmoten.odata.client.StreamUploaderChunked) Optional(java.util.Optional) ClientException(com.github.davidmoten.odata.client.ClientException) ContextPath(com.github.davidmoten.odata.client.ContextPath) JsonPropertyOrder(com.fasterxml.jackson.annotation.JsonPropertyOrder) ComplexType(com.github.davidmoten.odata.client.generator.model.ComplexType) Preconditions(com.github.davidmoten.guavamini.Preconditions) TypedObject(com.github.davidmoten.odata.client.internal.TypedObject) HashMap(java.util.HashMap) TActionFunctionParameter(org.oasisopen.odata.csdl.v4.TActionFunctionParameter) HashSet(java.util.HashSet) TActionFunctionReturnType(org.oasisopen.odata.csdl.v4.TActionFunctionReturnType) TFunction(org.oasisopen.odata.csdl.v4.TFunction) EntityRequest(com.github.davidmoten.odata.client.EntityRequest) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore) TAction(org.oasisopen.odata.csdl.v4.TAction) Path(com.github.davidmoten.odata.client.Path) Schema(org.oasisopen.odata.csdl.v4.Schema) StreamUploaderSingleCall(com.github.davidmoten.odata.client.StreamUploaderSingleCall) EntitySet(com.github.davidmoten.odata.client.generator.model.EntitySet) ODataEntityType(com.github.davidmoten.odata.client.ODataEntityType) BuilderBase(com.github.davidmoten.odata.client.TestingService.BuilderBase) ActionRequestReturningNonCollectionUnwrapped(com.github.davidmoten.odata.client.ActionRequestReturningNonCollectionUnwrapped) TEntityContainer(org.oasisopen.odata.csdl.v4.TEntityContainer) UnmappedFieldsImpl(com.github.davidmoten.odata.client.internal.UnmappedFieldsImpl) StreamUploader(com.github.davidmoten.odata.client.StreamUploader) JsonInclude(com.fasterxml.jackson.annotation.JsonInclude) FunctionRequestReturningStream(com.github.davidmoten.odata.client.FunctionRequestReturningStream) JsonIgnoreType(com.fasterxml.jackson.annotation.JsonIgnoreType) CollectionPageNonEntityRequest(com.github.davidmoten.odata.client.CollectionPageNonEntityRequest) FunctionRequestReturningNonCollectionUnwrapped(com.github.davidmoten.odata.client.FunctionRequestReturningNonCollectionUnwrapped) Property(com.github.davidmoten.odata.client.annotation.Property) Collections(java.util.Collections) TEntityType(org.oasisopen.odata.csdl.v4.TEntityType) TEntityType(org.oasisopen.odata.csdl.v4.TEntityType) Schema(org.oasisopen.odata.csdl.v4.Schema) SchemaAndType(com.github.davidmoten.odata.client.generator.Names.SchemaAndType) TEnumType(org.oasisopen.odata.csdl.v4.TEnumType) TEntitySet(org.oasisopen.odata.csdl.v4.TEntitySet) EntityType(com.github.davidmoten.odata.client.generator.model.EntityType) ODataEntityType(com.github.davidmoten.odata.client.ODataEntityType) TEntityType(org.oasisopen.odata.csdl.v4.TEntityType) TComplexType(org.oasisopen.odata.csdl.v4.TComplexType) TEntityContainer(org.oasisopen.odata.csdl.v4.TEntityContainer) ArrayList(java.util.ArrayList) List(java.util.List)

Example 89 with Schema

use of com.reprezen.kaizen.oasparser.model3.Schema in project odata-client by davidmoten.

the class Names method wrapCollection.

String wrapCollection(Imports imports, Class<?> collectionClass, String inner) {
    if (collectionClass.equals(CollectionPageEntityRequest.class)) {
        Schema sch = getSchema(inner);
        // get the type without namespace
        String entityRequestClass = getFullClassNameEntityRequestFromTypeWithNamespace(sch, inner);
        String a = toImportedFullClassName(inner, imports, collectionClass);
        return imports.add(collectionClass) + "<" + a + ", " + imports.add(entityRequestClass) + ">";
    } else {
        return imports.add(collectionClass) + "<" + toImportedFullClassName(inner, imports, collectionClass) + ">";
    }
}
Also used : Schema(org.oasisopen.odata.csdl.v4.Schema)

Example 90 with Schema

use of com.reprezen.kaizen.oasparser.model3.Schema in project odata-client by davidmoten.

the class Names method createMap.

private Map<String, String> createMap(List<Schema> schemas, Options options) {
    Map<String, String> map = new HashMap<>();
    for (Schema schema : schemas) {
        // 
        Util.types(schema, TEnumType.class).forEach(x -> map.put(schema.getNamespace() + "." + x.getName(), getFullClassNameEnum(schema, x.getName())));
        // 
        Util.types(schema, TEntityType.class).forEach(x -> map.put(schema.getNamespace() + "." + x.getName(), getFullClassNameEntity(schema, x.getName())));
        // 
        Util.types(schema, TComplexType.class).forEach(x -> map.put(schema.getNamespace() + "." + x.getName(), getFullClassNameComplexType(schema, x.getName())));
    }
    return map;
}
Also used : HashMap(java.util.HashMap) TEntityType(org.oasisopen.odata.csdl.v4.TEntityType) Schema(org.oasisopen.odata.csdl.v4.Schema) TComplexType(org.oasisopen.odata.csdl.v4.TComplexType) TEnumType(org.oasisopen.odata.csdl.v4.TEnumType)

Aggregations

Test (org.junit.Test)57 Schema (com.google.pubsub.v1.Schema)38 Schema (org.molgenis.emx2.Schema)38 AbstractMessage (com.google.protobuf.AbstractMessage)16 ByteString (com.google.protobuf.ByteString)16 QName (javax.xml.namespace.QName)16 File (java.io.File)15 URL (java.net.URL)15 Schema (org.geosdi.geoplatform.xml.xsd.v2001.Schema)15 SchemaServiceClient (com.google.cloud.pubsub.v1.SchemaServiceClient)14 ProjectName (com.google.pubsub.v1.ProjectName)14 LayerSchemaDTO (org.geosdi.geoplatform.connector.wfs.response.LayerSchemaDTO)14 IOException (java.io.IOException)13 StringWriter (java.io.StringWriter)13 Schema (org.oasisopen.odata.csdl.v4.Schema)13 Schema (com.reprezen.kaizen.oasparser.model3.Schema)11 JAXBElement (javax.xml.bind.JAXBElement)10 ArrayList (java.util.ArrayList)9 HashMap (java.util.HashMap)9 List (java.util.List)8