| //------------------------------------------------------------------------------ |
| // Copyright (c) 2005, 2006 IBM Corporation and others. |
| // All rights reserved. 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: |
| // IBM Corporation - initial implementation |
| //------------------------------------------------------------------------------ |
| package org.eclipse.epf.persistence; |
| |
| import java.util.List; |
| |
| import org.eclipse.emf.ecore.resource.Resource; |
| import org.eclipse.epf.services.IFileBasedLibraryPersister; |
| import org.eclipse.epf.uma.MethodElement; |
| |
| /** |
| * @author Phong Nguyen Le - Oct 10, 2006 |
| * @since 1.0 |
| */ |
| public class XMILibraryPersister implements IFileBasedLibraryPersister { |
| |
| /** |
| * Contructs a new XMILibraryPersister instance. |
| */ |
| public XMILibraryPersister() { |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.epf.uma.util.IFileBasedLibraryPersister#getFileExtension(java.lang.Object) |
| */ |
| public String getFileExtension(Object e) { |
| return MethodLibraryPersister.INSTANCE.getFileExtension(e); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.epf.uma.util.IFileBasedLibraryPersister#getFolderRelativePath(org.eclipse.epf.uma.MethodElement) |
| */ |
| public String getFolderRelativePath(MethodElement e) { |
| return MethodLibraryPersister.INSTANCE.getFolderRelativePath(e); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.epf.uma.util.IFileBasedLibraryPersister#hasOwnFolder(java.lang.Object) |
| */ |
| public boolean hasOwnFolder(Object e) { |
| return MethodLibraryPersister.INSTANCE.hasOwnFolder(e); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.epf.uma.util.ILibraryPersister#adjustLocation(org.eclipse.emf.ecore.resource.Resource) |
| */ |
| public void adjustLocation(Resource resource) { |
| MethodLibraryPersister.INSTANCE.adjustLocation(resource); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.epf.uma.util.ILibraryPersister#delete(org.eclipse.epf.uma.MethodElement) |
| */ |
| public void delete(MethodElement e) { |
| MethodLibraryPersister.INSTANCE.delete(e); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.epf.uma.util.ILibraryPersister#getFailSafePersister() |
| */ |
| public FailSafeMethodLibraryPersister getFailSafePersister() { |
| return MethodLibraryPersister.INSTANCE.getFailSafePersister(); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.epf.uma.util.ILibraryPersister#getWarnings() |
| */ |
| public List getWarnings() { |
| return MethodLibraryPersister.INSTANCE.getWarnings(); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.epf.uma.util.ILibraryPersister#hasOwnResource(java.lang.Object) |
| */ |
| public boolean hasOwnResource(Object e) { |
| return MethodLibraryPersister.INSTANCE.hasOwnResource(e); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.epf.uma.util.ILibraryPersister#hasOwnResourceWithoutReferrer(java.lang.Object) |
| */ |
| public boolean hasOwnResourceWithoutReferrer(Object e) { |
| return MethodLibraryPersister.INSTANCE.hasOwnResourceWithoutReferrer(e); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.epf.uma.util.ILibraryPersister#save(org.eclipse.emf.ecore.resource.Resource) |
| */ |
| public void save(Resource resource) throws Exception { |
| MethodLibraryPersister.INSTANCE.save(resource); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.epf.uma.util.ILibraryPersister#save(org.eclipse.epf.uma.MethodElement) |
| */ |
| public void save(MethodElement element) throws Exception { |
| MethodLibraryPersister.INSTANCE.save(element); |
| } |
| |
| } |