use of io.crnk.meta.model.MetaType in project crnk-framework by crnk-project.
the class TSMetaDataObjectTransformation method generateAttributes.
private static void generateAttributes(TSMetaTransformationContext context, TSInterfaceType interfaceType, MetaDataObject element) {
for (MetaAttribute attr : element.getDeclaredAttributes()) {
MetaType elementType = attr.getType().getElementType();
TSField field = new TSField();
field.setName(attr.getName());
field.setType((TSType) context.transform(elementType, TSMetaTransformationOptions.EMPTY));
field.setNullable(true);
interfaceType.getDeclaredMembers().add(field);
}
}
use of io.crnk.meta.model.MetaType in project crnk-framework by crnk-project.
the class MetaLookupTest method testPrimitiveObject.
@Test
public void testPrimitiveObject() {
MetaType meta = resourceProvider.getMeta(Object.class);
Assert.assertEquals("base.object", meta.getId());
Assert.assertEquals(Object.class, meta.getImplementationClass());
}
use of io.crnk.meta.model.MetaType in project crnk-framework by crnk-project.
the class MetaLookupTest method testPrimitiveFloat.
@Test
public void testPrimitiveFloat() {
MetaType meta = resourceProvider.getMeta(Float.class);
Assert.assertEquals("base.float", meta.getId());
Assert.assertEquals(Float.class, meta.getImplementationClass());
MetaType primitiveMeta = resourceProvider.getMeta(float.class);
Assert.assertSame(meta, primitiveMeta);
}
use of io.crnk.meta.model.MetaType in project crnk-framework by crnk-project.
the class MetaLookupTest method testPrimitiveBoolean.
@Test
public void testPrimitiveBoolean() {
MetaType meta = resourceProvider.getMeta(Boolean.class);
Assert.assertEquals("base.boolean", meta.getId());
Assert.assertEquals(Boolean.class, meta.getImplementationClass());
MetaType primitiveMeta = resourceProvider.getMeta(boolean.class);
Assert.assertSame(meta, primitiveMeta);
}
use of io.crnk.meta.model.MetaType in project crnk-framework by crnk-project.
the class MetaLookupTest method testPrimitiveByte.
@Test
public void testPrimitiveByte() {
MetaType meta = resourceProvider.getMeta(Byte.class);
Assert.assertEquals("base.byte", meta.getId());
Assert.assertEquals(Byte.class, meta.getImplementationClass());
MetaType primitiveMeta = resourceProvider.getMeta(byte.class);
Assert.assertSame(meta, primitiveMeta);
}
Aggregations