X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fyang-prototype%2Fcode-generator%2Fbinding-model-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fmodel%2Fapi%2FAnnotationType.java;h=eec0339d0f17f32bfb03308b599fc7635614e02d;hp=7868675b1e6a40a21d6e14964a0ed218562a8a49;hb=f607c4b0b922281f1ddd5fda2e7b49ca67d26ecd;hpb=258cac6ec48a0a4ff62b33b4bdcbac5105a1e006 diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/AnnotationType.java b/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/AnnotationType.java index 7868675b1e..eec0339d0f 100644 --- a/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/AnnotationType.java +++ b/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/AnnotationType.java @@ -9,25 +9,94 @@ package org.opendaylight.controller.sal.binding.model.api; import java.util.List; - +/** + * The Annotation Type interface is designed to hold information about + * annotation for any type that could be annotated in Java. + *
+ * For sake of simplicity the Annotation Type is not designed to model exact + * behaviour of annotation mechanism, but just to hold information needed to + * model annotation over java Type definition. + */ public interface AnnotationType extends Type { - + + /** + * Returns the List of Annotations. + *
+ * Each Annotation Type MAY have defined multiple Annotations. + * + * @return the List of Annotations. + */ public List getAnnotations(); - + + /** + * Returns Parameter Definition assigned for given parameter name. + *
+ * If Annotation does not contain parameter with specified param name, + * the method MAY return null value. + * + * @param paramName Parameter Name + * @return Parameter Definition assigned for given parameter name. + */ public Parameter getParameter(final String paramName); - + + /** + * Returns List of all parameters assigned to Annotation Type. + * + * @return List of all parameters assigned to Annotation Type. + */ public List getParameters(); - + + /** + * Returns List of parameter names. + * + * @return List of parameter names. + */ public List getParameterNames(); - + + /** + * Returns true if annotation contains parameters. + * + * @return true if annotation contains parameters. + */ public boolean containsParameters(); - + + /** + * Annotation Type parameter interface. For simplicity the Parameter + * contains values and value types as Strings. Every annotation which + * contains parameters could contain either single parameter or array of + * parameters. To model this purposes the by contract if the parameter + * contains single parameter the {@link #getValues()} method will return + * empty List and {@link #getValue()} MUST always return non-null + * parameter. If the Parameter holds List of values the singular {@link + * #getValue()} parameter MAY return null value. + */ interface Parameter { - + + /** + * Returns the Name of the parameter. + * + * @return the Name of the parameter. + */ public String getName(); - + + /** + * Returns value in String format if Parameter contains singular value, + * otherwise MAY return null. + * + * @return value in String format if Parameter contains singular value. + */ public String getValue(); - + + /** + * Returns List of Parameter assigned values in order in which they + * were assigned for given parameter name. + *
+ * If there are multiple values assigned for given parameter name the + * method MUST NOT return empty List. + * + * @return List of Parameter assigned values in order in which they + * were assigned for given parameter name. + */ public List getValues(); } }