package org.whole.lang.queries.util.tests; import org.whole.lang.model.IEntity; import org.whole.lang.templates.AbstractTemplateFactory; import org.whole.lang.templates.AbstractTemplateManager; import org.whole.lang.templates.ITemplateFactory; public class QueriesJoinPointsTestTemplateManager extends AbstractTemplateManager { private static class SingletonHolder { private static final QueriesJoinPointsTestTemplateManager instance = new QueriesJoinPointsTestTemplateManager(); } public static QueriesJoinPointsTestTemplateManager instance() { return SingletonHolder.instance; } private QueriesJoinPointsTestTemplateManager() { put("fragment5", newFragment5()); put("fragment", newFragment()); put("fragment1", newFragment1()); } public ITemplateFactory<IEntity> newFragment5() { return new AbstractTemplateFactory<IEntity>() { public void apply(org.whole.lang.builders.IBuilderOperation op) { org.whole.lang.actions.builders.IActionsBuilder b0 = (org.whole.lang.actions.builders.IActionsBuilder) op.wGetBuilder(org.whole.lang.actions.reflect.ActionsLanguageKit.URI); b0.GuardedAction_(); b0.Label("Action 2"); org.whole.lang.queries.builders.IQueriesBuilder b1 = (org.whole.lang.queries.builders.IQueriesBuilder) op.wGetBuilder(org.whole.lang.queries.reflect.QueriesLanguageKit.URI); b1.SelfStep(); b1.ExpressionTest_(); b1.BooleanLiteral(true); b1._ExpressionTest(); b0._GuardedAction(); } }; } public ITemplateFactory<IEntity> newFragment() { return new AbstractTemplateFactory<IEntity>() { public void apply(org.whole.lang.builders.IBuilderOperation op) { org.whole.lang.queries.builders.IQueriesBuilder b0 = (org.whole.lang.queries.builders.IQueriesBuilder) op.wGetBuilder(org.whole.lang.queries.reflect.QueriesLanguageKit.URI); b0.Block_(5); b0.Filter_(); org.whole.lang.commons.builders.ICommonsBuilder b1 = (org.whole.lang.commons.builders.ICommonsBuilder) op.wGetBuilder(org.whole.lang.commons.reflect.CommonsLanguageKit.URI); b1.StageUpFragment_(); org.whole.lang.java.builders.IJavaBuilder b2 = (org.whole.lang.java.builders.IJavaBuilder) op.wGetBuilder(org.whole.lang.java.reflect.JavaLanguageKit.URI); b2.Block_(2); b2.ExpressionStatement_(); b2.MethodInvocation_(); b2.SimpleName("simpleName"); b2.Types_(0); b2._Types(); b1.StageDownFragment_(); b0.Filter_(); b1.StageUpFragment_(); b1.Resolver(); b1._StageUpFragment(); b0.VariableTest("fnamePHJP"); b0._Filter(); b1._StageDownFragment(); b2.Arguments_(1); b1.StageDownFragment_(); b0.Filter_(); b1.StageUpFragment_(); b2.SimpleName("argPlaceHolder"); b1._StageUpFragment(); b0.VariableTest("arg0IP"); b0._Filter(); b1._StageDownFragment(); b2._Arguments(); b2._MethodInvocation(); b2._ExpressionStatement(); b2.ExpressionStatement_(); b2.MethodInvocation_(); b2.SimpleName("simpleName"); b2.Types_(0); b2._Types(); b1.StageDownFragment_(); b0.Path_(2); b0.Sequence_(1); b0.QueryDeclaration_(); b0.Name("fnameQuery"); b0.Names_(0); b0._Names(); b0.PointwiseUpdate_(); b0.VariableRefStep("fnameJP"); b0.SelfStep(); b0._PointwiseUpdate(); b0._QueryDeclaration(); b0._Sequence(); b0.Sequence_(1); b0.Do_(); b0.Filter_(); b1.StageUpFragment_(); b2.SimpleName("fName"); b1._StageUpFragment(); b0.VariableTest("fnameJP"); b0._Filter(); b0._Do(); b0._Sequence(); b0._Path(); b1._StageDownFragment(); b1.StageDownFragment_(); b0.Filter_(); b1.StageUpFragment_(); b2.Arguments_(2); b2.SimpleName("arga"); b2.SimpleName("argb"); b2._Arguments(); b1._StageUpFragment(); b0.VariableTest("argsIP"); b0._Filter(); b1._StageDownFragment(); b2._MethodInvocation(); b2._ExpressionStatement(); b2._Block(); b1._StageUpFragment(); b0.VariableTest("pName"); b0._Filter(); b0.QueryDeclaration_(); b0.Name("around"); b0.Names_(1); b0.Name("joinpoint"); b0._Names(); b0.PointwiseUpdate_(); b0.VariableRefStep("joinpoint"); b0.SelfStep(); b0._PointwiseUpdate(); b0._QueryDeclaration(); b0.QueryDeclaration_(); b0.Name("before"); b0.Names_(1); b0.Name("joinpoint"); b0._Names(); b0.PointwiseInsert_(); b0.Placement("BEFORE"); b0.VariableRefStep("joinpoint"); b0.SelfStep(); b0._PointwiseInsert(); b0._QueryDeclaration(); b0.QueryDeclaration_(); b0.Name("into"); b0.Names_(1); b0.Name("joinpoint"); b0._Names(); b0.PointwiseInsert_(); b0.Placement("INTO"); b0.VariableRefStep("joinpoint"); b0.SelfStep(); b0._PointwiseInsert(); b0._QueryDeclaration(); b0.Sequence_(5); b0.Block_(2); b0.CartesianUpdate_(); b0.VariableRefStep("fnamePHJP"); b1.StageUpFragment_(); b2.SimpleName("fname"); b1._StageUpFragment(); b0._CartesianUpdate(); b0.VariableRefStep("pName"); b0._Block(); b0.Block_(2); b0.CartesianUpdate_(); b0.VariableRefStep("fnameJP"); b1.StageUpFragment_(); b2.SimpleName("fname2"); b1._StageUpFragment(); b0._CartesianUpdate(); b0.VariableRefStep("pName"); b0._Block(); b0.Block_(4); b0.Path_(2); b1.StageUpFragment_(); b2.SimpleName("myfname2"); b1._StageUpFragment(); b0.Call_(); b0.Name("around"); b0.Expressions_(1); b0.VariableRefStep("fnamePHJP"); b0._Expressions(); b0._Call(); b0._Path(); b0.Path_(2); b1.StageUpFragment_(); b2.SimpleName("arg__"); b1._StageUpFragment(); b0.Call_(); b0.Name("before"); b0.Expressions_(1); b0.VariableRefStep("arg0IP"); b0._Expressions(); b0._Call(); b0._Path(); b0.Path_(2); b0.Sequence_(1); b0.Do_(); b0.Sequence_(2); b1.StageUpFragment_(); b2.SimpleName("arg0a"); b1._StageUpFragment(); b1.StageUpFragment_(); b2.SimpleName("arg1a"); b1._StageUpFragment(); b0._Sequence(); b0._Do(); b0._Sequence(); b0.Call_(); b0.Name("into"); b0.Expressions_(1); b0.VariableRefStep("argsIP"); b0._Expressions(); b0._Call(); b0._Path(); b0.VariableRefStep("pName"); b0._Block(); b0.Block_(3); b0.CartesianInsert_(); b0.Placement("BEFORE"); b0.VariableRefStep("arg0IP"); b1.StageUpFragment_(); b2.SimpleName("arg"); b1._StageUpFragment(); b0._CartesianInsert(); b0.CartesianInsert_(); b0.Placement("INTO"); b0.VariableRefStep("argsIP"); b0.Sequence_(2); b1.StageUpFragment_(); b2.SimpleName("arg0"); b1._StageUpFragment(); b1.StageUpFragment_(); b2.SimpleName("arg1"); b1._StageUpFragment(); b0._Sequence(); b0._CartesianInsert(); b0.VariableRefStep("pName"); b0._Block(); b0.Block_(2); b0.Path_(2); b1.StageUpFragment_(); b2.SimpleName("myqueryfname2"); b1._StageUpFragment(); b0.Call_(); b0.Name("fnameQuery"); b0.Expressions_(0); b0._Expressions(); b0._Call(); b0._Path(); b0.VariableRefStep("pName"); b0._Block(); b0._Sequence(); b0._Block(); } }; } public ITemplateFactory<IEntity> newFragment1() { return new AbstractTemplateFactory<IEntity>() { public void apply(org.whole.lang.builders.IBuilderOperation op) { org.whole.lang.misc.builders.IMiscBuilder b0 = (org.whole.lang.misc.builders.IMiscBuilder) op.wGetBuilder(org.whole.lang.misc.reflect.MiscLanguageKit.URI); b0.Misc_(5); org.whole.lang.commons.builders.ICommonsBuilder b1 = (org.whole.lang.commons.builders.ICommonsBuilder) op.wGetBuilder(org.whole.lang.commons.reflect.CommonsLanguageKit.URI); b1.StageUpFragment_(); org.whole.lang.java.builders.IJavaBuilder b2 = (org.whole.lang.java.builders.IJavaBuilder) op.wGetBuilder(org.whole.lang.java.reflect.JavaLanguageKit.URI); b2.Block_(2); b2.ExpressionStatement_(); b2.MethodInvocation_(); b2.SimpleName("simpleName"); b2.Types_(0); b2._Types(); b2.SimpleName("fname"); b2.Arguments_(1); b2.SimpleName("argPlaceHolder"); b2._Arguments(); b2._MethodInvocation(); b2._ExpressionStatement(); b2.ExpressionStatement_(); b2.MethodInvocation_(); b2.SimpleName("simpleName"); b2.Types_(0); b2._Types(); b2.SimpleName("fName"); b2.Arguments_(2); b2.SimpleName("arga"); b2.SimpleName("argb"); b2._Arguments(); b2._MethodInvocation(); b2._ExpressionStatement(); b2._Block(); b1._StageUpFragment(); b1.StageUpFragment_(); b2.Block_(2); b2.ExpressionStatement_(); b2.MethodInvocation_(); b2.SimpleName("simpleName"); b2.Types_(0); b2._Types(); b2.SimpleName("fname"); b2.Arguments_(1); b2.SimpleName("argPlaceHolder"); b2._Arguments(); b2._MethodInvocation(); b2._ExpressionStatement(); b2.ExpressionStatement_(); b2.MethodInvocation_(); b2.SimpleName("simpleName"); b2.Types_(0); b2._Types(); b2.SimpleName("fname2"); b2.Arguments_(2); b2.SimpleName("arga"); b2.SimpleName("argb"); b2._Arguments(); b2._MethodInvocation(); b2._ExpressionStatement(); b2._Block(); b1._StageUpFragment(); b1.StageUpFragment_(); b2.Block_(2); b2.ExpressionStatement_(); b2.MethodInvocation_(); b2.SimpleName("simpleName"); b2.Types_(0); b2._Types(); b2.SimpleName("myfname2"); b2.Arguments_(2); b2.SimpleName("arg__"); b2.SimpleName("argPlaceHolder"); b2._Arguments(); b2._MethodInvocation(); b2._ExpressionStatement(); b2.ExpressionStatement_(); b2.MethodInvocation_(); b2.SimpleName("simpleName"); b2.Types_(0); b2._Types(); b2.SimpleName("fname2"); b2.Arguments_(4); b2.SimpleName("arga"); b2.SimpleName("argb"); b2.SimpleName("arg0a"); b2.SimpleName("arg1a"); b2._Arguments(); b2._MethodInvocation(); b2._ExpressionStatement(); b2._Block(); b1._StageUpFragment(); b1.StageUpFragment_(); b2.Block_(2); b2.ExpressionStatement_(); b2.MethodInvocation_(); b2.SimpleName("simpleName"); b2.Types_(0); b2._Types(); b2.SimpleName("myfname2"); b2.Arguments_(3); b2.SimpleName("arg__"); b2.SimpleName("arg"); b2.SimpleName("argPlaceHolder"); b2._Arguments(); b2._MethodInvocation(); b2._ExpressionStatement(); b2.ExpressionStatement_(); b2.MethodInvocation_(); b2.SimpleName("simpleName"); b2.Types_(0); b2._Types(); b2.SimpleName("fname2"); b2.Arguments_(6); b2.SimpleName("arga"); b2.SimpleName("argb"); b2.SimpleName("arg0a"); b2.SimpleName("arg1a"); b2.SimpleName("arg0"); b2.SimpleName("arg1"); b2._Arguments(); b2._MethodInvocation(); b2._ExpressionStatement(); b2._Block(); b1._StageUpFragment(); b1.StageUpFragment_(); b2.Block_(2); b2.ExpressionStatement_(); b2.MethodInvocation_(); b2.SimpleName("simpleName"); b2.Types_(0); b2._Types(); b2.SimpleName("myfname2"); b2.Arguments_(3); b2.SimpleName("arg__"); b2.SimpleName("arg"); b2.SimpleName("argPlaceHolder"); b2._Arguments(); b2._MethodInvocation(); b2._ExpressionStatement(); b2.ExpressionStatement_(); b2.MethodInvocation_(); b2.SimpleName("simpleName"); b2.Types_(0); b2._Types(); b2.SimpleName("myqueryfname2"); b2.Arguments_(6); b2.SimpleName("arga"); b2.SimpleName("argb"); b2.SimpleName("arg0a"); b2.SimpleName("arg1a"); b2.SimpleName("arg0"); b2.SimpleName("arg1"); b2._Arguments(); b2._MethodInvocation(); b2._ExpressionStatement(); b2._Block(); b1._StageUpFragment(); b0._Misc(); } }; } }