use of org.whole.lang.java.model.MethodDeclaration in project whole by wholeplatform.
the class MethodDeclarationPart method getModelSpecificChildren.
protected List<IEntity> getModelSpecificChildren() {
MethodDeclaration entity = getModelEntity();
List<IEntity> list = new ArrayList<IEntity>(8);
list.add(entity.getModifiers());
list.add(entity.getTypeParameters());
list.add(entity.getReturnType());
list.add(entity.getName());
list.add(entity.getParameters());
list.add(entity.getThrownExceptions());
list.add(entity.getBody());
list.add(entity.getJavadoc());
return list;
}
use of org.whole.lang.java.model.MethodDeclaration in project whole by wholeplatform.
the class MethodDeclarationPart method refreshVisuals.
@Override
protected void refreshVisuals() {
MethodDeclaration entity = getModelEntity();
MethodDeclarationFigure methodDeclarationFigure = (MethodDeclarationFigure) getFigure();
methodDeclarationFigure.showTypeParameters(!EntityUtils.isResolver(entity.getTypeParameters()));
methodDeclarationFigure.showThrownExceptions(!EntityUtils.isResolver(entity.getThrownExceptions()));
methodDeclarationFigure.showBodyDeclaration(!EntityUtils.isResolver(entity.getBody()));
}
use of org.whole.lang.java.model.MethodDeclaration in project whole by wholeplatform.
the class SelectQueriesTest method testSelectTemplateWithTwoNestedSelectQueries.
@Test
public void testSelectTemplateWithTwoNestedSelectQueries() {
ITemplateManager tm = SelectQueriesTemplateManager.instance();
Model m = new XmlModel().create();
PathExpression pe1 = (PathExpression) tm.create("selectTemplateWithTwoNestedSelectQueries");
for (ClassDeclaration t : BehaviorUtils.<ClassDeclaration>compileAndLazyEvaluate(pe1, m)) {
assertEquals(JavaEntityDescriptorEnum.ClassDeclaration, t.wGetEntityDescriptor());
BodyDeclarations bodyDeclarations = t.getBodyDeclarations();
MethodDeclaration md = (MethodDeclaration) bodyDeclarations.wGet(bodyDeclarations.wSize() - 1);
assertEquals(bodyDeclarations.wSize() - 1, md.getBody().wSize());
}
}
use of org.whole.lang.java.model.MethodDeclaration in project whole by wholeplatform.
the class ScannerTest method testPatternIterator.
@Test
public void testPatternIterator() {
IEntity fact = new Factorial().create();
IEntityIterator<IEntity> i = IteratorFactory.childMatcherIterator().withPattern(JavaEntityDescriptorEnum.MethodDeclaration);
i.reset(fact);
while (i.hasNext()) {
MethodDeclaration md = (MethodDeclaration) i.next();
md.getName();
}
}
Aggregations