/** * Returns the package of the specified node. * @param node * @return the {@link JPackage} of a {@link JNode} or * <code>null</code> */ public JPackage getPackage(JNode node) { JCompilationUnit compilationUnit = getCompilationUnit(node); if (compilationUnit != null) { for (JNode child : compilationUnit.getChildren()) { if (child instanceof JPackage) { return (JPackage)child; } } } return null; }
/** * Returns the package of the specified node. * @param node * @return the {@link JPackage} of a {@link JNode} or * <code>null</code> */ public JPackage getPackage(JNode node) { JCompilationUnit compilationUnit = getCompilationUnit(node); if (compilationUnit != null) { for (JNode child : compilationUnit.getChildren()) { if (child instanceof JPackage) { return (JPackage)child; } } } return null; }
JCompilationUnit targetCompilationUnit = jMerger.getTargetCompilationUnit(); ImportManager importManager = getImportManager(); for (JNode node : targetCompilationUnit.getChildren())