KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > ecore > xmi > XMIPlugin


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: XMIPlugin.java,v 1.4 2005/06/08 06:16:07 nickb Exp $
16  */

17 package org.eclipse.emf.ecore.xmi;
18
19
20 import org.eclipse.emf.common.EMFPlugin;
21 import org.eclipse.emf.common.util.ResourceLocator;
22
23
24 /**
25  * The <b>Plugin</b> for the EMF.Ecore.XMI library.
26  */

27 public final class XMIPlugin extends EMFPlugin
28 {
29   /**
30    * The singleton instance of the plugin.
31    */

32   public static final XMIPlugin INSTANCE = new XMIPlugin();
33
34   /**
35    * The one instance of this class.
36    */

37   private static Implementation plugin;
38
39   /**
40    * Creates the singleton instance.
41    */

42   private XMIPlugin()
43   {
44     super(new ResourceLocator[] {});
45   }
46
47   /*
48    * Javadoc copied from base class.
49    */

50   public ResourceLocator getPluginResourceLocator()
51   {
52     return plugin;
53   }
54
55   /**
56    * Returns the singleton instance of the Eclipse plugin.
57    * @return the singleton instance.
58    */

59   public static Implementation getPlugin()
60   {
61     return plugin;
62   }
63
64   /**
65    * The actual implementation of the Eclipse <b>Plugin</b>.
66    */

67   public static class Implementation extends EclipsePlugin
68   {
69     /**
70      * Creates an instance.
71      */

72     public Implementation()
73     {
74       super();
75
76       // Remember the static instance.
77
//
78
plugin = this;
79     }
80   }
81 }
82
Popular Tags