use of org.whole.lang.java.model.SingleVariableDeclaration in project whole by wholeplatform.
the class SingleVariableDeclarationPart method getModelSpecificChildren.
protected List<IEntity> getModelSpecificChildren() {
SingleVariableDeclaration entity = getModelEntity();
Varargs varargs = entity.getVarargs();
SingleVariableDeclarationFigure figure = (SingleVariableDeclarationFigure) getFigure();
figure.showVarargs(!EntityUtils.isResolver(varargs) && varargs.wBooleanValue());
List<IEntity> list = new ArrayList<IEntity>(4);
list.add(entity.getModifiers());
list.add(entity.getType());
list.add(entity.getName());
list.add(entity.getVarargsAnnotations());
return list;
}
use of org.whole.lang.java.model.SingleVariableDeclaration in project whole by wholeplatform.
the class SelectQueriesTest method testSelectTupleOfTemplatesAs.
@Test
public void testSelectTupleOfTemplatesAs() {
Model model = new XmlModel().create();
ITemplateManager tm = SelectQueriesTemplateManager.instance();
PathExpression query = (PathExpression) tm.create("selectTupleOfTemplatesAs");
IBindingManager bm = BindingManagerFactory.instance.createArguments();
for (IEntity tuple : BehaviorUtils.compileAndLazyEvaluate(query, model, bm)) {
FieldDeclaration f = (FieldDeclaration) tuple.wGet(0);
SingleVariableDeclaration p = (SingleVariableDeclaration) tuple.wGet(1);
ExpressionStatement s = (ExpressionStatement) tuple.wGet(2);
Feature e = (Feature) tuple.wGet(3);
String ptype = e.getType().wStringValue();
String pname = e.getName().wStringValue();
assertSame(f, bm.wGet("field"));
assertEquals(ptype, f.getType().wStringValue());
assertSame(p, bm.wGet("param"));
assertEquals(ptype, p.getType().wStringValue());
assertEquals(pname, p.getName().wStringValue());
assertSame(s, bm.wGet("init"));
assertEquals(pname, ((Assignment) s.getExpression()).getRightHandSide().wStringValue());
}
}
Aggregations