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 annotation for any type that could be annotated
15 * For sake of simplicity the Annotation Type is not designed to model exact behaviour of annotation mechanism,
16 * but just to hold information needed to model annotation over java Type definition.
18 public interface AnnotationType extends Type {
20 * Returns the List of Annotations. Each Annotation Type MAY have defined multiple Annotations.
22 * @return the List of Annotations.
24 List<AnnotationType> getAnnotations();
27 * Returns Parameter Definition assigned for given parameter name. If Annotation does not contain parameter
28 * with specified param name, the method MAY return <code>null</code> value.
30 * @param paramName Parameter Name
31 * @return Parameter Definition assigned for given parameter name.
33 Parameter getParameter(String paramName);
36 * Returns List of all parameters assigned to Annotation Type.
38 * @return List of all parameters assigned to Annotation Type.
40 List<Parameter> getParameters();
43 * Returns List of parameter names.
45 * @return List of parameter names.
47 List<String> getParameterNames();
50 * Returns <code>true</code> if annotation contains parameters.
52 * @return <code>true</code> if annotation contains parameters.
54 boolean containsParameters();
57 * Annotation Type parameter interface. For simplicity the Parameter contains values and value types as Strings.
58 * Every annotation which contains parameters could contain either single parameter or array of parameters. To model
59 * this purposes the by contract if the parameter contains single parameter the {@link #getValues()} method will
60 * return empty List and {@link #getValue()} MUST always return non-<code>null</code> parameter. If the Parameter
61 * holds List of values the singular {@link #getValue()} parameter MAY return <code>null</code> value.
65 * Returns the Name of the parameter.
67 * @return the Name of the parameter.
72 * Returns value in String format if Parameter contains singular value, otherwise MAY return <code>null</code>.
74 * @return value in String format if Parameter contains singular value.
79 * Returns List of Parameter assigned values in order in which they were assigned for given parameter name.<br>
80 * If there are multiple values assigned for given parameter name the method MUST NOT return empty List.
82 * @return List of Parameter assigned values in order in which they were assigned for given parameter name.
84 List<String> getValues();