BindingGeneratorImpl Javadoc & code clean-up
[mdsal.git] / binding / mdsal-binding-generator-api / src / main / java / org / opendaylight / yangtools / sal / binding / model / api / type / builder / GeneratedTypeBuilderBase.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.sal.binding.model.api.type.builder;
9
10 import java.util.List;
11
12 import org.opendaylight.yangtools.sal.binding.model.api.Constant;
13 import org.opendaylight.yangtools.sal.binding.model.api.Type;
14 import org.opendaylight.yangtools.yang.common.QName;
15
16 /**
17  * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilderBase} instead.
18  */
19 @Deprecated
20 public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>> extends Type {
21
22     /**
23      * Adds new Enclosing Transfer Object into definition of Generated Type and
24      * returns <code>new</code> Instance of Generated TO Builder. <br>
25      * There is no need of specifying of Package Name because enclosing Type is
26      * already defined inside Generated Type with specific package name. <br>
27      * The name of enclosing Type cannot be same as Name of parent type and if
28      * there is already defined enclosing type with the same name, the new
29      * enclosing type will simply overwrite the older definition. <br>
30      * If the name of enclosing type is <code>null</code> the method SHOULD
31      * throw {@link IllegalArgumentException}
32      *
33      * @param name
34      *            Name of Enclosing Type
35      * @return <code>new</code> Instance of Generated Type Builder.
36      */
37     GeneratedTOBuilder addEnclosingTransferObject(String name);
38
39     /**
40      * Adds new Enclosing Transfer Object <code>genTOBuilder</code> into
41      * definition of Generated Type
42      *
43      * <br>
44      * There is no need of specifying of Package Name because enclosing Type is
45      * already defined inside Generated Type with specific package name. <br>
46      * The name of enclosing Type cannot be same as Name of parent type and if
47      * there is already defined enclosing type with the same name, the new
48      * enclosing type will simply overwrite the older definition. <br>
49      * If the parameter <code>genTOBuilder</code> of enclosing type is
50      * <code>null</code> the method SHOULD throw
51      * {@link IllegalArgumentException}
52      *
53      * @param genTOBuilder
54      *            Name of Enclosing Type
55      */
56     T addEnclosingTransferObject(GeneratedTOBuilder genTOBuilder);
57
58     /**
59      * Adds String definition of comment into Method Signature definition. <br>
60      * The comment String MUST NOT contain anny comment specific chars (i.e.
61      * "/**" or "//") just plain String text description.
62      *
63      * @param comment
64      *            Comment String.
65      */
66     T addComment(String comment);
67
68     /**
69      * The method creates new AnnotationTypeBuilder containing specified package
70      * name an annotation name. <br>
71      * Neither the package name or annotation name can contain <code>null</code>
72      * references. In case that any of parameters contains <code>null</code> the
73      * method SHOULD thrown {@link IllegalArgumentException}
74      *
75      * @param packageName
76      *            Package Name of Annotation Type
77      * @param name
78      *            Name of Annotation Type
79      * @return <code>new</code> instance of Annotation Type Builder.
80      */
81     AnnotationTypeBuilder addAnnotation(String packageName, String name);
82
83     boolean isAbstract();
84
85     /**
86      * Sets the <code>abstract</code> flag to define Generated Type as
87      * <i>abstract</i> type.
88      *
89      * @param isAbstract
90      *            abstract flag
91      */
92     T setAbstract(boolean isAbstract);
93
94     List<Type> getImplementsTypes();
95
96     /**
97      * Add Type to implements.
98      *
99      * @param genType
100      *            Type to implement
101      * @return <code>true</code> if the addition of type is successful.
102      */
103     T addImplementsType(Type genType);
104
105     /**
106      * Adds Constant definition and returns <code>new</code> Constant instance. <br>
107      * By definition Constant MUST be defined by return Type, Name and assigned
108      * value. The name SHOULD be defined with capital letters. Neither of method
109      * parameters can be <code>null</code> and the method SHOULD throw
110      * {@link IllegalArgumentException} if the contract is broken.
111      *
112      * @param type
113      *            Constant Type
114      * @param name
115      *            Name of Constant
116      * @param value
117      *            Assigned Value
118      * @return <code>new</code> Constant instance.
119      */
120     Constant addConstant(Type type, String name, Object value);
121
122     /**
123      * Adds new Enumeration definition for Generated Type Builder and returns
124      * Enum Builder for specifying all Enum parameters. <br>
125      * If there is already Enumeration stored with the same name, the old enum
126      * will be simply overwritten byt new enum definition. <br>
127      * Name of Enumeration cannot be <code>null</code>, if it is
128      * <code>null</code> the method SHOULD throw
129      * {@link IllegalArgumentException}
130      *
131      * @param name
132      *            Enumeration Name
133      * @return <code>new</code> instance of Enumeration Builder.
134      */
135     EnumBuilder addEnumeration(String name);
136
137     List<MethodSignatureBuilder> getMethodDefinitions();
138
139     /**
140      * Add new Method Signature definition for Generated Type Builder and
141      * returns Method Signature Builder for specifying all Method parameters. <br>
142      * Name of Method cannot be <code>null</code>, if it is <code>null</code>
143      * the method SHOULD throw {@link IllegalArgumentException} <br>
144      * By <i>Default</i> the MethodSignatureBuilder SHOULD be pre-set as
145      * {@link MethodSignatureBuilder#setAbstract(boolean)},
146      * {TypeMemberBuilder#setFinal(boolean)} and
147      * {TypeMemberBuilder#setAccessModifier(boolean)}
148      *
149      * @param name
150      *            Name of Method
151      * @return <code>new</code> instance of Method Signature Builder.
152      */
153     MethodSignatureBuilder addMethod(String name);
154
155     /**
156      * Checks if GeneratedTypeBuilder contains method with name
157      * <code>methodName</code>
158      *
159      * @param methodName
160      *            is method name
161      */
162     boolean containsMethod(String methodName);
163
164     List<GeneratedPropertyBuilder> getProperties();
165
166     /**
167      * Add new Generated Property definition for Generated Transfer Object
168      * Builder and returns Generated Property Builder for specifying Property. <br>
169      * Name of Property cannot be <code>null</code>, if it is <code>null</code>
170      * the method SHOULD throw {@link IllegalArgumentException}
171      *
172      * @param name
173      *            Name of Property
174      * @return <code>new</code> instance of Generated Property Builder.
175      */
176     GeneratedPropertyBuilder addProperty(String name);
177
178     /**
179      * Check whether GeneratedTOBuilder contains property with name
180      * <code>name</code>
181      *
182      * @param name
183      *            of property which existance is checked
184      * @return true if property <code>name</code> exists in list of properties.
185      */
186     boolean containsProperty(String name);
187
188     /**
189      * Set a string that contains a human-readable textual description of type
190      * definition.
191      *
192      * @param description
193      *            a string that contains a human-readable textual description of
194      *            type definition.
195      */
196     void setDescription(String description);
197
198     /**
199      * Set the name of the module, in which generated type was specified.
200      *
201      * @param moduleName
202      *            the name of the module
203      */
204     void setModuleName(String moduleName);
205
206     /**
207      * Set a list of QNames which represent schema path in schema tree from
208      * actual concrete type to the root.
209      *
210      * @param schemaPath
211      *            a list of QNames which represent schema path in schema tree
212      */
213     void setSchemaPath(Iterable<QName> schemaPath);
214
215     /**
216      * Set a string that is used to specify a textual cross-reference to an
217      * external document, either another module that defines related management
218      * information, or a document that provides additional information relevant
219      * to this definition.
220      *
221      * @param reference
222      *            a textual cross-reference to an external document.
223      */
224     void setReference(String reference);
225
226 }