use of io.crnk.core.engine.parser.TypeParser 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)));
}
use of io.crnk.core.engine.parser.TypeParser 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)));
}
use of io.crnk.core.engine.parser.TypeParser in project crnk-framework by crnk-project.
the class DefaultQuerySpecDeserializerTestBase method setup.
@Before
public void setup() {
super.setup();
deserializerContext = new QuerySpecDeserializerContext() {
@Override
public ResourceRegistry getResourceRegistry() {
return resourceRegistry;
}
@Override
public TypeParser getTypeParser() {
return moduleRegistry.getTypeParser();
}
};
deserializer = new DefaultQuerySpecDeserializer();
deserializer.init(deserializerContext);
taskInformation = resourceRegistry.getEntry(Task.class).getResourceInformation();
taskWithPagingBehaviorInformation = resourceRegistry.getEntry(TaskWithPagingBehavior.class).getResourceInformation();
}
use of io.crnk.core.engine.parser.TypeParser in project crnk-framework by crnk-project.
the class JpaResourceInformationProviderTest method setup.
@Before
public void setup() {
jpaMetaProvider = new JpaMetaProvider(Collections.<Class>emptySet());
lookup = new MetaLookup();
lookup.addProvider(jpaMetaProvider);
builder = new JpaResourceInformationProvider(new NullPropertiesProvider());
builder.init(new DefaultResourceInformationProviderContext(builder, new DefaultInformationBuilder(new TypeParser()), new TypeParser(), new ObjectMapper()));
}
use of io.crnk.core.engine.parser.TypeParser in project crnk-framework by crnk-project.
the class JaxrsModuleTest method setup.
@Before
public void setup() {
final ModuleRegistry moduleRegistry = new ModuleRegistry();
builder = new JaxrsModule.JaxrsResourceRepositoryInformationProvider();
final ResourceInformationProvider resourceInformationProvider = new DefaultResourceInformationProvider(moduleRegistry.getPropertiesProvider(), ImmutableList.<PagingBehavior>of(new OffsetLimitPagingBehavior()), new DefaultResourceFieldInformationProvider(), new JacksonResourceFieldInformationProvider());
resourceInformationProvider.init(new DefaultResourceInformationProviderContext(resourceInformationProvider, new DefaultInformationBuilder(moduleRegistry.getTypeParser()), moduleRegistry.getTypeParser(), new ObjectMapper()));
context = new RepositoryInformationProviderContext() {
@Override
public ResourceInformationProvider getResourceInformationBuilder() {
return resourceInformationProvider;
}
@Override
public TypeParser getTypeParser() {
return moduleRegistry.getTypeParser();
}
@Override
public InformationBuilder builder() {
return new DefaultInformationBuilder(moduleRegistry.getTypeParser());
}
};
}
Aggregations