Java Aspectj Usage getPackagesHelper(IProgramElement node, IProgramElement.Kind kind, String prename, List matches)

Here you can find the source of getPackagesHelper(IProgramElement node, IProgramElement.Kind kind, String prename, List matches)

Description

get Packages Helper

License

Open Source License

Declaration

private static List getPackagesHelper(IProgramElement node, IProgramElement.Kind kind, String prename,
            List matches) 

Method Source Code

//package com.java2s;
/* *******************************************************************
 * Copyright (c) 1999-2001 Xerox Corporation, 
 *               2002 Palo Alto Research Center, Incorporated (PARC).
 * All rights reserved. /*from  w w  w .j av a2 s .com*/
 * This program and the accompanying materials are made available 
 * under the terms of the Eclipse Public License v1.0 
 * which accompanies this distribution and is available at 
 * http://www.eclipse.org/legal/epl-v10.html 
 *  
 * Contributors: 
 *     Xerox/PARC     initial implementation 
 * ******************************************************************/

import java.util.Iterator;
import java.util.List;

import org.aspectj.asm.IProgramElement;

public class Main {
    private static List getPackagesHelper(IProgramElement node, IProgramElement.Kind kind, String prename,
            List matches) {

        if (kind == null || node.getKind().equals(kind)) {
            if (prename == null) {
                prename = new String(node.toString());
            } else {
                prename = new String(prename + "." + node);
            }
            Object[] o = new Object[2];
            o[0] = node;
            o[1] = prename;

            matches.add(o);
        }

        for (Iterator it = node.getChildren().iterator(); it.hasNext();) {
            IProgramElement nextNode = (IProgramElement) it.next();
            getPackagesHelper(nextNode, kind, prename, matches);
        }

        return matches;
    }
}

Related

  1. getArgsMap(JoinPoint pjp)
  2. getFieldName(JoinPoint jp)
  3. getFilesInPackage(IProgramElement packageNode)
  4. getMethodArgByIndex(final JoinPoint joinPoint, final int index)
  5. getMethodName(ProceedingJoinPoint pjp)
  6. getPackagesInModel(AsmManager modl)
  7. getSignature(Signature signature, String nameFromAnnotation, boolean absolute)
  8. getSourceLine(InstructionHandle ih)
  9. getTargetClass(JoinPoint jp)