public void visitCtThrow(final spoon.reflect.code.CtThrow throwStatement) { spoon.reflect.code.CtThrow aCtThrow = throwStatement.getFactory().Core().createThrow(); this.builder.copy(throwStatement, aCtThrow); aCtThrow.setAnnotations(this.cloneHelper.clone(throwStatement.getAnnotations())); aCtThrow.setThrownExpression(this.cloneHelper.clone(throwStatement.getThrownExpression())); aCtThrow.setComments(this.cloneHelper.clone(throwStatement.getComments())); this.cloneHelper.tailor(throwStatement, aCtThrow); this.other = aCtThrow; }
@Override public CtThrow createThrow() { CtThrow e = new CtThrowImpl(); e.setFactory(getMainFactory()); return e; }
@Override public void visitCtThrow(CtThrow throwStatement) { if (throwStatement.getThrownExpression() == null && child instanceof CtExpression) { throwStatement.setThrownExpression((CtExpression<? extends Throwable>) child); return; } super.visitCtThrow(throwStatement); }
public void visitCtThrow(final spoon.reflect.code.CtThrow throwStatement) { spoon.reflect.code.CtThrow other = ((spoon.reflect.code.CtThrow) (this.stack.peek())); enter(throwStatement); biScan(spoon.reflect.path.CtRole.ANNOTATION, throwStatement.getAnnotations(), other.getAnnotations()); biScan(spoon.reflect.path.CtRole.EXPRESSION, throwStatement.getThrownExpression(), other.getThrownExpression()); biScan(spoon.reflect.path.CtRole.COMMENT, throwStatement.getComments(), other.getComments()); exit(throwStatement); }
@Override public void visitCtThrow(CtThrow throwStatement) { CtThrow r = throwStatement.getFactory().Core().createThrow(); r.setThrownExpression(evaluate(throwStatement.getThrownExpression())); setResult(r); flowEnded = true; }
@SuppressWarnings("unchecked") @Override public <T, U> U getValue(T element) { return ((U) ((Object) (castTarget(element).getThrownExpression()))); }
@java.lang.Override public void set(spoon.reflect.code.CtExpression replace) { this.element.setThrownExpression(replace); } }
public void visitCtThrow(CtThrow throwStatement) { enter(throwStatement); scan(throwStatement.getAnnotations()); scan(throwStatement.getThrownExpression()); exit(throwStatement); }
public void visitCtThrow(CtThrow throwStatement) { CtThrow r = throwStatement.getFactory().Core().createThrow(); r.setThrownExpression(evaluate(r, throwStatement.getThrownExpression())); setResult(r); flowEnded = true; }
public void visitCtThrow(final CtThrow throwStatement) { enter(throwStatement); scan(CtRole.ANNOTATION, throwStatement.getAnnotations()); scan(CtRole.EXPRESSION, throwStatement.getThrownExpression()); scan(CtRole.COMMENT, throwStatement.getComments()); exit(throwStatement); }
@Override public void visitCtThrow(CtThrow throwStatement) { if (throwStatement.getThrownExpression() == null) { throwStatement.setThrownExpression((CtExpression<? extends Throwable>) child); return; } super.visitCtThrow(throwStatement); }
@Override public void visitCtThrow(CtThrow throwStatement) { enterCtStatement(throwStatement); printer.writeKeyword("throw").writeSpace(); scan(throwStatement.getThrownExpression()); exitCtStatement(throwStatement); }
@Override public <T, U> void setValue(T element, U value) { castTarget(element).setThrownExpression(castValue(value)); } }
@java.lang.Override public void visitCtThrow(final spoon.reflect.code.CtThrow throwStatement) { replaceInListIfExist(throwStatement.getAnnotations(), new spoon.support.visitor.replace.ReplacementVisitor.CtElementAnnotationsReplaceListener(throwStatement)); replaceElementIfExist(throwStatement.getThrownExpression(), new spoon.support.visitor.replace.ReplacementVisitor.CtThrowThrownExpressionReplaceListener(throwStatement)); replaceInListIfExist(throwStatement.getComments(), new spoon.support.visitor.replace.ReplacementVisitor.CtElementCommentsReplaceListener(throwStatement)); }
public void visitCtThrow(CtThrow throwStatement) { write("throw "); scan(throwStatement.getThrownExpression()); }
/** * Creates a throw. * * @param thrownExp * Expression of the throw. * @return a throw. */ public CtThrow createCtThrow(String thrownExp) { return factory.Core().createThrow().setThrownExpression(this.<Throwable>createCodeSnippetExpression(thrownExp)); }
public CtThrow createThrow() { CtThrow e = new CtThrowImpl(); e.setFactory(getMainFactory()); return e; }
public void visitCtThrow(CtThrow throwStatement) { enterCtStatement(throwStatement); write("throw "); scan(throwStatement.getThrownExpression()); }
public static <E extends Throwable> CtThrow newThrow(Factory factory, CtExpression<E> thrownExpression) { CtThrow aThrow = factory.Core().createThrow(); aThrow.setThrownExpression(thrownExpression); return aThrow; }
@Override public void process(CtStatement element) { if (element instanceof CtIf) { add(((CtIf) element).getCondition()); } else if (element instanceof CtFor) { add(((CtFor) element).getExpression()); } else if (element instanceof CtWhile) { add(((CtWhile) element).getLoopingExpression()); } else if (element instanceof CtDo) { add(((CtDo) element).getLoopingExpression()); } else if (element instanceof CtThrow) { add(((CtThrow) element).getThrownExpression()); } else if (element instanceof CtInvocation && (element.getParent() instanceof CtBlock)) { add(element); } else if (element instanceof CtAssignment || element instanceof CtConstructorCall || element instanceof CtCFlowBreak || element instanceof CtLocalVariable) { add(element); } }