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;
11 import org.opendaylight.yangtools.sal.binding.model.api.Constant;
12 import org.opendaylight.yangtools.sal.binding.model.api.Type;
13 import org.opendaylight.yangtools.yang.common.QName;
15 public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>> extends Type {
18 * Adds new Enclosing Transfer Object into definition of Generated Type and
19 * returns <code>new</code> Instance of Generated TO Builder. <br>
20 * There is no need of specifying of Package Name because enclosing Type is
21 * already defined inside Generated Type with specific package name. <br>
22 * The name of enclosing Type cannot be same as Name of parent type and if
23 * there is already defined enclosing type with the same name, the new
24 * enclosing type will simply overwrite the older definition. <br>
25 * If the name of enclosing type is <code>null</code> the method SHOULD
26 * throw {@link IllegalArgumentException}
29 * Name of Enclosing Type
30 * @return <code>new</code> Instance of Generated Type Builder.
32 GeneratedTOBuilder addEnclosingTransferObject(String name);
35 * Adds new Enclosing Transfer Object <code>genTOBuilder</code> into
36 * definition of Generated Type
39 * There is no need of specifying of Package Name because enclosing Type is
40 * already defined inside Generated Type with specific package name. <br>
41 * The name of enclosing Type cannot be same as Name of parent type and if
42 * there is already defined enclosing type with the same name, the new
43 * enclosing type will simply overwrite the older definition. <br>
44 * If the parameter <code>genTOBuilder</code> of enclosing type is
45 * <code>null</code> the method SHOULD throw
46 * {@link IllegalArgumentException}
49 * Name of Enclosing Type
51 T addEnclosingTransferObject(GeneratedTOBuilder genTOBuilder);
54 * Adds String definition of comment into Method Signature definition. <br>
55 * The comment String MUST NOT contain anny comment specific chars (i.e.
56 * "/**" or "//") just plain String text description.
61 T addComment(String comment);
64 * The method creates new AnnotationTypeBuilder containing specified package
65 * name an annotation name. <br>
66 * Neither the package name or annotation name can contain <code>null</code>
67 * references. In case that any of parameters contains <code>null</code> the
68 * method SHOULD thrown {@link IllegalArgumentException}
71 * Package Name of Annotation Type
73 * Name of Annotation Type
74 * @return <code>new</code> instance of Annotation Type Builder.
76 AnnotationTypeBuilder addAnnotation(String packageName, String name);
81 * Sets the <code>abstract</code> flag to define Generated Type as
82 * <i>abstract</i> type.
87 T setAbstract(boolean isAbstract);
89 List<Type> getImplementsTypes();
92 * Add Type to implements.
96 * @return <code>true</code> if the addition of type is successful.
98 T addImplementsType(Type genType);
101 * Adds Constant definition and returns <code>new</code> Constant instance. <br>
102 * By definition Constant MUST be defined by return Type, Name and assigned
103 * value. The name SHOULD be defined with capital letters. Neither of method
104 * parameters can be <code>null</code> and the method SHOULD throw
105 * {@link IllegalArgumentException} if the contract is broken.
113 * @return <code>new</code> Constant instance.
115 Constant addConstant(Type type, String name, Object value);
118 * Adds new Enumeration definition for Generated Type Builder and returns
119 * Enum Builder for specifying all Enum parameters. <br>
120 * If there is already Enumeration stored with the same name, the old enum
121 * will be simply overwritten byt new enum definition. <br>
122 * Name of Enumeration cannot be <code>null</code>, if it is
123 * <code>null</code> the method SHOULD throw
124 * {@link IllegalArgumentException}
128 * @return <code>new</code> instance of Enumeration Builder.
130 EnumBuilder addEnumeration(String name);
132 List<MethodSignatureBuilder> getMethodDefinitions();
135 * Add new Method Signature definition for Generated Type Builder and
136 * returns Method Signature Builder for specifying all Method parameters. <br>
137 * Name of Method cannot be <code>null</code>, if it is <code>null</code>
138 * the method SHOULD throw {@link IllegalArgumentException} <br>
139 * By <i>Default</i> the MethodSignatureBuilder SHOULD be pre-set as
140 * {@link MethodSignatureBuilder#setAbstract(boolean)},
141 * {TypeMemberBuilder#setFinal(boolean)} and
142 * {TypeMemberBuilder#setAccessModifier(boolean)}
146 * @return <code>new</code> instance of Method Signature Builder.
148 MethodSignatureBuilder addMethod(String name);
151 * Checks if GeneratedTypeBuilder contains method with name
152 * <code>methodName</code>
157 boolean containsMethod(String methodName);
159 List<GeneratedPropertyBuilder> getProperties();
162 * Add new Generated Property definition for Generated Transfer Object
163 * Builder and returns Generated Property Builder for specifying Property. <br>
164 * Name of Property cannot be <code>null</code>, if it is <code>null</code>
165 * the method SHOULD throw {@link IllegalArgumentException}
169 * @return <code>new</code> instance of Generated Property Builder.
171 GeneratedPropertyBuilder addProperty(String name);
174 * Check whether GeneratedTOBuilder contains property with name
178 * of property which existance is checked
179 * @return true if property <code>name</code> exists in list of properties.
181 boolean containsProperty(String name);
184 * Set a string that contains a human-readable textual description of type
188 * a string that contains a human-readable textual description of
191 public void setDescription(String description);
194 * Set the name of the module, in which generated type was specified.
197 * the name of the module
199 public void setModuleName(String moduleName);
202 * Set a list of QNames which represent schema path in schema tree from
203 * actual concrete type to the root.
206 * a list of QNames which represent schema path in schema tree
208 public void setSchemaPath(Iterable<QName> schemaPath);
211 * Set a string that is used to specify a textual cross-reference to an
212 * external document, either another module that defines related management
213 * information, or a document that provides additional information relevant
214 * to this definition.
217 * a textual cross-reference to an external document.
219 public void setReference(String reference);