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%2FMethodSignature.java;h=88542e86f2c9f714f8f02a8f97bfe1366edc9338;hp=dda1f01291c17ab5bb5e4572f09c25f6ffaa107c;hb=f607c4b0b922281f1ddd5fda2e7b49ca67d26ecd;hpb=5ae5c5b1fbeb7cea9337bbb6f075e6b889e5a75d diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/MethodSignature.java b/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/MethodSignature.java index dda1f01291..88542e86f2 100644 --- a/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/MethodSignature.java +++ b/opendaylight/sal/yang-prototype/code-generator/binding-model-api/src/main/java/org/opendaylight/controller/sal/binding/model/api/MethodSignature.java @@ -9,25 +9,62 @@ package org.opendaylight.controller.sal.binding.model.api; import java.util.List; -public interface MethodSignature { - - public List getAnnotations(); - - public String getName(); - - public String getComment(); - - public Type getDefiningType(); +/** + * The Method Signature interface contains simplified meta model for java + * method definition. Each method MUST be defined by name, return type, + * parameters and access modifier. + *
+ * Additionally method MAY contain associated annotations and comment. By + * contract if method does not contain any comments or annotation definitions + * the {@link #getComment()} SHOULD rather return empty string and {@link + * #getAnnotations()} SHOULD rather return empty list than null + * values. + *
+ * The defining Type contains the reference to Generated Type that declares + * Method Signature. + */ +public interface MethodSignature extends TypeMember { - public Type getReturnType(); + /** + * Returns true if the method signature is defined as abstract. + *
+ * By default in java all method declarations in interface are defined as abstract, + * but the user don't need necessary to declare abstract keyword in front of each method. + *
+ * The abstract methods are allowed in Class definitions but only when the class is declared as abstract. + * + * @return true if the method signature is defined as abstract. + */ + public boolean isAbstract(); + /** + * Returns the List of parameters that method declare. If the method does + * not contain any parameters, the method will return empty List. + * + * @return the List of parameters that method declare. + */ public List getParameters(); - public AccessModifier getAccessModifier(); - + /** + * The Parameter interface is designed to hold the information of method + * Parameter(s). The parameter is defined by his Name which MUST be + * unique as java does not allow multiple parameters with same names for + * one method and Type that is associated with parameter. + */ interface Parameter { + + /** + * Returns the parameter name. + * + * @return the parameter name. + */ public String getName(); + /** + * Returns Type that is bounded to parameter name. + * + * @return Type that is bounded to parameter name. + */ public Type getType(); } }