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;
16 public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>> extends Type {
19 * Adds new Enclosing Transfer Object into definition of Generated Type and
20 * returns <code>new</code> Instance of Generated TO Builder. <br>
21 * There is no need of specifying of Package Name because enclosing Type is
22 * already defined inside Generated Type with specific package name. <br>
23 * The name of enclosing Type cannot be same as Name of parent type and if
24 * there is already defined enclosing type with the same name, the new
25 * enclosing type will simply overwrite the older definition. <br>
26 * If the name of enclosing type is <code>null</code> the method SHOULD
27 * throw {@link IllegalArgumentException}
30 * Name of Enclosing Type
31 * @return <code>new</code> Instance of Generated Type Builder.
33 GeneratedTOBuilder addEnclosingTransferObject(final String name);
36 * Adds new Enclosing Transfer Object <code>genTOBuilder</code> into
37 * definition of Generated Type
40 * There is no need of specifying of Package Name because enclosing Type is
41 * already defined inside Generated Type with specific package name. <br>
42 * The name of enclosing Type cannot be same as Name of parent type and if
43 * there is already defined enclosing type with the same name, the new
44 * enclosing type will simply overwrite the older definition. <br>
45 * If the parameter <code>genTOBuilder</code> of enclosing type is
46 * <code>null</code> the method SHOULD throw
47 * {@link IllegalArgumentException}
50 * Name of Enclosing Type
52 T addEnclosingTransferObject(final GeneratedTOBuilder genTOBuilder);
55 * Adds String definition of comment into Method Signature definition. <br>
56 * The comment String MUST NOT contain anny comment specific chars (i.e.
57 * "/**" or "//") just plain String text description.
62 T addComment(final String comment);
65 * The method creates new AnnotationTypeBuilder containing specified package
66 * name an annotation name. <br>
67 * Neither the package name or annotation name can contain <code>null</code>
68 * references. In case that any of parameters contains <code>null</code> the
69 * method SHOULD thrown {@link IllegalArgumentException}
72 * Package Name of Annotation Type
74 * Name of Annotation Type
75 * @return <code>new</code> instance of Annotation Type Builder.
77 AnnotationTypeBuilder addAnnotation(final String packageName, final String name);
82 * Sets the <code>abstract</code> flag to define Generated Type as
83 * <i>abstract</i> type.
88 T setAbstract(boolean isAbstract);
90 List<Type> getImplementsTypes();
93 * Add Type to implements.
97 * @return <code>true</code> if the addition of type is successful.
99 T addImplementsType(final Type genType);
102 * Adds Constant definition and returns <code>new</code> Constant instance. <br>
103 * By definition Constant MUST be defined by return Type, Name and assigned
104 * value. The name SHOULD be defined with capital letters. Neither of method
105 * parameters can be <code>null</code> and the method SHOULD throw
106 * {@link IllegalArgumentException} if the contract is broken.
114 * @return <code>new</code> Constant instance.
116 Constant addConstant(final Type type, final String name, final Object value);
119 * Adds new Enumeration definition for Generated Type Builder and returns
120 * Enum Builder for specifying all Enum parameters. <br>
121 * If there is already Enumeration stored with the same name, the old enum
122 * will be simply overwritten byt new enum definition. <br>
123 * Name of Enumeration cannot be <code>null</code>, if it is
124 * <code>null</code> the method SHOULD throw
125 * {@link IllegalArgumentException}
129 * @return <code>new</code> instance of Enumeration Builder.
131 EnumBuilder addEnumeration(final String name);
133 List<MethodSignatureBuilder> getMethodDefinitions();
136 * Add new Method Signature definition for Generated Type Builder and
137 * returns Method Signature Builder for specifying all Method parameters. <br>
138 * Name of Method cannot be <code>null</code>, if it is <code>null</code>
139 * the method SHOULD throw {@link IllegalArgumentException} <br>
140 * By <i>Default</i> the MethodSignatureBuilder SHOULD be pre-set as
141 * {@link MethodSignatureBuilder#setAbstract(boolean)},
142 * {TypeMemberBuilder#setFinal(boolean)} and
143 * {TypeMemberBuilder#setAccessModifier(boolean)}
147 * @return <code>new</code> instance of Method Signature Builder.
149 MethodSignatureBuilder addMethod(final String name);
152 * Checks if GeneratedTypeBuilder contains method with name
153 * <code>methodName</code>
158 boolean containsMethod(final String methodName);
160 List<GeneratedPropertyBuilder> getProperties();
163 * Add new Generated Property definition for Generated Transfer Object
164 * Builder and returns Generated Property Builder for specifying Property. <br>
165 * Name of Property cannot be <code>null</code>, if it is <code>null</code>
166 * the method SHOULD throw {@link IllegalArgumentException}
170 * @return <code>new</code> instance of Generated Property Builder.
172 GeneratedPropertyBuilder addProperty(final String name);
175 * Check whether GeneratedTOBuilder contains property with name
179 * of property which existance is checked
180 * @return true if property <code>name</code> exists in list of properties.
182 boolean containsProperty(final String name);
185 * Set a string that contains a human-readable textual description of type
189 * a string that contains a human-readable textual description of
192 public void setDescription(String description);
195 * Set the name of the module, in which generated type was specified.
198 * the name of the module
200 public void setModuleName(String moduleName);
203 * Set a list of QNames which represent schema path in schema tree from
204 * actual concrete type to the root.
207 * a list of QNames which represent schema path in schema tree
209 public void setSchemaPath(Iterable<QName> schemaPath);
212 * Set a string that is used to specify a textual cross-reference to an
213 * external document, either another module that defines related management
214 * information, or a document that provides additional information relevant
215 * to this definition.
218 * a textual cross-reference to an external document.
220 public void setReference(String reference);