Search in sources :

Example 1 with AbstractModuleTemplate

use of org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractModuleTemplate in project controller by opendaylight.

the class AbsModuleGeneratedObjectFactory method toGeneratedObject.

public GeneratedObject toGeneratedObject(ModuleMXBeanEntry mbe, Optional<String> copyright) {
    FullyQualifiedName abstractFQN = new FullyQualifiedName(mbe.getPackageName(), mbe.getAbstractModuleName());
    Optional<String> classJavaDoc = Optional.fromNullable(mbe.getNullableDescription());
    AbstractModuleTemplate abstractModuleTemplate = TemplateFactory.abstractModuleTemplateFromMbe(mbe);
    Optional<String> header = abstractModuleTemplate.getHeaderString();
    List<FullyQualifiedName> implementedInterfaces = Lists.transform(abstractModuleTemplate.getTypeDeclaration().getImplemented(), FullyQualifiedName::fromString);
    Optional<FullyQualifiedName> extended = Optional.fromNullable(Iterables.getFirst(Collections2.transform(abstractModuleTemplate.getTypeDeclaration().getExtended(), FullyQualifiedName::fromString), null));
    Optional<FullyQualifiedName> maybeRegistratorType;
    if (abstractModuleTemplate.isRuntime()) {
        maybeRegistratorType = Optional.of(FullyQualifiedName.fromString(abstractModuleTemplate.getRegistratorType()));
    } else {
        maybeRegistratorType = Optional.absent();
    }
    return toGeneratedObject(abstractFQN, copyright, header, classJavaDoc, extended, implementedInterfaces, abstractModuleTemplate.getModuleFields(), maybeRegistratorType, abstractModuleTemplate.getMethods(), mbe.getYangModuleQName());
}
Also used : FullyQualifiedName(org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName) AbstractModuleTemplate(org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractModuleTemplate)

Aggregations

AbstractModuleTemplate (org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractModuleTemplate)1 FullyQualifiedName (org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName)1