Introduce top-level pom file.
[mdsal.git] / code-generator / binding-model-api / src / main / java / org / opendaylight / yangtools / sal / binding / model / api / AnnotationType.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.sal.binding.model.api;
9
10 import java.util.List;
11
12 /**
13  * The Annotation Type interface is designed to hold information about
14  * annotation for any type that could be annotated in Java. <br>
15  * For sake of simplicity the Annotation Type is not designed to model exact
16  * behaviour of annotation mechanism, but just to hold information needed to
17  * model annotation over java Type definition.
18  */
19 public interface AnnotationType extends Type {
20
21     /**
22      * Returns the List of Annotations. <br>
23      * Each Annotation Type MAY have defined multiple Annotations.
24      * 
25      * @return the List of Annotations.
26      */
27     List<AnnotationType> getAnnotations();
28
29     /**
30      * Returns Parameter Definition assigned for given parameter name. <br>
31      * If Annotation does not contain parameter with specified param name, the
32      * method MAY return <code>null</code> value.
33      * 
34      * @param paramName
35      *            Parameter Name
36      * @return Parameter Definition assigned for given parameter name.
37      */
38     Parameter getParameter(final String paramName);
39
40     /**
41      * Returns List of all parameters assigned to Annotation Type.
42      * 
43      * @return List of all parameters assigned to Annotation Type.
44      */
45     List<Parameter> getParameters();
46
47     /**
48      * Returns List of parameter names.
49      * 
50      * @return List of parameter names.
51      */
52     List<String> getParameterNames();
53
54     /**
55      * Returns <code>true</code> if annotation contains parameters.
56      * 
57      * @return <code>true</code> if annotation contains parameters.
58      */
59     boolean containsParameters();
60
61     /**
62      * Annotation Type parameter interface. For simplicity the Parameter
63      * contains values and value types as Strings. Every annotation which
64      * contains parameters could contain either single parameter or array of
65      * parameters. To model this purposes the by contract if the parameter
66      * contains single parameter the {@link #getValues()} method will return
67      * empty List and {@link #getValue()} MUST always return non-
68      * <code>null</code> parameter. If the Parameter holds List of values the
69      * singular {@link #getValue()} parameter MAY return <code>null</code>
70      * value.
71      */
72     interface Parameter {
73
74         /**
75          * Returns the Name of the parameter.
76          * 
77          * @return the Name of the parameter.
78          */
79         String getName();
80
81         /**
82          * Returns value in String format if Parameter contains singular value,
83          * otherwise MAY return <code>null</code>.
84          * 
85          * @return value in String format if Parameter contains singular value.
86          */
87         String getValue();
88
89         /**
90          * Returns List of Parameter assigned values in order in which they were
91          * assigned for given parameter name. <br>
92          * If there are multiple values assigned for given parameter name the
93          * method MUST NOT return empty List.
94          * 
95          * @return List of Parameter assigned values in order in which they were
96          *         assigned for given parameter name.
97          */
98         List<String> getValues();
99     }
100 }