Search in sources :

Example 1 with StereotypePtr

use of org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr in project legend-engine by finos.

the class DomainParseTreeWalker method visitStereotypes.

private List<StereotypePtr> visitStereotypes(DomainParserGrammar.StereotypesContext ctx) {
    return ListIterate.collect(ctx.stereotype(), stereotypeContext -> {
        StereotypePtr stereotypePtr = new StereotypePtr();
        stereotypePtr.profile = PureGrammarParserUtility.fromQualifiedName(stereotypeContext.qualifiedName().packagePath() == null ? Collections.emptyList() : stereotypeContext.qualifiedName().packagePath().identifier(), stereotypeContext.qualifiedName().identifier());
        stereotypePtr.value = PureGrammarParserUtility.fromIdentifier(stereotypeContext.identifier());
        stereotypePtr.profileSourceInformation = this.walkerSourceInformation.getSourceInformation(stereotypeContext.qualifiedName());
        stereotypePtr.sourceInformation = this.walkerSourceInformation.getSourceInformation(stereotypeContext);
        return stereotypePtr;
    });
}
Also used : StereotypePtr(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr)

Example 2 with StereotypePtr

use of org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr in project legend-engine by finos.

the class DataParseTreeWalker method visitStereotypes.

private List<StereotypePtr> visitStereotypes(DataParserGrammar.StereotypesContext ctx) {
    return ListIterate.collect(ctx.stereotype(), stereotypeContext -> {
        StereotypePtr stereotypePtr = new StereotypePtr();
        stereotypePtr.profile = PureGrammarParserUtility.fromQualifiedName(stereotypeContext.qualifiedName().packagePath() == null ? Collections.emptyList() : stereotypeContext.qualifiedName().packagePath().identifier(), stereotypeContext.qualifiedName().identifier());
        stereotypePtr.value = PureGrammarParserUtility.fromIdentifier(stereotypeContext.identifier());
        stereotypePtr.profileSourceInformation = this.walkerSourceInformation.getSourceInformation(stereotypeContext.qualifiedName());
        stereotypePtr.sourceInformation = this.walkerSourceInformation.getSourceInformation(stereotypeContext);
        return stereotypePtr;
    });
}
Also used : StereotypePtr(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr)

Example 3 with StereotypePtr

use of org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr in project legend-engine by finos.

the class ServiceParseTreeWalker method visitStereotypes.

private List<StereotypePtr> visitStereotypes(ServiceParserGrammar.StereotypesContext ctx) {
    return ListIterate.collect(ctx.stereotype(), stereotypeContext -> {
        StereotypePtr stereotypePtr = new StereotypePtr();
        stereotypePtr.profile = PureGrammarParserUtility.fromQualifiedName(stereotypeContext.qualifiedName().packagePath() == null ? Collections.emptyList() : stereotypeContext.qualifiedName().packagePath().identifier(), stereotypeContext.qualifiedName().identifier());
        stereotypePtr.value = PureGrammarParserUtility.fromIdentifier(stereotypeContext.identifier());
        stereotypePtr.profileSourceInformation = this.walkerSourceInformation.getSourceInformation(stereotypeContext.qualifiedName());
        stereotypePtr.sourceInformation = this.walkerSourceInformation.getSourceInformation(stereotypeContext);
        return stereotypePtr;
    });
}
Also used : StereotypePtr(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr)

Example 4 with StereotypePtr

use of org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr in project legend-engine by finos.

the class DataSpaceParseTreeWalker method visitStereotypes.

private List<StereotypePtr> visitStereotypes(DataSpaceParserGrammar.StereotypesContext ctx) {
    return ListIterate.collect(ctx.stereotype(), stereotypeContext -> {
        StereotypePtr stereotypePtr = new StereotypePtr();
        stereotypePtr.profile = PureGrammarParserUtility.fromQualifiedName(stereotypeContext.qualifiedName().packagePath() == null ? Collections.emptyList() : stereotypeContext.qualifiedName().packagePath().identifier(), stereotypeContext.qualifiedName().identifier());
        stereotypePtr.value = PureGrammarParserUtility.fromIdentifier(stereotypeContext.identifier());
        stereotypePtr.profileSourceInformation = this.walkerSourceInformation.getSourceInformation(stereotypeContext.qualifiedName());
        stereotypePtr.sourceInformation = this.walkerSourceInformation.getSourceInformation(stereotypeContext);
        return stereotypePtr;
    });
}
Also used : StereotypePtr(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr)

Example 5 with StereotypePtr

use of org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr in project legend-engine by finos.

the class QueryStoreManager method documentToQuery.

private static Query documentToQuery(Document document) {
    Query query = new Query();
    query.id = document.getString("id");
    query.name = document.getString("name");
    query.description = document.getString("description");
    query.groupId = document.getString("groupId");
    query.artifactId = document.getString("artifactId");
    query.versionId = document.getString("versionId");
    query.mapping = document.getString("mapping");
    query.runtime = document.getString("runtime");
    query.content = document.getString("content");
    query.owner = document.getString("owner");
    if (document.get("taggedValues") != null) {
        query.taggedValues = ListIterate.collect(document.getList("taggedValues", Document.class), _doc -> {
            TaggedValue taggedValue = new TaggedValue();
            taggedValue.tag = new TagPtr();
            taggedValue.tag.profile = _doc.getEmbedded(Lists.fixedSize.of("tag", "profile"), String.class);
            taggedValue.tag.value = _doc.getEmbedded(Lists.fixedSize.of("tag", "value"), String.class);
            taggedValue.value = _doc.getString("value");
            return taggedValue;
        });
    }
    if (document.get("stereotypes") != null) {
        query.stereotypes = ListIterate.collect(document.getList("stereotypes", Document.class), _doc -> {
            StereotypePtr stereotypePtr = new StereotypePtr();
            stereotypePtr.profile = _doc.getString("profile");
            stereotypePtr.value = _doc.getString("value");
            return stereotypePtr;
        });
    }
    return query;
}
Also used : Document(org.bson.Document) MongoClient(com.mongodb.client.MongoClient) MongoCollection(com.mongodb.client.MongoCollection) Projections(com.mongodb.client.model.Projections) Lists(org.eclipse.collections.api.factory.Lists) TaggedValue(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.TaggedValue) QuerySearchSpecification(org.finos.legend.engine.application.query.model.QuerySearchSpecification) MongoDatabase(com.mongodb.client.MongoDatabase) Vault(org.finos.legend.engine.shared.core.vault.Vault) ArrayList(java.util.ArrayList) Filters(com.mongodb.client.model.Filters) Bson(org.bson.conversions.Bson) TagPtr(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.TagPtr) Query(org.finos.legend.engine.application.query.model.Query) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) ListIterate(org.eclipse.collections.impl.utility.ListIterate) Instant(java.time.Instant) SourceVersion(javax.lang.model.SourceVersion) QueryEvent(org.finos.legend.engine.application.query.model.QueryEvent) List(java.util.List) LazyIterate(org.eclipse.collections.impl.utility.LazyIterate) Response(javax.ws.rs.core.Response) Pattern(java.util.regex.Pattern) StereotypePtr(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr) Query(org.finos.legend.engine.application.query.model.Query) TaggedValue(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.TaggedValue) TagPtr(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.TagPtr) StereotypePtr(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr)

Aggregations

StereotypePtr (org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr)7 Query (org.finos.legend.engine.application.query.model.Query)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 MongoClient (com.mongodb.client.MongoClient)1 MongoCollection (com.mongodb.client.MongoCollection)1 MongoDatabase (com.mongodb.client.MongoDatabase)1 Filters (com.mongodb.client.model.Filters)1 Projections (com.mongodb.client.model.Projections)1 Instant (java.time.Instant)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Pattern (java.util.regex.Pattern)1 SourceVersion (javax.lang.model.SourceVersion)1 Response (javax.ws.rs.core.Response)1 Document (org.bson.Document)1 Bson (org.bson.conversions.Bson)1 Lists (org.eclipse.collections.api.factory.Lists)1 LazyIterate (org.eclipse.collections.impl.utility.LazyIterate)1 ListIterate (org.eclipse.collections.impl.utility.ListIterate)1