View Javadoc
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;
25  
26  import org.nuiton.eugene.models.extension.tagvalue.WithTagValuesOrStereotypes;
27  
28  /**
29   * Model.
30   */
31  public interface Model extends WithTagValuesOrStereotypes {
32  
33      /**
34       * Plexus role name
35       */
36      String ROLE_NAME = Model.class.getName();
37  
38      /**
39       * Returns the name of this model.
40       *
41       * @return the name of this model.
42       */
43      String getName();
44  
45      /**
46       * Returns the version of this model.
47       *
48       * @return the version of this model.
49       */
50      String getVersion();
51  
52      /**
53       * @return the type of model.
54       * @since 2.6.3
55       */
56      String getModelType();
57  
58      /**
59       * Get the extension associated to the reference (unique)
60       *
61       * @param <O>            object type returned
62       * @param reference      unique corresponding to the extension to get
63       * @param extensionClass class of the extension
64       * @return the object value for the extension
65       * @throws ClassCastException       when extensionClass is not valid
66       * @throws IllegalArgumentException for non existing extension with reference
67       */
68      <O> O getExtension(String reference, Class<O> extensionClass) throws ClassCastException, IllegalArgumentException;
69  
70  } //Model