2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.sal.binding.model.api.type.builder;
10 import java.util.List;
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;
17 * @deprecated Use {@link org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilderBase} instead.
20 public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>> extends Type {
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}
34 * Name of Enclosing Type
35 * @return <code>new</code> Instance of Generated Type Builder.
37 GeneratedTOBuilder addEnclosingTransferObject(String name);
40 * Adds new Enclosing Transfer Object <code>genTOBuilder</code> into
41 * definition of Generated Type
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}
54 * Name of Enclosing Type
56 T addEnclosingTransferObject(GeneratedTOBuilder genTOBuilder);
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.
66 T addComment(String comment);
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}
76 * Package Name of Annotation Type
78 * Name of Annotation Type
79 * @return <code>new</code> instance of Annotation Type Builder.
81 AnnotationTypeBuilder addAnnotation(String packageName, String name);
86 * Sets the <code>abstract</code> flag to define Generated Type as
87 * <i>abstract</i> type.
92 T setAbstract(boolean isAbstract);
94 List<Type> getImplementsTypes();
97 * Add Type to implements.
101 * @return <code>true</code> if the addition of type is successful.
103 T addImplementsType(Type genType);
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.
118 * @return <code>new</code> Constant instance.
120 Constant addConstant(Type type, String name, Object value);
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}
133 * @return <code>new</code> instance of Enumeration Builder.
135 EnumBuilder addEnumeration(String name);
137 List<MethodSignatureBuilder> getMethodDefinitions();
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)}
151 * @return <code>new</code> instance of Method Signature Builder.
153 MethodSignatureBuilder addMethod(String name);
156 * Checks if GeneratedTypeBuilder contains method with name
157 * <code>methodName</code>
162 boolean containsMethod(String methodName);
164 List<GeneratedPropertyBuilder> getProperties();
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}
174 * @return <code>new</code> instance of Generated Property Builder.
176 GeneratedPropertyBuilder addProperty(String name);
179 * Check whether GeneratedTOBuilder contains property with name
183 * of property which existance is checked
184 * @return true if property <code>name</code> exists in list of properties.
186 boolean containsProperty(String name);
189 * Set a string that contains a human-readable textual description of type
193 * a string that contains a human-readable textual description of
196 void setDescription(String description);
199 * Set the name of the module, in which generated type was specified.
202 * the name of the module
204 void setModuleName(String moduleName);
207 * Set a list of QNames which represent schema path in schema tree from
208 * actual concrete type to the root.
211 * a list of QNames which represent schema path in schema tree
213 void setSchemaPath(Iterable<QName> schemaPath);
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.
222 * a textual cross-reference to an external document.
224 void setReference(String reference);