Java Aspectj Usage getFilesInPackage(IProgramElement packageNode)

Here you can find the source of getFilesInPackage(IProgramElement packageNode)

Description

get Files In Package

License

Open Source License

Return

all of the AspectJ and Java source files in a package

Declaration

public static List getFilesInPackage(IProgramElement packageNode) 

Method Source Code


//package com.java2s;
/* *******************************************************************
 * Copyright (c) 1999-2001 Xerox Corporation, 
 *               2002 Palo Alto Research Center, Incorporated (PARC).
 * All rights reserved. /* w  w  w .j a va2  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.ArrayList;

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

import org.aspectj.asm.IProgramElement;

public class Main {
    /**
     * @return all of the AspectJ and Java source files in a package
     */
    public static List getFilesInPackage(IProgramElement packageNode) {
        List packageContents;
        if (packageNode == null) {
            return null;
        } else {
            packageContents = packageNode.getChildren();
        }
        List files = new ArrayList();
        for (Iterator it = packageContents.iterator(); it.hasNext();) {
            IProgramElement packageItem = (IProgramElement) it.next();
            if (packageItem.getKind() == IProgramElement.Kind.FILE_JAVA
                    || packageItem.getKind() == IProgramElement.Kind.FILE_ASPECTJ) {
                files.add(packageItem);
            }
        }
        return files;
    }
}

Related

  1. createInstanceof(InstructionFactory fact, ReferenceType t)
  2. genPointcutDetails(Pointcut pcd)
  3. genSignature(IProgramElement node)
  4. getArgsMap(JoinPoint pjp)
  5. getFieldName(JoinPoint jp)
  6. getMethodArgByIndex(final JoinPoint joinPoint, final int index)
  7. getMethodName(ProceedingJoinPoint pjp)
  8. getPackagesHelper(IProgramElement node, IProgramElement.Kind kind, String prename, List matches)
  9. getPackagesInModel(AsmManager modl)