use of org.whole.lang.java.model.MethodInvocation in project whole by wholeplatform.
the class MatcherTest method testMultipleTypesSubstitute.
@Test
public void testMultipleTypesSubstitute() {
ClassDeclaration functionPattern = new FunctionPattern().create();
IBindingManager bindings = BindingManagerFactory.instance.createBindingManager();
bindings.wDefValue("factName", "factorial");
bindings.wDefValue("factArg", 5);
Matcher.substitute(functionPattern, bindings, false);
IEntity var1 = functionPattern.getBodyDeclarations().wGet(0).wGet(JavaFeatureDescriptorEnum.name);
MethodInvocation methodInvocation = (MethodInvocation) functionPattern.getBodyDeclarations().wGet(1).wGet(JavaFeatureDescriptorEnum.body).wGet(0).wGet(JavaFeatureDescriptorEnum.expression).wGet(JavaFeatureDescriptorEnum.arguments).wGet(0);
IEntity var2 = methodInvocation.getName();
IEntity var3 = methodInvocation.getArguments().wGet(0);
assertEquals("factorial", var1.wStringValue());
assertEquals("factorial", var2.wStringValue());
assertEquals(5, var3.wByteValue());
}
use of org.whole.lang.java.model.MethodInvocation in project whole by wholeplatform.
the class MethodInvocationPart method getModelSpecificChildren.
protected List<IEntity> getModelSpecificChildren() {
MethodInvocation entity = getModelEntity();
((MethodInvocationFigure) getFigure()).hideExpression(EntityUtils.isResolver(entity.getExpression()));
((MethodInvocationFigure) getFigure()).hideTypeParameters(EntityUtils.isResolver(entity.getTypeArguments()));
List<IEntity> list = new ArrayList<IEntity>(4);
list.add(entity.getExpression());
list.add(entity.getTypeArguments());
list.add(entity.getName());
list.add(entity.getArguments());
return list;
}
Aggregations