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.controller.sal.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.
16 * For sake of simplicity the Annotation Type is not designed to model exact
17 * behaviour of annotation mechanism, but just to hold information needed to
18 * model annotation over java Type definition.
20 public interface AnnotationType extends Type {
23 * Returns the List of Annotations.
25 * Each Annotation Type MAY have defined multiple Annotations.
27 * @return the List of Annotations.
29 public List<AnnotationType> getAnnotations();
32 * Returns Parameter Definition assigned for given parameter name.
34 * If Annotation does not contain parameter with specified param name,
35 * the method MAY return <code>null</code> value.
37 * @param paramName Parameter Name
38 * @return Parameter Definition assigned for given parameter name.
40 public Parameter getParameter(final String paramName);
43 * Returns List of all parameters assigned to Annotation Type.
45 * @return List of all parameters assigned to Annotation Type.
47 public List<Parameter> getParameters();
50 * Returns List of parameter names.
52 * @return List of parameter names.
54 public List<String> getParameterNames();
57 * Returns <code>true</code> if annotation contains parameters.
59 * @return <code>true</code> if annotation contains parameters.
61 public boolean containsParameters();
64 * Annotation Type parameter interface. For simplicity the Parameter
65 * contains values and value types as Strings. Every annotation which
66 * contains parameters could contain either single parameter or array of
67 * parameters. To model this purposes the by contract if the parameter
68 * contains single parameter the {@link #getValues()} method will return
69 * empty List and {@link #getValue()} MUST always return non-<code>null</code>
70 * parameter. If the Parameter holds List of values the singular {@link
71 * #getValue()} parameter MAY return <code>null</code> value.
76 * Returns the Name of the parameter.
78 * @return the Name of the parameter.
80 public String getName();
83 * Returns value in String format if Parameter contains singular value,
84 * otherwise MAY return <code>null</code>.
86 * @return value in String format if Parameter contains singular value.
88 public String getValue();
91 * Returns List of Parameter assigned values in order in which they
92 * were assigned for given parameter name.
94 * If there are multiple values assigned for given parameter name the
95 * method MUST NOT return empty List.
97 * @return List of Parameter assigned values in order in which they
98 * were assigned for given parameter name.
100 public List<String> getValues();