KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > core > BaseFeatureFactory


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.update.core;
12
13 import java.net.URL JavaDoc;
14
15 import org.eclipse.core.runtime.CoreException;
16 import org.eclipse.core.runtime.IProgressMonitor;
17 import org.eclipse.update.core.model.FeatureModel;
18 import org.eclipse.update.core.model.FeatureModelFactory;
19 import org.eclipse.update.core.model.ImportModel;
20 import org.eclipse.update.core.model.IncludedFeatureReferenceModel;
21 import org.eclipse.update.core.model.InstallHandlerEntryModel;
22 import org.eclipse.update.core.model.NonPluginEntryModel;
23 import org.eclipse.update.core.model.PluginEntryModel;
24 import org.eclipse.update.core.model.URLEntryModel;
25
26 /**
27  * Base implementation of a feature factory.
28  * The factory is responsible for constructing the correct
29  * concrete implementation of the model objects for each particular
30  * feature type. This class creates model objects that correspond
31  * to the concrete implementation classes provided in this package.
32  * The actual feature creation method is subclass responsibility.
33  * <p>
34  * This class must be subclassed by clients.
35  * </p>
36  * <p>
37  * <b>Note:</b> This class/interface is part of an interim API that is still under development and expected to
38  * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
39  * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
40  * (repeatedly) as the API evolves.
41  * </p>
42  * @see org.eclipse.update.core.IFeatureFactory
43  * @see org.eclipse.update.core.model.FeatureModelFactory
44  * @since 2.0
45  */

46 public abstract class BaseFeatureFactory extends FeatureModelFactory implements IFeatureFactory {
47
48     /**
49      *
50      * @deprecated implement createFeature(URL, ISite, IProgressMonitor) instead
51      * @see IFeatureFactory#createFeature(URL,ISite)
52      * @since 2.0
53      */

54     public IFeature createFeature(URL JavaDoc url, ISite site) throws CoreException {
55         return createFeature(url, site, null);
56     }
57
58     /**
59      * Create feature. Implementation of this method must be provided by
60      * subclass
61      *
62      * @see IFeatureFactory#createFeature(URL,ISite,IProgressMonitor)
63      * @since 2.0
64      */

65     public abstract IFeature createFeature(URL JavaDoc url, ISite site, IProgressMonitor monitor) throws CoreException;
66
67     /**
68      * Create a concrete implementation of feature model.
69      *
70      * @see Feature
71      * @return feature model
72      * @since 2.0
73      */

74     public FeatureModel createFeatureModel() {
75         return new Feature();
76     }
77
78     /**
79      * Create a concrete implementation of included feature reference model.
80      *
81      * @see IncludedFeatureReference
82      * @return feature model
83      * @since 2.1
84      */

85     public IncludedFeatureReferenceModel createIncludedFeatureReferenceModel() {
86         return new IncludedFeatureReference();
87     }
88
89     /**
90      * Create a concrete implementation of install handler model.
91      *
92      * @see InstallHandlerEntry
93      * @return install handler entry model
94      * @since 2.0
95      */

96     public InstallHandlerEntryModel createInstallHandlerEntryModel() {
97         return new InstallHandlerEntry();
98     }
99
100     /**
101      * Create a concrete implementation of import dependency model.
102      *
103      * @see Import
104      * @return import dependency model
105      * @since 2.0
106      */

107     public ImportModel createImportModel() {
108         return new Import();
109     }
110
111     /**
112      * Create a concrete implementation of plug-in entry model.
113      *
114      * @see PluginEntry
115      * @return plug-in entry model
116      * @since 2.0
117      */

118     public PluginEntryModel createPluginEntryModel() {
119         return new PluginEntry();
120     }
121
122     /**
123      * Create a concrete implementation of non-plug-in entry model.
124      *
125      * @see NonPluginEntry
126      * @return non-plug-in entry model
127      * @since 2.0
128      */

129     public NonPluginEntryModel createNonPluginEntryModel() {
130         return new NonPluginEntry();
131     }
132
133     /**
134      * Create a concrete implementation of annotated URL model.
135      *
136      * @see URLEntry
137      * @return annotated URL model
138      * @since 2.0
139      */

140     public URLEntryModel createURLEntryModel() {
141         return new URLEntry();
142     }
143 }
144
Popular Tags