Search in sources :

Example 1 with SimpleQueryParamsParserContext

use of io.crnk.legacy.queryParams.context.SimpleQueryParamsParserContext in project crnk-framework by crnk-project.

the class DefaultQueryParamsParserTest method parseQueryParams.

private QueryParams parseQueryParams() {
    TestResourceInformationProvider infoBuilder = new TestResourceInformationProvider();
    infoBuilder.init(new ResourceInformationProviderContext() {

        @Override
        public String getResourceType(Class<?> clazz) {
            throw new UnsupportedOperationException();
        }

        @Override
        public boolean accept(Class<?> type) {
            throw new UnsupportedOperationException();
        }

        @Override
        public TypeParser getTypeParser() {
            return new TypeParser();
        }

        @Override
        public InformationBuilder getInformationBuilder() {
            throw new UnsupportedOperationException();
        }

        @Override
        public ObjectMapper getObjectMapper() {
            throw new UnsupportedOperationException();
        }
    });
    return parser.parse(new SimpleQueryParamsParserContext(queryParams, infoBuilder.build(TestResource.class)));
}
Also used : InformationBuilder(io.crnk.core.engine.information.InformationBuilder) SimpleQueryParamsParserContext(io.crnk.legacy.queryParams.context.SimpleQueryParamsParserContext) TypeParser(io.crnk.core.engine.parser.TypeParser) ResourceInformationProviderContext(io.crnk.core.engine.information.resource.ResourceInformationProviderContext) TestResourceInformationProvider(io.crnk.core.module.TestResourceInformationProvider) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 2 with SimpleQueryParamsParserContext

use of io.crnk.legacy.queryParams.context.SimpleQueryParamsParserContext in project crnk-framework by crnk-project.

the class JsonApiQueryParamsParserTest method parseQueryParams.

private QueryParams parseQueryParams() {
    TestResourceInformationProvider infoBuilder = new TestResourceInformationProvider();
    infoBuilder.init(new ResourceInformationProviderContext() {

        @Override
        public String getResourceType(Class<?> clazz) {
            throw new UnsupportedOperationException();
        }

        @Override
        public boolean accept(Class<?> type) {
            throw new UnsupportedOperationException();
        }

        @Override
        public TypeParser getTypeParser() {
            return new TypeParser();
        }

        @Override
        public InformationBuilder getInformationBuilder() {
            throw new UnsupportedOperationException();
        }

        @Override
        public ObjectMapper getObjectMapper() {
            throw new UnsupportedOperationException();
        }
    });
    return parser.parse(new SimpleQueryParamsParserContext(queryParams, infoBuilder.build(TestResource.class)));
}
Also used : InformationBuilder(io.crnk.core.engine.information.InformationBuilder) SimpleQueryParamsParserContext(io.crnk.legacy.queryParams.context.SimpleQueryParamsParserContext) TypeParser(io.crnk.core.engine.parser.TypeParser) ResourceInformationProviderContext(io.crnk.core.engine.information.resource.ResourceInformationProviderContext) TestResourceInformationProvider(io.crnk.core.module.TestResourceInformationProvider) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 InformationBuilder (io.crnk.core.engine.information.InformationBuilder)2 ResourceInformationProviderContext (io.crnk.core.engine.information.resource.ResourceInformationProviderContext)2 TypeParser (io.crnk.core.engine.parser.TypeParser)2 TestResourceInformationProvider (io.crnk.core.module.TestResourceInformationProvider)2 SimpleQueryParamsParserContext (io.crnk.legacy.queryParams.context.SimpleQueryParamsParserContext)2