1 /*
2 * #%L
3 * EUGene :: EUGene
4 * %%
5 * Copyright (C) 2004 - 2010 CodeLutin
6 * %%
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Lesser Public License for more details.
16 *
17 * You should have received a copy of the GNU General Lesser Public
18 * License along with this program. If not, see
19 * <http://www.gnu.org/licenses/lgpl-3.0.html>.
20 * #L%
21 */
22
23
24 package org.nuiton.eugene.models.object;
25
26 import org.nuiton.eugene.models.Model;
27
28 import java.util.Collection;
29 import java.util.List;
30
31 /**
32 * Abstraction for the root node of object model trees.
33 * This an entry point for browsing a model tree. This object offers
34 * as well several facilities for a direct access to some of the object model elements.
35 *
36 * Created: 14 janv. 2004
37 *
38 * @author Cédric Pineau - pineau@codelutin.com
39 */
40 public interface ObjectModel extends Model {
41
42 /**
43 * Plexus role-hint
44 */
45 String NAME = "objectmodel";
46
47 /**
48 * Returns all packages defined in this model.
49 *
50 * @return a Collection containing all ObjectModelPackage for this model.
51 * @see ObjectModelPackage
52 * @since 2.12
53 */
54 Collection<ObjectModelPackage> getPackages();
55
56 /**
57 * Returns the package corresponding to the given name, or null if the model contains no package for this name.
58 *
59 * @param qualifiedClassifierName - the name of the package to retrieve.
60 * @return the ObjectModelPackage of the found given name, or null if the model contains no package for this name.
61 * @since 2.12
62 */
63 ObjectModelPackage getPackage(String qualifiedClassifierName);
64
65 /**
66 * Returns the package of the given classifier, or null if the model contains no package for this classifier.
67 *
68 * @param classifier the classifier of the package to retrieve.
69 * @return the ObjectModelPackage for the given classifier, or null if the model contains no package for this classifier.
70 * @since 2.12
71 */
72 ObjectModelPackage getPackage(ObjectModelClassifier classifier);
73
74 /**
75 * Indicates whether the model contains the package associated to the given name
76 *
77 * @param name - the name of the package to retrieve.
78 * @return true if the package has been found.
79 * @since 2.12
80 */
81 boolean hasPackage(String name);
82
83 /**
84 * Returns all classifiers defined in this model. (Except innerClasses)
85 *
86 * @return a Collection containing all ObjectModelClassifier for this model.
87 * @see ObjectModelClassifier
88 */
89 Collection<ObjectModelClassifier> getClassifiers();
90
91 /**
92 * Returns the classifier corresponding to the given qualified name, or null if the model contains no classifier for this qualified name.
93 *
94 * @param qualifiedClassifierName - the qualified name of the classifier to retrieve.
95 * @return the ObjectModelClassifier of the found classifier, or null if the model contains no classifier for this qualified name.
96 */
97 ObjectModelClassifier getClassifier(String qualifiedClassifierName);
98
99 /**
100 * Returns all classes defined in this model. (Except innerClasses)
101 *
102 * @return a Collection containing all ObjectModelClass for this model.
103 * @see ObjectModelClass
104 */
105 Collection<ObjectModelClass> getClasses();
106
107 /**
108 * Returns the class corresponding to the given qualified name, or null if the model contains no class for this qualified name.
109 *
110 * @param qualifiedClassName - the qualified name of the class to retrieve.
111 * @return the ObjectModelClass of the found class, or null if the model contains no class for this qualified name.
112 */
113 ObjectModelClass getClass(String qualifiedClassName);
114
115
116 /**
117 * Indicates whether the model contains the class associated to the given className
118 *
119 * @param qualifiedClassName - the qualified name of the class to retrieve.
120 * @return true if the class has been found.
121 */
122 boolean hasClass(String qualifiedClassName);
123
124 /**
125 * Returns all interfaces defined in this model.
126 *
127 * @return a Collection containing all ObjectModelInterface for this model.
128 * @see ObjectModelInterface
129 */
130 Collection<ObjectModelInterface> getInterfaces();
131
132 /**
133 * Returns the interface corresponding to the given qualified name, or null if the model contains no interface for this qualified name.
134 *
135 * @param qualifiedInterfaceName the qualified name of the interface to retrieve.
136 * @return the ObjectModelInterface of the found interface, or null if the model contains no interface for this qualified name.
137 */
138 ObjectModelInterface getInterface(String qualifiedInterfaceName);
139
140
141 /**
142 * Returns all enumerations defined in this model.
143 *
144 * @return a Collection containing all ObjectModelEnumeration for this model.
145 * @see ObjectModelEnumeration
146 */
147 Collection<ObjectModelEnumeration> getEnumerations();
148
149 /**
150 * Return the enumeration corresponding to the given qualified name
151 *
152 * @param qualifiedEnumerationName the fully qualified name of the enumeration to retrieve.
153 * @return the ObjectModelEnumeration of the found enumeration or null if the model contains no enumeration for this qualified name.
154 */
155 ObjectModelEnumeration getEnumeration(String qualifiedEnumerationName);
156
157 /**
158 * Returns all comments not lied to a particular model element
159 *
160 * @return a List containing all comments for this model as Strings.
161 */
162 List<String> getComments();
163
164 // /**
165 // * Get the extension associated to the reference (unique)
166 // * @param <O> object type returned
167 // * @param reference unique corresponding to the extension to get
168 // * @param extensionClass class of the extension
169 // * @return the object value for the extension
170 // * @throws ClassCastException when extensionClass is not valid
171 // * @throws IllegalArgumentException for non existing extension with reference
172 // */
173 // <O> O getExtension(String reference, Class<O> extensionClass)
174 // throws ClassCastException, IllegalArgumentException;
175
176 } //ObjectModel