From: Rashmi Pujar Date: Fri, 7 Oct 2016 17:15:52 +0000 (-0400) Subject: Bug 6859: Cleanup package names for mdsal-binding-generator-api module X-Git-Tag: release/carbon~149 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=dc2c7387e0e562de35f4d86804ee5897396ed808;hp=b309935185150be72917346fb80796cfb915f49f;p=mdsal.git Bug 6859: Cleanup package names for mdsal-binding-generator-api module Most packages still contain yangtools in the package name in mdsal which seems to be a by-product of cleaning up of the Java Binding code from YANG Tools to md-sal. The APIs are copied to new package. Added deprecated annotation to the old api. Deleted pkg org.opendaylight.yangtools.sal.binding.model.api.type.provider Change-Id: Ic120a7ec1f85d8f604aa575047d8bd639630517b Signed-off-by: Rashmi Pujar Signed-off-by: Robert Varga --- diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/api/BindingGenerator.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/api/BindingGenerator.java new file mode 100644 index 0000000000..7a4b7c255f --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/api/BindingGenerator.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.generator.api; + +import java.util.List; +import java.util.Set; + +import org.opendaylight.mdsal.binding.model.api.Type; +import org.opendaylight.yangtools.yang.model.api.Module; +import org.opendaylight.yangtools.yang.model.api.SchemaContext; + +/** + * Transform Schema Context to Generated types. + * + */ +public interface BindingGenerator { + + /** + * Generate Types from whole Schema Context.
+ * The method will return List of All Generated Types that could be + * Generated from Schema Context. + * + * + * @param context + * Schema Context + * @return List of Generated Types + * + * @see SchemaContext + */ + List generateTypes(final SchemaContext context); + + /** + * Generate Types from Schema Context restricted by sub set of specified + * Modules. The Schema Context MUST contain all of the sub modules otherwise + * the there is no guarantee that result List of Generated Types will + * contain correct Generated Types. + * + * @param context + * Schema Context + * @param modules + * Sub Set of Modules + * @return List of Generated Types restricted by sub set of Modules + * + * @see Module + * @see SchemaContext + * + */ + List generateTypes(final SchemaContext context, final Set modules); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/api/ClassLoadingStrategy.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/api/ClassLoadingStrategy.java new file mode 100644 index 0000000000..926bbeca67 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/api/ClassLoadingStrategy.java @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.generator.api; + +import org.opendaylight.mdsal.binding.model.api.Type; + +public interface ClassLoadingStrategy { + + Class loadClass(Type type) throws ClassNotFoundException; + + Class loadClass(String fullyQualifiedName) throws ClassNotFoundException; + +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/api/ModuleInfoRegistry.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/api/ModuleInfoRegistry.java new file mode 100644 index 0000000000..903c116f2e --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/api/ModuleInfoRegistry.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.mdsal.binding.generator.api; + +import org.opendaylight.yangtools.concepts.ObjectRegistration; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public interface ModuleInfoRegistry { + + ObjectRegistration registerModuleInfo(YangModuleInfo yangModuleInfo); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/provider/package-info.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/api/package-info.java similarity index 81% rename from binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/provider/package-info.java rename to binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/api/package-info.java index b88b1abf9f..593cca0567 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/provider/package-info.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/api/package-info.java @@ -5,4 +5,4 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.yangtools.sal.binding.model.api.type.provider; \ No newline at end of file +package org.opendaylight.mdsal.binding.generator.api; \ No newline at end of file diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/BindingGeneratorServiceProvider.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/BindingGeneratorServiceProvider.java new file mode 100644 index 0000000000..654868659a --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/BindingGeneratorServiceProvider.java @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.generator.spi; + +public interface BindingGeneratorServiceProvider { + + void registerTypeProvider(final TypeProvider provider); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/TypeProvider.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/TypeProvider.java new file mode 100644 index 0000000000..e30ba58ee5 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/TypeProvider.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.generator.spi; + +import org.opendaylight.mdsal.binding.model.api.Restrictions; +import org.opendaylight.mdsal.binding.model.api.Type; +import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; +import org.opendaylight.yangtools.yang.model.api.SchemaNode; +import org.opendaylight.yangtools.yang.model.api.TypeDefinition; + +public interface TypeProvider { + + /** + * Resolve of yang Type Definition to it's java counter part. + * If the Type Definition contains one of yang primitive types the method + * will return java.lang. counterpart. (For example if yang type is int32 + * the java counterpart is java.lang.Integer). In case that Type + * Definition contains extended type defined via yang typedef statement + * the method SHOULD return Generated Type or Generated Transfer Object + * if that Type is correctly referenced to resolved imported yang module. + * The method will return null value in situations that + * TypeDefinition can't be resolved (either due missing yang import or + * incorrectly specified type). + * + * + * @param type Type Definition to resolve from + * @return Resolved Type + */ + Type javaTypeForSchemaDefinitionType(final TypeDefinition type, final SchemaNode parentNode); + + Type javaTypeForSchemaDefinitionType(final TypeDefinition type, final SchemaNode parentNode, final Restrictions restrictions); + + /** + * Returns string containing code for creation of new type instance. + * + * @param node + * @return + */ + String getTypeDefaultConstruction(LeafSchemaNode node); + + String getConstructorPropertyName(SchemaNode node); + + String getParamNameFromType(TypeDefinition type); + +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/TypeProviderFactory.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/TypeProviderFactory.java new file mode 100644 index 0000000000..196b9df77b --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/TypeProviderFactory.java @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.generator.spi; + +import org.opendaylight.yangtools.yang.model.api.ModuleIdentifier; + +//FIXME not implemented anywhere +public interface TypeProviderFactory { + + TypeProvider providerFor(ModuleIdentifier module); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/package-info.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/package-info.java new file mode 100644 index 0000000000..12fca7d32a --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/package-info.java @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.generator.spi; \ No newline at end of file diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/AccessModifier.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/AccessModifier.java new file mode 100644 index 0000000000..7ee3078a52 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/AccessModifier.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +/** + * Enum definition which provides four access modifiers that are described + * in Java programming language (Default, Private, Protected, Public). + */ +public enum AccessModifier { + DEFAULT, + PRIVATE, + PUBLIC, + PROTECTED +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/AnnotationType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/AnnotationType.java new file mode 100644 index 0000000000..186ee675af --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/AnnotationType.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.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. + */ + 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. + */ + Parameter getParameter(final String paramName); + + /** + * Returns List of all parameters assigned to Annotation Type. + * + * @return List of all parameters assigned to Annotation Type. + */ + List getParameters(); + + /** + * Returns List of parameter names. + * + * @return List of parameter names. + */ + List getParameterNames(); + + /** + * Returns true if annotation contains parameters. + * + * @return true if annotation contains parameters. + */ + 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. + */ + 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. + */ + 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. + */ + List getValues(); + } +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/BaseTypeWithRestrictions.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/BaseTypeWithRestrictions.java new file mode 100644 index 0000000000..f3fbff382a --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/BaseTypeWithRestrictions.java @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +/** + * The BaseTypeWithRestrictions is marker interface that encapsulates definition of java + * concrete type only with changed restriction values. + */ +public interface BaseTypeWithRestrictions extends ConcreteType { + +} \ No newline at end of file diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/CodeGenerator.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/CodeGenerator.java new file mode 100644 index 0000000000..7703616e94 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/CodeGenerator.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +import org.opendaylight.yangtools.sal.binding.model.api.Type; + +/** + * Transformas data to concrete code in a programming language. + */ +public interface CodeGenerator { + + /** + * Generates code for type. + * + * @param type + * Input type to be processed + * @return generated JAVA code + */ + String generate(Type type); + + /** + * Checks if the concrete instance of type fit to concrete + * implementation of this interface. + * + * (e. g. method return true if in EnumGenerator (which + * implements this interface) has input parameter of type Enumeration (which + * is subtype of Type) + * + * @param type + * Input type to be processed + * @return true if type is acceptable for processing. + */ + boolean isAcceptable(Type type); + + /** + * Returns name of type parameter. + * + * @param type + * Input type to be processed + * @return name of generated unit + */ + String getUnitName(Type type); + +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/ConcreteType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/ConcreteType.java new file mode 100644 index 0000000000..d07f83d3ad --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/ConcreteType.java @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +/** + * The Concrete Type is marker interface that encapsulates definition of java + * concrete type. + */ +public interface ConcreteType extends Type { + + Restrictions getRestrictions(); + +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Constant.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Constant.java new file mode 100644 index 0000000000..9f1cf768b3 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Constant.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +/** + * Interface Contact is designed to hold and model java constant. In Java there + * are no constant keywords instead of the constant is defined as static final + * field with assigned value. For this purpose the Constant interface contains + * methods {@link #getType()} to provide wrapped return Type of Constant, + * {@link #getName()} the Name of constant and the {@link #getValue()} for + * providing of value assigned to Constant. To determine of which type the + * constant value is it is recommended firstly to retrieve Type from constant. + * The Type interface holds base information like java package name and java + * type name (e.g. fully qualified name). From this string user should be able + * to determine to which type can be {@link #getValue()} type typecasted to + * unbox and provide value assigned to constant. + */ +public interface Constant { + + /** + * Returns the Type that declares constant. + * + * @return the Type that declares constant. + */ + Type getDefiningType(); + + /** + * Returns the return Type (or just Type) of the Constant. + * + * @return the return Type (or just Type) of the Constant. + */ + Type getType(); + + /** + * Returns the name of constant.
+ * By conventions the name SHOULD be in CAPITALS separated with underscores. + * + * @return the name of constant. + */ + String getName(); + + /** + * Returns boxed value that is assigned for context. + * + * @return boxed value that is assigned for context. + */ + Object getValue(); + + /** + * Returns Constant definition in formatted string.
+ *
+ * The expected string SHOULD be in format: public final + * static [Type] CONSTANT_NAME = [value]; + * + * @return Constant definition in formatted string. + */ + String toFormattedString(); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/DocumentedType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/DocumentedType.java new file mode 100644 index 0000000000..2640000a64 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/DocumentedType.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Implementing this interface allows an object to hold information which are + * essential for generating java doc from type definition. + */ +public interface DocumentedType { + + /** + * Returns a string that contains a human-readable textual description of + * type definition. + * + * @return a human-readable textual description of type definition. + */ + String getDescription(); + + /** + * Returns a string that is used to specify a textual cross-reference to an + * external document, either another module that defines related management + * information, or a document that provides additional information relevant + * to this definition. + * + * @return a textual cross-reference to an external document. + */ + String getReference(); + + /** + * Returns a list of QNames which represent schema path in schema tree from + * actual concrete type to the root. + * + * @return a schema path in schema tree from actual concrete schema node + * identifier to the root. + */ + Iterable getSchemaPath(); + + /** + * Returns the name of the module, in which generated type was specified. + * + * @return the name of the module, in which generated type was specified. + */ + String getModuleName(); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Enumeration.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Enumeration.java new file mode 100644 index 0000000000..c50092cb4c --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Enumeration.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +import java.util.List; + +import org.opendaylight.yangtools.yang.model.api.DocumentedNode; + +/** + * Interface provide methods for reading data of enumeration class. + */ +public interface Enumeration extends GeneratedType { + + /** + * + * Returns list of annotation definitions associated with enumeration type. + * + * @return list of annotation definitions associated with enumeration type. + * + */ + @Override + List getAnnotations(); + + @Override + Type getParentType(); + + /** + * Returns list of the couples - name and value. + * + * @return list of the enumeration pairs. + */ + List getValues(); + + /** + * Formats enumeration according to rules of the programming language. + * + * @return string with source code in some programming language + */ + String toFormattedString(); + + /** + * Interface is used for reading enumeration item. It means item's name and + * its value. + */ + interface Pair extends DocumentedNode { + + /** + * Returns the name of the enumeration item as it is specified in the input yang. + * + * @return the name of the enumeration item as it is specified in the input yang. + */ + String getName(); + + /** + * Returns the binding representation for the name of the enumeration item. + * + * @return the binding representation for the name of the enumeration item. + */ + String getMappedName(); + + /** + * Returns value of the enumeration item. + * + * @return the value of the enumeration item. + */ + int getValue(); + } +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedProperty.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedProperty.java new file mode 100644 index 0000000000..34b4732a47 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedProperty.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +/** + * Generated Property extends interface {@link MethodSignature} interface.
+ * The Generated Property interface is designed to store information of fields + * (or members) declared in Java Transfer Objects (or any java classes) and + * their access counterparts (getters and setters). + * + * @see MethodSignature + */ +public interface GeneratedProperty extends TypeMember { + + String getValue(); + + /** + * Returns true if the property si declared as read-only.
+ * If the property has flag isReadOnly == true the property + * SHOULD be generated as getter only. + * + * @return true if the property si declared as read-only. + */ + boolean isReadOnly(); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedTransferIdentityObject.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedTransferIdentityObject.java new file mode 100644 index 0000000000..780a4207dd --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedTransferIdentityObject.java @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +public interface GeneratedTransferIdentityObject extends GeneratedTransferObject { + +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedTransferObject.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedTransferObject.java new file mode 100644 index 0000000000..342d818be5 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedTransferObject.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +import java.util.List; +import org.opendaylight.yangtools.yang.model.api.TypeDefinition; + +/** + * Generated Transfer Object extends {@link GeneratedType} and is designed to + * represent Java Class. The Generated Transfer Object contains declarations of + * member fields stored in List of Properties. The Generated Transfer Object can + * be extended by exactly ONE Generated Transfer Object as Java don't allow + * multiple inheritance. For retrieval of implementing Generated Types use + * {@link #getImplements()} method.
+ * Every transfer object SHOULD contain equals, hashCode and toString + * definitions. For this purpose retrieve definitions through + * {@link #getEqualsIdentifiers ()}, {@link #getHashCodeIdentifiers()} and + * {@link #getToStringIdentifiers ()}. + * + */ +public interface GeneratedTransferObject extends GeneratedType { + + GeneratedProperty getSUID(); + + /** + * Returns the Generated Transfer Object from which this GTO is derived, or + * null if this GTO is not derived from a GTO -- e.g. it is either an union + * or it is derived from a concrete type. + * + * @return Generated Transfer Object or null if this GTO is + * not derived from another GTO. + */ + GeneratedTransferObject getSuperType(); + + /** + * Returns List of Properties that are designated to define equality for + * Generated Transfer Object. + * + * @return List of Properties that are designated to define equality for + * Generated Transfer Object. + */ + List getEqualsIdentifiers(); + + /** + * Returns List of Properties that are designated to define identity for + * Generated Transfer Object. + * + * @return List of Properties that are designated to define identity for + * Generated Transfer Object. + */ + List getHashCodeIdentifiers(); + + /** + * Returns List of Properties that will be members of toString definition + * for Generated Transfer Object. + * + * @return List of Properties that will be members of toString definition + * for Generated Transfer Object. + */ + List getToStringIdentifiers(); + + boolean isTypedef(); + + /** + * Returns Base type of Java representation of YANG typedef if set, otherwise it returns null + * + * @return Base type of Java representation of YANG typedef if set, otherwise it returns null + */ + TypeDefinition getBaseType(); + + /** + * Return boolean value which describe whether Generated Transfer Object + * was/wasn't created from union YANG type. + * + * @return true value if Generated Transfer Object was created from union + * YANG type. + */ + boolean isUnionType(); + + boolean isUnionTypeBuilder(); + + Restrictions getRestrictions(); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedType.java new file mode 100644 index 0000000000..aedbc37d94 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedType.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +import java.util.List; + +/** + * Every Java interface has to be specified with: + *
    + *
  • package that belongs into
  • + *
  • interface name (with commentary that SHOULD be + * present to proper define interface and base contracts specified for + * interface)
  • + *
  • Each Generated Type can define list of types that Generated Type can + * implement to extend it's definition (i.e. interface extends list of + * interfaces or java class implements list of interfaces)
  • + *
  • Each Generated Type can contain multiple enclosed definitions of + * Generated Types (i.e. interface can contain N enclosed interface definitions + * or enclosed classes)
  • + *
  • enum and constant definitions (i.e. each + * constant definition is by default defined as public static final + * + type (either primitive or object) and constant name
  • + *
  • method definitions with specified input parameters (with + * types) and return values
  • + *
+ * + * By the definition of the interface constant, enum, enclosed types and method + * definitions MUST be public, so there is no need to specify the scope of + * visibility. + */ +public interface GeneratedType extends Type, DocumentedType { + + /** + * Returns the parent type if Generated Type is defined as enclosing type, + * otherwise returns null + * + * @return the parent type if Generated Type is defined as enclosing type, + * otherwise returns null + */ + Type getParentType(); + + /** + * Returns comment string associated with Generated Type. + * + * @return comment string associated with Generated Type. + */ + String getComment(); + + /** + * Returns List of annotation definitions associated with generated type. + * + * @return List of annotation definitions associated with generated type. + */ + List getAnnotations(); + + /** + * Returns true if The Generated Type is defined as abstract. + * + * @return true if The Generated Type is defined as abstract. + */ + boolean isAbstract(); + + /** + * Returns List of Types that Generated Type will implement. + * + * @return List of Types that Generated Type will implement. + */ + List getImplements(); + + /** + * Returns List of enclosing Generated Types. + * + * @return List of enclosing Generated Types. + */ + List getEnclosedTypes(); + + /** + * Returns List of all Enumerator definitions associated with Generated + * Type. + * + * @return List of all Enumerator definitions associated with Generated + * Type. + */ + List getEnumerations(); + + /** + * Returns List of Constant definitions associated with Generated Type. + * + * @return List of Constant definitions associated with Generated Type. + */ + List getConstantDefinitions(); + + /** + * Returns List of Method Definitions associated with Generated Type. + * + * List does not contains getters and setters for properties. + * + * @return List of Method Definitions associated with Generated Type. + */ + List getMethodDefinitions(); + + /** + * Returns List of Properties that are declared for Generated Transfer + * Object. + * + * @return List of Properties that are declared for Generated Transfer + * Object. + */ + List getProperties(); + +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/MethodSignature.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/MethodSignature.java new file mode 100644 index 0000000000..c47452cdb7 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/MethodSignature.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +import java.util.List; + +/** + * 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 { + + /** + * 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. + */ + 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. + */ + List getParameters(); + + /** + * 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. + */ + String getName(); + + /** + * Returns Type that is bounded to parameter name. + * + * @return Type that is bounded to parameter name. + */ + Type getType(); + } +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/ParameterizedType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/ParameterizedType.java new file mode 100644 index 0000000000..42735256e3 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/ParameterizedType.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +/** + * Represents an instance of simple parametrized type such as List<String>. + * + * The parametrized Type is designed to be used to store information of Java + * Generic Type. The array of {@link #getActualTypeArguments()} holds + * information of all generic parameters defined for Parameterized Type. + */ +public interface ParameterizedType extends Type { + + /** + * Returns array of Types that are defined for Parameterized Type. + *
+ * (for example if ParameterizedType encapsulates java generic Map that + * specifies two parameters Map<K,V> and the K is java.lang.Integer and V + * is defined as GeneratedType the array will contain two Types to store + * the information of generic parameters.) + * + * @return array of Types that are defined for Parameterized Type. + */ + Type[] getActualTypeArguments(); + + /** + * Returns the Raw Type definition of Parameterized Type. + * + * @return the Raw Type definition of Parameterized Type. + */ + Type getRawType(); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Restrictions.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Restrictions.java new file mode 100644 index 0000000000..aece6ab83e --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Restrictions.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +import java.util.List; + +import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint; +import org.opendaylight.yangtools.yang.model.api.type.PatternConstraint; +import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint; + +public interface Restrictions { + + List getLengthConstraints(); + + List getPatternConstraints(); + + List getRangeConstraints(); + + boolean isEmpty(); + +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Type.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Type.java new file mode 100644 index 0000000000..c9db863c84 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Type.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +/** + * The Type interface defines the base type for all types defined in java. Each + * Type defined in java MUST contain name and package name, except of primitive + * types like int, byte etc. In case of mapping of primitive type the package + * name MUST be left as empty string. + * + */ +public interface Type { + /** + * Returns name of the package that interface belongs to. + * + * @return name of the package that interface belongs to + */ + String getPackageName(); + + /** + * Returns name of the interface. + * + * @return name of the interface. + */ + String getName(); + + /** + * Returns fully qualified name of Type.
+ * The fully qualified name of Type MUST be returned in following format: + *
    + *
  • If does not contains package name: [type name] (e.g. int, byte, + * byte[],...)
  • + *
  • If Type contains package name: [package name].[type name] (e.g + * java.lang.Byte, org.opendaylight.controller.gen.GenType)
  • + *
+ * + * @return fully qualified name of Type. + */ + String getFullyQualifiedName(); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/TypeMember.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/TypeMember.java new file mode 100644 index 0000000000..353c66e7a3 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/TypeMember.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +import java.util.List; + +/** + * Common interface for variables and methods in class. + */ +public interface TypeMember { + + /** + * Returns comment string associated with member. + * + * @return comment string associated with member. + */ + String getComment(); + + /** + * Returns List of annotation definitions associated with generated type. + * + * @return List of annotation definitions associated with generated type. + */ + List getAnnotations(); + + /** + * Returns the access modifier of member. + * + * @return the access modifier of member. + */ + AccessModifier getAccessModifier(); + + /** + * Returns true if member is declared as static. + * + * @return true if member is declared as static. + */ + boolean isStatic(); + + /** + * Returns true if member is declared as final. + * + * @return true if member is declared as final. + */ + boolean isFinal(); + + /** + * Get the returning Type of member. + * + * @return the returning Type of member. + */ + Type getReturnType(); + + /** + * Returns the name of member. + * + * @return the name of member. + */ + String getName(); + + /** + * Returns the Type that declares member. + * + * @return the Type that declares member. + */ + Type getDefiningType(); + +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/WildcardType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/WildcardType.java new file mode 100644 index 0000000000..d9396fedaf --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/WildcardType.java @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; + +/** + * + * Marker interface which assign to object property that it is bounded wildcard + * type. + * + */ +public interface WildcardType extends Type { + +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/package-info.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/package-info.java new file mode 100644 index 0000000000..9af600c956 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/package-info.java @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api; \ No newline at end of file diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/AnnotationTypeBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/AnnotationTypeBuilder.java new file mode 100644 index 0000000000..35b6ad9fa1 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/AnnotationTypeBuilder.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api.type.builder; + +import java.util.List; + +import org.opendaylight.mdsal.binding.model.api.AnnotationType; +import org.opendaylight.mdsal.binding.model.api.Type; + +/** + * Annotation Type Builder Interface serves for creation and instantiation of + * immutable copy of Annotation Type. The Annotation Type Builder extends from + * {@link Type} interface. The Annotation Type contains set of methods which are + * capable to provide information about other Annotation Types and Annotation + * Parameters. + * + * @see AnnotationType + */ +public interface AnnotationTypeBuilder extends Type { + + /** + * The method creates new AnnotationTypeBuilder containing specified package + * name an annotation name.
+ * Neither the package name or annotation name can contain null + * references. In case that any of parameters contains null the + * method SHOULD thrown {@link IllegalArgumentException} + * + * @param packageName + * Package Name of Annotation Type + * @param name + * Name of Annotation Type + * @return new instance of Annotation Type Builder. + */ + AnnotationTypeBuilder addAnnotation(final String packageName, final String name); + + /** + * Adds the parameter into List of parameters for Annotation Type.
+ * If there is already stored parameter with the same name as the new + * parameter, the value of the old one will be simply overwritten by the + * newer parameter.
+ * Neither the param name or value can contain null references. + * In case that any of parameters contains null the method + * SHOULD thrown {@link IllegalArgumentException} + * + * @param paramName + * Parameter Name + * @param value + * Parameter Value + * @return true if the parameter has been successfully assigned + * for Annotation Type + */ + boolean addParameter(final String paramName, String value); + + /** + * Adds the parameter with specified List of parameter values into List of + * parameters for Annotation Type.
+ * If there is already stored parameter with the same name as the new + * parameter, the value of the old one will be simply overwritten by the + * newer parameter.
+ * Neither the param name or value can contain null references. + * In case that any of parameters contains null the method + * SHOULD thrown {@link IllegalArgumentException} + * + * @param paramName + * Parameter Name + * @param values + * List of Values bounded to Parameter Name + * @return true if the parameter has been successfully assigned + * for Annotation Type + */ + boolean addParameters(final String paramName, List values); + + /** + * Returns new immutable instance of Annotation Type + * with values assigned in current instance of Annotation Type Builder.
+ * The return Annotation Type instance is immutable thus no additional + * modification to Annotation Type Builder will have an impact to + * instantiated Annotation Type.
+ * For this purpose call this method after all additions are complete. + * + * @return new immutable instance of Annotation Type. + */ + AnnotationType toInstance(); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/ConstantBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/ConstantBuilder.java new file mode 100644 index 0000000000..52af4456eb --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/ConstantBuilder.java @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api.type.builder; + +import org.opendaylight.mdsal.binding.model.api.Constant; +import org.opendaylight.mdsal.binding.model.api.Type; + +public interface ConstantBuilder { + + void assignValue(Object value); + + Constant toInstance(Type definingType); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/EnumBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/EnumBuilder.java new file mode 100644 index 0000000000..225f61aafe --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/EnumBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api.type.builder; + +import org.opendaylight.mdsal.binding.model.api.Enumeration; +import org.opendaylight.mdsal.binding.model.api.Type; +import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition; + +/** + * Enum Builder is interface that contains methods to build and instantiate + * Enumeration definition. + * + * @see Enumeration + */ +public interface EnumBuilder extends Type { + + /** + * The method creates new AnnotationTypeBuilder containing specified package + * name an annotation name.
+ * Neither the package name or annotation name can contain null + * references. In case that any of parameters contains null the + * method SHOULD thrown {@link IllegalArgumentException} + * + * @param packageName + * Package Name of Annotation Type + * @param name + * Name of Annotation Type + * @return new instance of Annotation Type Builder. + */ + AnnotationTypeBuilder addAnnotation(final String packageName, final String name); + + /** + * + * @param name + * @param value + */ + void addValue(final String name, final int value, final String description); + + /** + * + * @param definingType + * @return + */ + Enumeration toInstance(final Type definingType); + + /** + * Updates this builder with data from enumTypeDef. + * Specifically this data represents list of value-name pairs. + * + * @param enumTypeDef + * enum type definition as source of enum data for + * enumBuilder + */ + void updateEnumPairsFromEnumTypeDef(final EnumTypeDefinition enumTypeDef); + + /** + * @param description + */ + void setDescription(final String description); + +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedPropertyBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedPropertyBuilder.java new file mode 100644 index 0000000000..610992690b --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedPropertyBuilder.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api.type.builder; + +import org.opendaylight.mdsal.binding.model.api.GeneratedProperty; +import org.opendaylight.mdsal.binding.model.api.Type; + +/** + * Generated Property Builder is interface that contains methods to build and + * instantiate Generated Property definition. + * + * @see GeneratedProperty + */ +public interface GeneratedPropertyBuilder extends TypeMemberBuilder { + + GeneratedPropertyBuilder setValue(String value); + + /** + * Sets isReadOnly flag for property. If property is marked as read only it + * is the same as set property in java as final. + * + * @param isReadOnly + * Read Only property flag. + */ + GeneratedPropertyBuilder setReadOnly(final boolean isReadOnly); + + /** + * Returns new immutable instance of Generated Property.
+ * The definingType param cannot be null. The + * every member in Java MUST be declared and defined inside the scope of + * class definition. In case that defining Type will be passed + * as null reference the method SHOULD thrown + * {@link IllegalArgumentException}. + * + * @param definingType + * Defining Type of Generated Property + * @return new immutable instance of Generated Property. + */ + GeneratedProperty toInstance(final Type definingType); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTOBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTOBuilder.java new file mode 100644 index 0000000000..4c244013f6 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTOBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api.type.builder; + +import org.opendaylight.mdsal.binding.model.api.GeneratedTransferObject; +import org.opendaylight.mdsal.binding.model.api.Restrictions; +import org.opendaylight.yangtools.yang.model.api.TypeDefinition; + +/** + * Generated Transfer Object Builder is interface that contains methods to build + * and instantiate Generated Transfer Object definition. + * + * @see GeneratedTransferObject + */ +public interface GeneratedTOBuilder extends GeneratedTypeBuilderBase { + + /** + * Add Generated Transfer Object from which will be extended current + * Generated Transfer Object.
+ * By definition Java does not allow multiple inheritance, hence if there is + * already definition of Generated Transfer Object the extending object will + * be overwritten by lastly added Generated Transfer Object.
+ * If Generated Transfer Object is null the method SHOULD throw + * {@link IllegalArgumentException} + * + * @param genTransObj + * Generated Transfer Object + * @return This instance of builder + */ + GeneratedTOBuilder setExtendsType(final GeneratedTransferObject genTransObj); + + /** + * Add Property that will be part of equals definition.
+ * If Generated Property Builder is null the method SHOULD + * throw {@link IllegalArgumentException} + * + * @param property + * Generated Property Builder + * @return This instance of builder + */ + GeneratedTOBuilder addEqualsIdentity(final GeneratedPropertyBuilder property); + + /** + * Add Property that will be part of hashCode definition.
+ * If Generated Property Builder is null the method SHOULD + * throw {@link IllegalArgumentException} + * + * @param property + * Generated Property Builder + * @return This instance of builder + */ + GeneratedTOBuilder addHashIdentity(final GeneratedPropertyBuilder property); + + /** + * Add Property that will be part of toString definition.
+ * If Generated Property Builder is null the method SHOULD + * throw {@link IllegalArgumentException} + * + * @param property + * Generated Property Builder + * @return This instance of builder + */ + GeneratedTOBuilder addToStringProperty(final GeneratedPropertyBuilder property); + + void setRestrictions(Restrictions restrictions); + + /** + * Returns instance of GeneratedTransferObject which data are + * build from the data of this builder + * + * @return generated transfer object instance + */ + GeneratedTransferObject toInstance(); + + void setTypedef(boolean isTypedef); + + /** + * Sets the base type for Java representation of YANG typedef + * + * @param typeDef + * Type Definition + */ + void setBaseType(TypeDefinition typeDef); + + /** + * + * @param isUnion + */ + void setIsUnion(boolean isUnion); + + void setIsUnionBuilder(boolean isUnionTypeBuilder); + + void setSUID(GeneratedPropertyBuilder suid); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTypeBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTypeBuilder.java new file mode 100644 index 0000000000..0a77843f0d --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTypeBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api.type.builder; + +import org.opendaylight.mdsal.binding.model.api.GeneratedType; + +/** + * Generated Type Builder interface is helper interface for building and + * defining the GeneratedType. + * + * @see GeneratedType + */ +public interface GeneratedTypeBuilder extends GeneratedTypeBuilderBase { + + /** + * Returns the new immutable instance of Generated Type. + * + * @return the new immutable instance of Generated Type. + */ + GeneratedType toInstance(); + +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTypeBuilderBase.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTypeBuilderBase.java new file mode 100644 index 0000000000..2ab39ebf40 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTypeBuilderBase.java @@ -0,0 +1,222 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api.type.builder; + +import java.util.List; + +import org.opendaylight.mdsal.binding.model.api.Constant; +import org.opendaylight.mdsal.binding.model.api.Type; +import org.opendaylight.yangtools.yang.common.QName; + +public interface GeneratedTypeBuilderBase> extends Type { + + /** + * Adds new Enclosing Transfer Object into definition of Generated Type and + * returns new Instance of Generated TO Builder.
+ * There is no need of specifying of Package Name because enclosing Type is + * already defined inside Generated Type with specific package name.
+ * The name of enclosing Type cannot be same as Name of parent type and if + * there is already defined enclosing type with the same name, the new + * enclosing type will simply overwrite the older definition.
+ * If the name of enclosing type is null the method SHOULD + * throw {@link IllegalArgumentException} + * + * @param name + * Name of Enclosing Type + * @return new Instance of Generated Type Builder. + */ + GeneratedTOBuilder addEnclosingTransferObject(String name); + + /** + * Adds new Enclosing Transfer Object genTOBuilder into + * definition of Generated Type + * + *
+ * There is no need of specifying of Package Name because enclosing Type is + * already defined inside Generated Type with specific package name.
+ * The name of enclosing Type cannot be same as Name of parent type and if + * there is already defined enclosing type with the same name, the new + * enclosing type will simply overwrite the older definition.
+ * If the parameter genTOBuilder of enclosing type is + * null the method SHOULD throw + * {@link IllegalArgumentException} + * + * @param genTOBuilder + * Name of Enclosing Type + */ + T addEnclosingTransferObject(GeneratedTOBuilder genTOBuilder); + + /** + * Adds String definition of comment into Method Signature definition.
+ * The comment String MUST NOT contain anny comment specific chars (i.e. + * "/**" or "//") just plain String text description. + * + * @param comment + * Comment String. + */ + T addComment(String comment); + + /** + * The method creates new AnnotationTypeBuilder containing specified package + * name an annotation name.
+ * Neither the package name or annotation name can contain null + * references. In case that any of parameters contains null the + * method SHOULD thrown {@link IllegalArgumentException} + * + * @param packageName + * Package Name of Annotation Type + * @param name + * Name of Annotation Type + * @return new instance of Annotation Type Builder. + */ + AnnotationTypeBuilder addAnnotation(String packageName, String name); + + boolean isAbstract(); + + /** + * Sets the abstract flag to define Generated Type as + * abstract type. + * + * @param isAbstract + * abstract flag + */ + T setAbstract(boolean isAbstract); + + List getImplementsTypes(); + + /** + * Add Type to implements. + * + * @param genType + * Type to implement + * @return true if the addition of type is successful. + */ + T addImplementsType(Type genType); + + /** + * Adds Constant definition and returns new Constant instance.
+ * By definition Constant MUST be defined by return Type, Name and assigned + * value. The name SHOULD be defined with capital letters. Neither of method + * parameters can be null and the method SHOULD throw + * {@link IllegalArgumentException} if the contract is broken. + * + * @param type + * Constant Type + * @param name + * Name of Constant + * @param value + * Assigned Value + * @return new Constant instance. + */ + Constant addConstant(Type type, String name, Object value); + + /** + * Adds new Enumeration definition for Generated Type Builder and returns + * Enum Builder for specifying all Enum parameters.
+ * If there is already Enumeration stored with the same name, the old enum + * will be simply overwritten byt new enum definition.
+ * Name of Enumeration cannot be null, if it is + * null the method SHOULD throw + * {@link IllegalArgumentException} + * + * @param name + * Enumeration Name + * @return new instance of Enumeration Builder. + */ + EnumBuilder addEnumeration(String name); + + List getMethodDefinitions(); + + /** + * Add new Method Signature definition for Generated Type Builder and + * returns Method Signature Builder for specifying all Method parameters.
+ * Name of Method cannot be null, if it is null + * the method SHOULD throw {@link IllegalArgumentException}
+ * By Default the MethodSignatureBuilder SHOULD be pre-set as + * {@link MethodSignatureBuilder#setAbstract(boolean)}, + * {TypeMemberBuilder#setFinal(boolean)} and + * {TypeMemberBuilder#setAccessModifier(boolean)} + * + * @param name + * Name of Method + * @return new instance of Method Signature Builder. + */ + MethodSignatureBuilder addMethod(String name); + + /** + * Checks if GeneratedTypeBuilder contains method with name + * methodName + * + * @param methodName + * is method name + */ + boolean containsMethod(String methodName); + + List getProperties(); + + /** + * Add new Generated Property definition for Generated Transfer Object + * Builder and returns Generated Property Builder for specifying Property.
+ * Name of Property cannot be null, if it is null + * the method SHOULD throw {@link IllegalArgumentException} + * + * @param name + * Name of Property + * @return new instance of Generated Property Builder. + */ + GeneratedPropertyBuilder addProperty(String name); + + /** + * Check whether GeneratedTOBuilder contains property with name + * name + * + * @param name + * of property which existance is checked + * @return true if property name exists in list of properties. + */ + boolean containsProperty(String name); + + /** + * Set a string that contains a human-readable textual description of type + * definition. + * + * @param description + * a string that contains a human-readable textual description of + * type definition. + */ + void setDescription(String description); + + /** + * Set the name of the module, in which generated type was specified. + * + * @param moduleName + * the name of the module + */ + void setModuleName(String moduleName); + + /** + * Set a list of QNames which represent schema path in schema tree from + * actual concrete type to the root. + * + * @param schemaPath + * a list of QNames which represent schema path in schema tree + */ + void setSchemaPath(Iterable schemaPath); + + /** + * Set a string that is used to specify a textual cross-reference to an + * external document, either another module that defines related management + * information, or a document that provides additional information relevant + * to this definition. + * + * @param reference + * a textual cross-reference to an external document. + */ + void setReference(String reference); + +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/MethodSignatureBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/MethodSignatureBuilder.java new file mode 100644 index 0000000000..e683ebd054 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/MethodSignatureBuilder.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api.type.builder; + +import org.opendaylight.mdsal.binding.model.api.MethodSignature; +import org.opendaylight.mdsal.binding.model.api.Type; + +/** + * Method Signature Builder serves solely for building Method Signature and + * returning the new instance of Method Signature.
+ * By definition of {@link MethodSignature} the Method in java MUST contain + * Name, Return Type and Access Modifier. By default the Access Modifier can be + * set to public. The Method Signature builder does not contain method for + * addName due to enforce reason that MethodSignatureBuilder SHOULD be + * instantiated only once with defined method name.
+ * The methods as {@link #addAnnotation(String, String)} and + * {@link #setComment(String)} can be used as optional because not all methods + * MUST contain annotation or comment definitions. + * + * + * @see MethodSignature + */ +public interface MethodSignatureBuilder extends TypeMemberBuilder { + + /** + * Sets the flag for declaration of method as abstract or non abstract. If + * the flag isAbstract == true The instantiated Method + * Signature MUST have return value for {@link MethodSignature#isAbstract()} + * also equals to true. + * + * @param isAbstract + * is abstract flag + */ + MethodSignatureBuilder setAbstract(boolean isAbstract); + + /** + * Adds Parameter into the List of method parameters. Neither the Name or + * Type of parameter can be null. + * + *
+ * In case that any of parameters are defined as null the + * method SHOULD throw an {@link IllegalArgumentException} + * + * @param type + * Parameter Type + * @param name + * Parameter Name + */ + MethodSignatureBuilder addParameter(final Type type, final String name); + + /** + * Returns new immutable instance of Method Signature.
+ * The definingType param cannot be null. The + * every method in Java MUST be declared and defined inside the scope of + * class or interface definition. In case that + * defining Type will be passed as null reference the method + * SHOULD thrown {@link IllegalArgumentException}. + * + * @param definingType + * Defining Type of Method Signature + * @return new immutable instance of Method Signature. + */ + MethodSignature toInstance(final Type definingType); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/TypeMemberBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/TypeMemberBuilder.java new file mode 100644 index 0000000000..c1f218351c --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/TypeMemberBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api.type.builder; + +import org.opendaylight.mdsal.binding.model.api.AccessModifier; +import org.opendaylight.mdsal.binding.model.api.Type; + +public interface TypeMemberBuilder> { + + /** + * The method creates new AnnotationTypeBuilder containing specified package + * name an annotation name.
+ * Neither the package name or annotation name can contain null + * references. In case that any of parameters contains null the + * method SHOULD thrown {@link IllegalArgumentException} + * + * @param packageName + * Package Name of Annotation Type + * @param name + * Name of Annotation Type + * @return new instance of Annotation Type Builder. + */ + AnnotationTypeBuilder addAnnotation(String packageName, String name); + + /** + * Returns the name of property. + * + * @return the name of property. + */ + String getName(); + + /** + * Adds return Type into Builder definition for Generated Property.
+ * The return Type MUST NOT be null, otherwise the method + * SHOULD throw {@link IllegalArgumentException} + * + * @param returnType + * Return Type of property. + */ + T setReturnType(Type returnType); + + AccessModifier getAccessModifier(); + + /** + * Sets the access modifier of property. + * + * @param modifier + * Access Modifier value. + */ + T setAccessModifier(AccessModifier modifier); + + /** + * Adds String definition of comment into Method Signature definition.
+ * The comment String MUST NOT contain anny comment specific chars (i.e. + * "/**" or "//") just plain String text description. + * + * @param comment + * Comment String. + */ + T setComment(String comment); + + /** + * Sets the flag final for method signature. If this is set the method will + * be prohibited from overriding.
+ * This setting is irrelevant for methods designated to be defined in + * interface definitions because interface can't have final method. + * + * @param isFinal + * Is Final + */ + T setFinal(boolean isFinal); + + T setStatic(boolean isStatic); +} diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/package-info.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/package-info.java new file mode 100644 index 0000000000..2e475790d3 --- /dev/null +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/package-info.java @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.mdsal.binding.model.api.type.builder; \ No newline at end of file diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/api/BindingGenerator.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/api/BindingGenerator.java index 61900083a7..3995b947cd 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/api/BindingGenerator.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/api/BindingGenerator.java @@ -16,20 +16,21 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext; /** * Transform Schema Context to Generated types. - * + * @deprecated Use {@link org.opendaylight.mdsal.binding.generator.api.BindingGenerator} instead. */ +@Deprecated public interface BindingGenerator { /** * Generate Types from whole Schema Context.
* The method will return List of All Generated Types that could be * Generated from Schema Context. - * - * + * + * * @param context * Schema Context * @return List of Generated Types - * + * * @see SchemaContext */ List generateTypes(final SchemaContext context); @@ -39,16 +40,16 @@ public interface BindingGenerator { * Modules. The Schema Context MUST contain all of the sub modules otherwise * the there is no guarantee that result List of Generated Types will * contain correct Generated Types. - * + * * @param context * Schema Context * @param modules * Sub Set of Modules * @return List of Generated Types restricted by sub set of Modules - * + * * @see Module * @see SchemaContext - * + * */ List generateTypes(final SchemaContext context, final Set modules); } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/api/ClassLoadingStrategy.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/api/ClassLoadingStrategy.java index 2d9e32d5b5..01285130a2 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/api/ClassLoadingStrategy.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/api/ClassLoadingStrategy.java @@ -9,10 +9,13 @@ package org.opendaylight.yangtools.sal.binding.generator.api; import org.opendaylight.yangtools.sal.binding.model.api.Type; +/** + * @deprecated Use {@link org.opendaylight.mdsal.binding.generator.api.ClassLoadingStrategy} instead. + */ +@Deprecated public interface ClassLoadingStrategy { Class loadClass(Type type) throws ClassNotFoundException; Class loadClass(String fullyQualifiedName) throws ClassNotFoundException; - } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/api/ModuleInfoRegistry.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/api/ModuleInfoRegistry.java index 9888b1dc75..8a1f9cb6fd 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/api/ModuleInfoRegistry.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/api/ModuleInfoRegistry.java @@ -8,10 +8,10 @@ package org.opendaylight.yangtools.sal.binding.generator.api; -import org.opendaylight.yangtools.concepts.ObjectRegistration; -import org.opendaylight.yangtools.yang.binding.YangModuleInfo; - -public interface ModuleInfoRegistry { +/** + * @deprecated Use {@link org.opendaylight.mdsal.binding.generator.api.ModuleInfoRegistry} instead. + */ +@Deprecated +public interface ModuleInfoRegistry extends org.opendaylight.mdsal.binding.generator.api.ModuleInfoRegistry { - ObjectRegistration registerModuleInfo(YangModuleInfo yangModuleInfo); } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/spi/BindingGeneratorServiceProvider.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/spi/BindingGeneratorServiceProvider.java index d306069116..73e6ecd2a4 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/spi/BindingGeneratorServiceProvider.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/spi/BindingGeneratorServiceProvider.java @@ -7,6 +7,10 @@ */ package org.opendaylight.yangtools.sal.binding.generator.spi; +/** + * @deprecated Use {@link org.opendaylight.mdsal.binding.generator.spi.BindingGeneratorServiceProvider} instead. + */ +@Deprecated public interface BindingGeneratorServiceProvider { void registerTypeProvider(final TypeProvider provider); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/spi/TypeProvider.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/spi/TypeProvider.java index 89d7a8cc76..87c4640ffa 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/spi/TypeProvider.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/spi/TypeProvider.java @@ -13,6 +13,10 @@ import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; import org.opendaylight.yangtools.yang.model.api.SchemaNode; import org.opendaylight.yangtools.yang.model.api.TypeDefinition; +/** + * @deprecated Use {@link org.opendaylight.mdsal.binding.generator.spi.TypeProvider} instead. + */ +@Deprecated public interface TypeProvider { @Deprecated @@ -49,5 +53,4 @@ public interface TypeProvider { String getConstructorPropertyName(SchemaNode node); String getParamNameFromType(TypeDefinition type); - } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/spi/TypeProviderFactory.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/spi/TypeProviderFactory.java index d0aa79bc9b..55b41067f9 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/spi/TypeProviderFactory.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/generator/spi/TypeProviderFactory.java @@ -9,6 +9,10 @@ package org.opendaylight.yangtools.sal.binding.generator.spi; import org.opendaylight.yangtools.yang.model.api.ModuleIdentifier; +/** + * @deprecated Use {@link org.opendaylight.mdsal.binding.generator.spi.TypeProviderFactory} instead. + */ +@Deprecated //FIXME not implemented anywhere public interface TypeProviderFactory { diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/AccessModifier.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/AccessModifier.java index 13f13ee9dd..ddc819032f 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/AccessModifier.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/AccessModifier.java @@ -10,7 +10,10 @@ package org.opendaylight.yangtools.sal.binding.model.api; /** * Enum definition which provides four access modifiers that are described * in Java programming language (Default, Private, Protected, Public). + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.AccessModifier} instead. */ +@Deprecated public enum AccessModifier { DEFAULT, PRIVATE, PUBLIC, PROTECTED } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/AnnotationType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/AnnotationType.java index 4e248f06d1..94e139c991 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/AnnotationType.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/AnnotationType.java @@ -15,13 +15,16 @@ import java.util.List; * 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. + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.AnnotationType} instead. */ +@Deprecated public interface AnnotationType extends Type { /** * Returns the List of Annotations.
* Each Annotation Type MAY have defined multiple Annotations. - * + * * @return the List of Annotations. */ List getAnnotations(); @@ -30,7 +33,7 @@ public interface AnnotationType extends Type { * 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. @@ -39,21 +42,21 @@ public interface AnnotationType extends Type { /** * Returns List of all parameters assigned to Annotation Type. - * + * * @return List of all parameters assigned to Annotation Type. */ List getParameters(); /** * Returns List of parameter names. - * + * * @return List of parameter names. */ List getParameterNames(); /** * Returns true if annotation contains parameters. - * + * * @return true if annotation contains parameters. */ boolean containsParameters(); @@ -73,7 +76,7 @@ public interface AnnotationType extends Type { /** * Returns the Name of the parameter. - * + * * @return the Name of the parameter. */ String getName(); @@ -81,7 +84,7 @@ public interface AnnotationType extends Type { /** * Returns value in String format if Parameter contains singular value, * otherwise MAY return null. - * + * * @return value in String format if Parameter contains singular value. */ String getValue(); @@ -91,7 +94,7 @@ public interface AnnotationType extends Type { * 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. */ diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/BaseTypeWithRestrictions.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/BaseTypeWithRestrictions.java index 703c58d70b..e855018d7e 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/BaseTypeWithRestrictions.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/BaseTypeWithRestrictions.java @@ -10,7 +10,10 @@ package org.opendaylight.yangtools.sal.binding.model.api; /** * The BaseTypeWithRestrictions is marker interface that encapsulates definition of java * concrete type only with changed restriction values. + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.BaseTypeWithRestrictions} instead. */ +@Deprecated public interface BaseTypeWithRestrictions extends ConcreteType { } \ No newline at end of file diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/CodeGenerator.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/CodeGenerator.java index bde957b209..e7c08f23d2 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/CodeGenerator.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/CodeGenerator.java @@ -9,13 +9,15 @@ package org.opendaylight.yangtools.sal.binding.model.api; /** * Transformates virtual data to the concrete code in programming language. - * + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.CodeGenerator} instead. */ +@Deprecated public interface CodeGenerator { /** * Generates code for type. - * + * * @param type * Input type to be processed * @return generated JAVA code @@ -25,11 +27,11 @@ public interface CodeGenerator { /** * Checks if the concrete instance of type fit to concrete * implementation of this interface. - * + * * (e. g. method return true if in EnumGenerator (which * implements this interface) has input parameter of type Enumeration (which * is subtype of Type) - * + * * @param type * Input type to be processed * @return true if type is acceptable for processing. @@ -38,7 +40,7 @@ public interface CodeGenerator { /** * Returns name of type parameter. - * + * * @param type * Input type to be processed * @return name of generated unit diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/ConcreteType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/ConcreteType.java index 52adeb9325..b41b5bd37d 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/ConcreteType.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/ConcreteType.java @@ -10,7 +10,10 @@ package org.opendaylight.yangtools.sal.binding.model.api; /** * The Concrete Type is marker interface that encapsulates definition of java * concrete type. + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.ConcreteType} instead. */ +@Deprecated public interface ConcreteType extends Type { Restrictions getRestrictions(); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Constant.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Constant.java index 31d673c702..5f9905c11f 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Constant.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Constant.java @@ -19,19 +19,22 @@ package org.opendaylight.yangtools.sal.binding.model.api; * type name (e.g. fully qualified name). From this string user should be able * to determine to which type can be {@link #getValue()} type typecasted to * unbox and provide value assigned to constant. + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.Constant} instead. */ +@Deprecated public interface Constant { /** * Returns the Type that declares constant. - * + * * @return the Type that declares constant. */ Type getDefiningType(); /** * Returns the return Type (or just Type) of the Constant. - * + * * @return the return Type (or just Type) of the Constant. */ Type getType(); @@ -39,14 +42,14 @@ public interface Constant { /** * Returns the name of constant.
* By conventions the name SHOULD be in CAPITALS separated with underscores. - * + * * @return the name of constant. */ String getName(); /** * Returns boxed value that is assigned for context. - * + * * @return boxed value that is assigned for context. */ Object getValue(); @@ -56,7 +59,7 @@ public interface Constant { *
* The expected string SHOULD be in format: public final * static [Type] CONSTANT_NAME = [value]; - * + * * @return Constant definition in formatted string. */ String toFormattedString(); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/DocumentedType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/DocumentedType.java index 484d7d47b9..8530775440 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/DocumentedType.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/DocumentedType.java @@ -12,7 +12,10 @@ import org.opendaylight.yangtools.yang.common.QName; /** * Implementing this interface allows an object to hold information which are * essential for generating java doc from type definition. + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.DocumentedType} instead. */ +@Deprecated public interface DocumentedType { /** diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Enumeration.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Enumeration.java index 55f5c502af..d06e51e7b8 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Enumeration.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Enumeration.java @@ -13,7 +13,10 @@ import org.opendaylight.yangtools.yang.model.api.DocumentedNode; /** * Interface provide methods for reading data of enumeration class. + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.Enumeration} instead. */ +@Deprecated public interface Enumeration extends GeneratedType { /** diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedProperty.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedProperty.java index 0464db43bf..b18c40bdac 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedProperty.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedProperty.java @@ -14,7 +14,10 @@ package org.opendaylight.yangtools.sal.binding.model.api; * their access counterparts (getters and setters). * * @see MethodSignature + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.GeneratedProperty} instead. */ +@Deprecated public interface GeneratedProperty extends TypeMember { String getValue(); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedTransferIdentityObject.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedTransferIdentityObject.java index d9d7f320c4..f8973cc587 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedTransferIdentityObject.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedTransferIdentityObject.java @@ -7,6 +7,10 @@ */ package org.opendaylight.yangtools.sal.binding.model.api; +/** + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.GeneratedTransferIdentityObject} instead. + */ +@Deprecated public interface GeneratedTransferIdentityObject extends GeneratedTransferObject { diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedTransferObject.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedTransferObject.java index f96ade0f41..223a4312aa 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedTransferObject.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedTransferObject.java @@ -22,7 +22,9 @@ import org.opendaylight.yangtools.yang.model.api.TypeDefinition; * {@link #getEqualsIdentifiers ()}, {@link #getHashCodeIdentifiers()} and * {@link #getToStringIdentifiers ()}. * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.GeneratedTransferObject} instead. */ +@Deprecated public interface GeneratedTransferObject extends GeneratedType { GeneratedProperty getSUID(); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedType.java index 0e9b51ee74..d1d8ac0957 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedType.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/GeneratedType.java @@ -32,7 +32,10 @@ import java.util.List; * By the definition of the interface constant, enum, enclosed types and method * definitions MUST be public, so there is no need to specify the scope of * visibility. + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.GeneratedType} instead. */ +@Deprecated public interface GeneratedType extends Type, DocumentedType { /** diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/MethodSignature.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/MethodSignature.java index 00699b90b7..c7f61e784b 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/MethodSignature.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/MethodSignature.java @@ -20,7 +20,10 @@ import java.util.List; * null values.
* The defining Type contains the reference to Generated Type that declares * Method Signature. + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.MethodSignature} instead. */ +@Deprecated public interface MethodSignature extends TypeMember { /** @@ -30,7 +33,7 @@ public interface MethodSignature extends TypeMember { * 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. */ boolean isAbstract(); @@ -38,7 +41,7 @@ public interface MethodSignature extends TypeMember { /** * 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. */ List getParameters(); @@ -53,14 +56,14 @@ public interface MethodSignature extends TypeMember { /** * Returns the parameter name. - * + * * @return the parameter name. */ String getName(); /** * Returns Type that is bounded to parameter name. - * + * * @return Type that is bounded to parameter name. */ Type getType(); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/ParameterizedType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/ParameterizedType.java index 06b84987e2..0e797a562c 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/ParameterizedType.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/ParameterizedType.java @@ -13,7 +13,10 @@ package org.opendaylight.yangtools.sal.binding.model.api; * The parametrized Type is designed to be used to store information of Java * Generic Type. The array of {@link #getActualTypeArguments()} holds * information of all generic parameters defined for Parameterized Type. + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.ParameterizedType} instead. */ +@Deprecated public interface ParameterizedType extends Type { /** diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Restrictions.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Restrictions.java index 292b63244a..fee396941a 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Restrictions.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Restrictions.java @@ -13,6 +13,11 @@ import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint; import org.opendaylight.yangtools.yang.model.api.type.PatternConstraint; import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint; +/** + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.Restrictions} instead. + */ +@Deprecated public interface Restrictions { List getLengthConstraints(); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Type.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Type.java index c259d596ed..02355c6867 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Type.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/Type.java @@ -12,19 +12,21 @@ package org.opendaylight.yangtools.sal.binding.model.api; * Type defined in java MUST contain name and package name, except of primitive * types like int, byte etc. In case of mapping of primitive type the package * name MUST be left as empty string. - * + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.Type} instead. */ +@Deprecated public interface Type { /** * Returns name of the package that interface belongs to. - * + * * @return name of the package that interface belongs to */ String getPackageName(); /** * Returns name of the interface. - * + * * @return name of the interface. */ String getName(); @@ -38,7 +40,7 @@ public interface Type { *
  • If Type contains package name: [package name].[type name] (e.g * java.lang.Byte, org.opendaylight.controller.gen.GenType)
  • * - * + * * @return fully qualified name of Type. */ String getFullyQualifiedName(); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/TypeMember.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/TypeMember.java index 2447e21fee..89d33e3f72 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/TypeMember.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/TypeMember.java @@ -11,7 +11,10 @@ import java.util.List; /** * Common interface for variables and methods in class. + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.TypeMember} instead. */ +@Deprecated public interface TypeMember { /** diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/WildcardType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/WildcardType.java index 7246de6e24..b7d8946c8d 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/WildcardType.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/WildcardType.java @@ -8,11 +8,13 @@ package org.opendaylight.yangtools.sal.binding.model.api; /** - * + * * Marker interface which assign to object property that it is bounded wildcard * type. - * + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.WildcardType} instead. */ +@Deprecated public interface WildcardType extends Type { } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/AnnotationTypeBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/AnnotationTypeBuilder.java index c9ded321d3..5262d73148 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/AnnotationTypeBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/AnnotationTypeBuilder.java @@ -18,9 +18,12 @@ import org.opendaylight.yangtools.sal.binding.model.api.Type; * {@link Type} interface. The Annotation Type contains set of methods which are * capable to provide information about other Annotation Types and Annotation * Parameters. - * + * * @see AnnotationType + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.type.builder.AnnotationTypeBuilder} instead. */ +@Deprecated public interface AnnotationTypeBuilder extends Type { /** @@ -29,7 +32,7 @@ public interface AnnotationTypeBuilder extends Type { * Neither the package name or annotation name can contain null * references. In case that any of parameters contains null the * method SHOULD thrown {@link IllegalArgumentException} - * + * * @param packageName * Package Name of Annotation Type * @param name @@ -46,7 +49,7 @@ public interface AnnotationTypeBuilder extends Type { * Neither the param name or value can contain null references. * In case that any of parameters contains null the method * SHOULD thrown {@link IllegalArgumentException} - * + * * @param paramName * Parameter Name * @param value @@ -65,7 +68,7 @@ public interface AnnotationTypeBuilder extends Type { * Neither the param name or value can contain null references. * In case that any of parameters contains null the method * SHOULD thrown {@link IllegalArgumentException} - * + * * @param paramName * Parameter Name * @param values @@ -82,7 +85,7 @@ public interface AnnotationTypeBuilder extends Type { * modification to Annotation Type Builder will have an impact to * instantiated Annotation Type.
    * For this purpose call this method after all additions are complete. - * + * * @return new immutable instance of Annotation Type. */ AnnotationType toInstance(); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/ConstantBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/ConstantBuilder.java index de3f090601..52866fdfad 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/ConstantBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/ConstantBuilder.java @@ -12,7 +12,9 @@ import org.opendaylight.yangtools.sal.binding.model.api.Type; /** * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.type.builder.ConstantBuilder} instead. */ +@Deprecated public interface ConstantBuilder { void assignValue(final Object value); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/EnumBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/EnumBuilder.java index c0a99b9845..29849cdba9 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/EnumBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/EnumBuilder.java @@ -16,7 +16,10 @@ import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition; * Enumeration definition. * * @see Enumeration + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.type.builder.EnumBuilder} instead. */ +@Deprecated public interface EnumBuilder extends Type { /** diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedPropertyBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedPropertyBuilder.java index cd4b9b4575..746e8f9927 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedPropertyBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedPropertyBuilder.java @@ -15,7 +15,10 @@ import org.opendaylight.yangtools.sal.binding.model.api.Type; * instantiate Generated Property definition. * * @see GeneratedProperty + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedPropertyBuilder} instead. */ +@Deprecated public interface GeneratedPropertyBuilder extends TypeMemberBuilder { GeneratedPropertyBuilder setValue(String value); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedTOBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedTOBuilder.java index ca25dade4f..33f7d4f6ba 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedTOBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedTOBuilder.java @@ -16,7 +16,10 @@ import org.opendaylight.yangtools.yang.model.api.TypeDefinition; * and instantiate Generated Transfer Object definition. * * @see GeneratedTransferObject + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTOBuilder} instead. */ +@Deprecated public interface GeneratedTOBuilder extends GeneratedTypeBuilderBase { /** diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedTypeBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedTypeBuilder.java index 9756bd2092..c6783f7cc1 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedTypeBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedTypeBuilder.java @@ -12,14 +12,17 @@ import org.opendaylight.yangtools.sal.binding.model.api.GeneratedType; /** * Generated Type Builder interface is helper interface for building and * defining the GeneratedType. - * + * * @see GeneratedType + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilder} instead. */ +@Deprecated public interface GeneratedTypeBuilder extends GeneratedTypeBuilderBase { /** * Returns the new immutable instance of Generated Type. - * + * * @return the new immutable instance of Generated Type. */ GeneratedType toInstance(); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedTypeBuilderBase.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedTypeBuilderBase.java index cc95e198ab..674dfc0842 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedTypeBuilderBase.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/GeneratedTypeBuilderBase.java @@ -13,6 +13,10 @@ import org.opendaylight.yangtools.sal.binding.model.api.Constant; import org.opendaylight.yangtools.sal.binding.model.api.Type; import org.opendaylight.yangtools.yang.common.QName; +/** + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilderBase} instead. + */ +@Deprecated public interface GeneratedTypeBuilderBase> extends Type { /** diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/MethodSignatureBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/MethodSignatureBuilder.java index 71374525b7..5e49295f72 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/MethodSignatureBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/MethodSignatureBuilder.java @@ -24,7 +24,10 @@ import org.opendaylight.yangtools.sal.binding.model.api.Type; * * * @see MethodSignature + * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.type.builder.MethodSignatureBuilder} instead. */ +@Deprecated public interface MethodSignatureBuilder extends TypeMemberBuilder { /** diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/TypeMemberBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/TypeMemberBuilder.java index aa44be4ef9..dda30bac6b 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/TypeMemberBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/yangtools/sal/binding/model/api/type/builder/TypeMemberBuilder.java @@ -11,8 +11,9 @@ import org.opendaylight.yangtools.sal.binding.model.api.AccessModifier; import org.opendaylight.yangtools.sal.binding.model.api.Type; /** - * + * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.type.builder.TypeMemberBuilder} instead. */ +@Deprecated public interface TypeMemberBuilder> { /**