use of org.whole.lang.pojo.model.Library in project whole by wholeplatform.
the class PojoMappingUtils method getLibrary.
public static Library getLibrary(Misc compilationUnits, IBindingManager bindings) {
PathExpression javaModelToPojoModel = new JavaModelToPojoModelQuery().create();
Library library = BehaviorUtils.<Library>evaluateFirstResult(javaModelToPojoModel, compilationUnits, bindings);
Matcher.removeVars(library, true);
return library;
}
use of org.whole.lang.pojo.model.Library in project whole by wholeplatform.
the class PojoMappingUtils method getModel.
public static Model getModel(Library library) {
IBindingManager bindings = BindingManagerFactory.instance.createBindingManager();
PathExpression pojoModelToModels = new PojoModelToModelsQuery().create();
Library normalizedLibrary = NormalizerOperation.normalize(EntityUtils.clone(library));
Model model = BehaviorUtils.<Model>evaluateFirstResult(pojoModelToModels, normalizedLibrary, bindings);
Matcher.removeVars(model, true);
return model;
}
use of org.whole.lang.pojo.model.Library in project whole by wholeplatform.
the class PojoUtilsTest method testTranslateFromPojoClasses.
// FIXME
@Category(KnownFailingTests.class)
@Test
public void testTranslateFromPojoClasses() {
Object simplePojo = createPojo();
Misc compilationUnits = getCompilationUnits(CLASSES);
Library library = PojoMappingUtils.getLibrary(compilationUnits, "SimplePojo");
IEntity mappedModel = PojoMappingUtils.getModel(library);
InterpreterOperation.interpret(mappedModel);
Library normalizedLibrary = NormalizerOperation.normalize(EntityUtils.clone(library));
IEntity simplePojoModel = PojoUtils.create(simplePojo, normalizedLibrary);
Object simplePojoObject = PojoUtils.create(simplePojoModel, normalizedLibrary);
Assert.assertEquals(simplePojoObject, simplePojo);
}
use of org.whole.lang.pojo.model.Library in project whole by wholeplatform.
the class PojoMappingUtils method getLibrary.
public static Library getLibrary(Misc compilationUnits, String libraryName, String libraryLanguageURI, boolean generatePropertyTemplates) {
IBindingManager bindings = BindingManagerFactory.instance.createBindingManager();
bindings.wDefValue("libraryName", libraryName);
bindings.wDefValue("libraryLanguageURI", libraryLanguageURI);
if (generatePropertyTemplates)
bindings.wDefValue("generatePropertyTemplates", true);
Library library = getLibrary(compilationUnits, bindings);
return library;
}
use of org.whole.lang.pojo.model.Library in project whole by wholeplatform.
the class LibraryPart method getModelSpecificChildren.
protected List<IEntity> getModelSpecificChildren() {
Library library = getModelEntity();
List<IEntity> list = new ArrayList<IEntity>(4);
list.add(library.getAnnotations());
list.add(library.getName());
list.add(library.getLanguageURI());
list.add(library.getDeclarations());
return list;
}
Aggregations