Search in sources :

Example 1 with Replacer

use of il.org.spartan.Leonidas.plugin.leonidas.Replacer in project Main by SpartanRefactoring.

the class Method method create.

@Override
public GenericEncapsulator create(Encapsulator e, Map<Integer, List<Matcher.Constraint>> map) {
    Method m = new Method(e);
    Encapsulator returnType = Pruning.prune(Encapsulator.buildTreeFromPsi(az.method(e.getInner()).getReturnTypeElement()), map);
    Encapsulator parameters = Pruning.prune(Encapsulator.buildTreeFromPsi(az.method(e.getInner()).getParameterList()), map);
    Encapsulator codeBlock = Pruning.prune(Encapsulator.buildTreeFromPsi(az.method(e.getInner()).getBody()), map);
    m.matcherReturnType = new Matcher(Utils.wrapWithList(returnType), map);
    m.matcherParameters = new Matcher(Utils.wrapWithList(parameters), map);
    m.matcherCodeBlock = new Matcher(Utils.wrapWithList(codeBlock), map);
    m.replacerReturnType = new Replacer(Utils.wrapWithList(returnType));
    m.replacerParameters = new Replacer(Utils.wrapWithList(parameters));
    m.replacerCodeBlock = new Replacer(Utils.wrapWithList(codeBlock));
    return m;
}
Also used : Matcher(il.org.spartan.Leonidas.plugin.leonidas.Matcher) Replacer(il.org.spartan.Leonidas.plugin.leonidas.Replacer) PsiMethod(com.intellij.psi.PsiMethod)

Aggregations

PsiMethod (com.intellij.psi.PsiMethod)1 Matcher (il.org.spartan.Leonidas.plugin.leonidas.Matcher)1 Replacer (il.org.spartan.Leonidas.plugin.leonidas.Replacer)1