import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack;
/**
- * An implicit {@link Generator}, not associated with any particular statement.
+ * An implicit {@link Generator}, not associated with any particular statement. We use these only for aggregate services
+ * harking back to the original specification for Java 7. As such we want to eventually get rid of it.
*/
+// FIXME: eventually remove this subclass and unify Generator and AbstractExplicitGenerator
abstract class AbstractImplicitGenerator extends Generator {
AbstractImplicitGenerator(final ModuleGenerator parent) {
super(parent);
/**
* A single node in generator tree. Each node will eventually resolve to a generated Java class. Each node also can have
* a number of children, which are generators corresponding to the YANG subtree of this node.
+ *
+ * <p>
+ * Each tree is rooted in a {@link ModuleGenerator} and its organization follows roughly YANG {@code schema tree}
+ * layout, but with a twist coming from the reuse of generated interfaces from a {@code grouping} in the location of
+ * every {@code uses} encountered and also the corresponding backwards propagation of {@code augment} effects.
+ *
+ * <p>
+ * Overall the tree layout guides the allocation of Java package and top-level class namespaces.
*/
public abstract class Generator implements Iterable<Generator> {
private static final JavaTypeName DEPRECATED_ANNOTATION = JavaTypeName.create(Deprecated.class);
import org.opendaylight.yangtools.yang.model.api.Status;
import org.opendaylight.yangtools.yang.model.api.stmt.NotificationEffectiveStatement;
+/**
+ * Aggregate service for top-level {@code notification} statements for a particular module. It does not handle nested
+ * (YANG 1.1) notifications.
+ */
+// FIXME: eventually remove this generator
final class NotificationServiceGenerator extends AbstractImplicitGenerator {
private final List<NotificationGenerator> notifs;
@Override
GeneratedType createTypeImpl(final TypeBuilderFactory builderFactory) {
final GeneratedTypeBuilder builder = builderFactory.newGeneratedTypeBuilder(typeName());
+ // FIXME: MDSAL-496: mark this interface as deprecated
builder.addImplementsType(BindingTypes.NOTIFICATION_LISTENER);
for (NotificationGenerator gen : notifs) {
import org.opendaylight.yangtools.yang.model.api.stmt.OutputEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.RpcEffectiveStatement;
+/**
+ * Aggregate service for top-level {@code rpc} statements for a particular module.
+ */
+// FIXME: eventually remove this generator
final class RpcServiceGenerator extends AbstractImplicitGenerator {
private static final JavaTypeName CHECK_RETURN_VALUE_ANNOTATION =
// Do not refer to annotation class, as it may not be available at runtime