2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.mdsal.binding.model.api;
10 import java.util.List;
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.
19 public interface AnnotationType extends Type {
22 * Returns the List of Annotations. <br>
23 * Each Annotation Type MAY have defined multiple Annotations.
25 * @return the List of Annotations.
27 List<AnnotationType> getAnnotations();
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.
36 * @return Parameter Definition assigned for given parameter name.
38 Parameter getParameter(final String paramName);
41 * Returns List of all parameters assigned to Annotation Type.
43 * @return List of all parameters assigned to Annotation Type.
45 List<Parameter> getParameters();
48 * Returns List of parameter names.
50 * @return List of parameter names.
52 List<String> getParameterNames();
55 * Returns <code>true</code> if annotation contains parameters.
57 * @return <code>true</code> if annotation contains parameters.
59 boolean containsParameters();
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>
75 * Returns the Name of the parameter.
77 * @return the Name of the parameter.
82 * Returns value in String format if Parameter contains singular value,
83 * otherwise MAY return <code>null</code>.
85 * @return value in String format if Parameter contains singular value.
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.
95 * @return List of Parameter assigned values in order in which they were
96 * assigned for given parameter name.
98 List<String> getValues();