Example usage for org.aspectj.org.eclipse.jdt.core.dom AfterReturningAdviceDeclaration returningRETURNING_PROPERTY

List of usage examples for org.aspectj.org.eclipse.jdt.core.dom AfterReturningAdviceDeclaration returningRETURNING_PROPERTY

Introduction

In this page you can find the example usage for org.aspectj.org.eclipse.jdt.core.dom AfterReturningAdviceDeclaration returningRETURNING_PROPERTY.

Prototype

ChildPropertyDescriptor returningRETURNING_PROPERTY

To view the source code for org.aspectj.org.eclipse.jdt.core.dom AfterReturningAdviceDeclaration returningRETURNING_PROPERTY.

Click Source Link

Usage

From source file:org.eclipse.ajdt.core.dom.rewrite.AjASTRewriteAnalyzer.java

License:Open Source License

public boolean visit(AfterReturningAdviceDeclaration node) {
    // ajh02: method added
    if (!hasChildrenChanges(node)) {
        return doVisitUnchangedChildren(node);
    }/*  w  ww.  j  a  v a  2  s .  c o  m*/
    int pos = rewriteJavadoc(node, AfterReturningAdviceDeclaration.returningJAVADOC_PROPERTY);
    // pointcut
    pos = rewriteRequiredNode(node, AfterReturningAdviceDeclaration.returningPOINTCUT_PROPERTY);
    // parameters
    try {
        if (isChanged(node, AfterReturningAdviceDeclaration.returningPARAMETERS_PROPERTY)) {
            pos = getScanner().getTokenEndOffset(ITerminalSymbols.TokenNameLPAREN, pos);
            pos = rewriteNodeList(node, AfterReturningAdviceDeclaration.returningPARAMETERS_PROPERTY, pos, "", //$NON-NLS-1$
                    ", "); //$NON-NLS-1$
        } else {
            pos = doVisit(node, AfterReturningAdviceDeclaration.returningPARAMETERS_PROPERTY, pos);
        }
        pos = getScanner().getTokenEndOffset(ITerminalSymbols.TokenNameRPAREN, pos);
        if (node.getReturning() != null) {
            pos = rewriteRequiredNode(node, AfterReturningAdviceDeclaration.returningRETURNING_PROPERTY);
        }

        pos = rewriteNodeList(node, AfterReturningAdviceDeclaration.returningTHROWN_EXCEPTIONS_PROPERTY, pos,
                " throws ", ", "); //$NON-NLS-1$ //$NON-NLS-2$
        rewriteAdviceBody(node, pos);
    } catch (CoreException e) {
        // ignore
    }
    return false;
}