/** * * @return EJBResource from (@link getDeploymentDescriptorResource()) * */ public EJBResource getEJBJarXmiResource() { verifyOperationSupported(); return (EJBResource) getDeploymentDescriptorResource(); }
public EObject createModelRoot(int version) { verifyOperationSupported(); if (isBinary()) { throwAttemptedBinaryEditModelAccess(); } EJBResource res = (EJBResource) getDeploymentDescriptorResource(); res.setModuleVersionID(version); addEJBJarIfNecessary(res); return ((EJBResource) getDeploymentDescriptorResource()).getRootObject(); }
/** * <p> * Obtains the EJBJar (@see EJBJar) root object from the EJBResource. If the root object does * not exist, then one is created (@link addEJBJarIfNecessary(getEJBJarXmiResource())). The root * object contains all other resource defined objects. * </p> * * @return EObject * */ public EObject getDeploymentDescriptorRoot() { verifyOperationSupported(); Resource res = getDeploymentDescriptorResource(); List contents = res.getContents(); if (contents.size() > 0) return (EObject) contents.get(0); if (isBinary()) { return null; } if (!WorkbenchResourceHelper.getFile(res).exists()) return null; addEJBJarIfNecessary((EJBResource) getDeploymentDescriptorResource()); return (EObject) contents.get(0); }