/** * Utility methods wich returns the list of classifiers that are directly or indirectly owned by a * context namespace * * @param context The context namespace * @return the list of classifiers that are directly or indirectly owned by the context namespace */ private List<Classifier> getRecursivelyOwnedClassifiers(Namespace context) { List<Classifier> recursivelyOwnedClassifiers = new ArrayList<Classifier>(); List<Element> allOwnedElements = context.getOwnedElements(); for (Element e : allOwnedElements) { if (e instanceof Classifier) { recursivelyOwnedClassifiers.add((Classifier) e); } if (e instanceof Namespace) { recursivelyOwnedClassifiers.addAll(getRecursivelyOwnedClassifiers((Namespace) e)); } } return recursivelyOwnedClassifiers; }