Search in sources :

Example 6 with ProductDeclaration

use of org.whole.lang.pojo.model.ProductDeclaration in project whole by wholeplatform.

the class PojoUtils method translate.

public static void translate(Object fromObject, IEntity toIEntity, Library library) {
    Class<?> fromClass = fromObject.getClass();
    ProductDeclaration productDeclaration = findProductDeclaration(PojoEntityFactory.instance.createReferenceType(fromClass.getName()), library);
    if (!Matcher.matchImpl(PojoDeclaration, productDeclaration))
        throw new IllegalStateException("translate can be invoked only on pojo objects");
    translate(fromObject, toIEntity, (PojoDeclaration) productDeclaration, library);
}
Also used : ProductDeclaration(org.whole.lang.pojo.model.ProductDeclaration)

Aggregations

ProductDeclaration (org.whole.lang.pojo.model.ProductDeclaration)6 HashMap (java.util.HashMap)2 IEntity (org.whole.lang.model.IEntity)2 ArrayType (org.whole.lang.pojo.model.ArrayType)2 CollectionType (org.whole.lang.pojo.model.CollectionType)2 MapType (org.whole.lang.pojo.model.MapType)2 PrimitiveType (org.whole.lang.pojo.model.PrimitiveType)2 ReferenceType (org.whole.lang.pojo.model.ReferenceType)2 Type (org.whole.lang.pojo.model.Type)2 PrimitiveType (org.whole.lang.pojo.reflect.PojoEntityDescriptorEnum.PrimitiveType)2 ReferenceType (org.whole.lang.pojo.reflect.PojoEntityDescriptorEnum.ReferenceType)2 Path (org.whole.lang.queries.model.Path)2 Collection (java.util.Collection)1 Map (java.util.Map)1 IBindingManager (org.whole.lang.bindings.IBindingManager)1 EnumValue (org.whole.lang.model.EnumValue)1 PojoEntityFactory (org.whole.lang.pojo.factories.PojoEntityFactory)1 DataTypeDeclaration (org.whole.lang.pojo.model.DataTypeDeclaration)1 EnumDeclaration (org.whole.lang.pojo.model.EnumDeclaration)1 PojoDeclaration (org.whole.lang.pojo.model.PojoDeclaration)1