use of org.whole.lang.bindings.IBindingManager in project whole by wholeplatform.
the class SchemaUtils method deploy.
// public static void deploy(String namespaceURI, String schemaLocationURI, String folderLocation) {
// deploy(namespaceURI, schemaLocationURI, folderLocation, null);
// }
public static void deploy(String namespaceURI, String schemaLocationURI, String folderLocation, /* was LSResourceResolver, workaround for Android compatibility */
ResourceResolver lsResourceResolver) {
IBindingManager bindings = BindingManagerFactory.instance.createArguments();
bindings.wDefValue("folderLocation", folderLocation);
bindings.wDefValue("lsResourceResolver", lsResourceResolver);
deploy(namespaceURI, schemaLocationURI, bindings);
}
use of org.whole.lang.bindings.IBindingManager in project whole by wholeplatform.
the class TextInterpreterVisitor method visit.
@Override
public void visit(ITextEntity entity) {
IVisitor ov = op().setVisitor(entity, 0, op().getVisitor(entity, 1));
op().stagedVisit(entity);
op().setVisitor(entity, 0, ov);
IBindingManager bm = getBindings();
bm.setResult(TextEntityFactory.instance.createText(toPrettyPrintString(bm.getResult())));
}
use of org.whole.lang.bindings.IBindingManager in project whole by wholeplatform.
the class BindVariablesInPathTest method testBindVariablesInPathOK2.
@Test
public void testBindVariablesInPathOK2() throws Exception {
IBindingManager bindings = BindingManagerFactory.instance.createArguments();
IEntity compilationUnits = BindVariablesInPathTemplateManager.instance().create("compilationUnit");
PathExpression findClassDeclarationsOK2 = (PathExpression) BindVariablesInPathTemplateManager.instance().create("findClassDeclarationsOK2");
IEntityIterator<IEntity> iterator;
iterator = BehaviorUtils.<IEntity>compileAndLazyEvaluate(findClassDeclarationsOK2, compilationUnits, bindings);
while (iterator.hasNext()) {
assertNotNull(iterator.next());
assertTrue(bindings.wIsSet("methodDeclaration"));
}
}
use of org.whole.lang.bindings.IBindingManager in project whole by wholeplatform.
the class BindVariablesInPathTest method testBindVariablesInPathOK1.
@Test
public void testBindVariablesInPathOK1() throws Exception {
IBindingManager bindings = BindingManagerFactory.instance.createArguments();
IEntity compilationUnits = BindVariablesInPathTemplateManager.instance().create("compilationUnit");
PathExpression findClassDeclarationsOK1 = (PathExpression) BindVariablesInPathTemplateManager.instance().create("findClassDeclarationsOK1");
IEntityIterator<IEntity> iterator;
iterator = BehaviorUtils.<IEntity>compileAndLazyEvaluate(findClassDeclarationsOK1, compilationUnits, bindings);
while (iterator.hasNext()) {
assertNotNull(iterator.next());
assertTrue(bindings.wIsSet("methodDeclaration"));
}
}
use of org.whole.lang.bindings.IBindingManager in project whole by wholeplatform.
the class ControlQueriesTest method testIf4.
@Test
public void testIf4() {
ITemplateManager tm = ControlQueriesTemplateManager.instance();
PathExpression query = (PathExpression) tm.create("if4");
QueriesEntityFactory qef = QueriesEntityFactory.instance;
IEntity queryExp1 = qef.createDivision(qef.createIntLiteral(10), qef.createIntLiteral(8));
IBindingManager bm = BindingManagerFactory.instance.createBindingManager();
IEntityIterator<IEntity> iterator = BehaviorUtils.compileAndLazyEvaluate(query, queryExp1, bm);
assertTrue(iterator.hasNext());
IEntity exp1 = iterator.next();
assertSame(queryExp1.wGet(0), exp1);
assertTrue(bm.wIsSet("a"));
assertFalse(bm.wIsSet("b"));
assertFalse(bm.wIsSet("exp1"));
assertFalse(bm.wIsSet("exp2"));
assertTrue(iterator.hasNext());
IEntity exp2 = iterator.next();
assertSame(queryExp1.wGet(1), exp2);
assertFalse(bm.wIsSet("a"));
assertTrue(bm.wIsSet("b"));
assertFalse(bm.wIsSet("exp1"));
assertFalse(bm.wIsSet("exp2"));
assertFalse(iterator.hasNext());
}
Aggregations