use of org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractFactoryTemplate in project controller by opendaylight.
the class AbsFactoryGeneratedObjectFactory method toGeneratedObject.
public GeneratedObject toGeneratedObject(ModuleMXBeanEntry mbe, Optional<String> copyright) {
FullyQualifiedName absFactoryFQN = new FullyQualifiedName(mbe.getPackageName(), mbe.getAbstractFactoryName());
FullyQualifiedName moduleFQN = new FullyQualifiedName(mbe.getPackageName(), mbe.getStubModuleName());
Optional<String> classJavaDoc = Optional.fromNullable(mbe.getNullableDescription());
AbstractFactoryTemplate abstractFactoryTemplate = TemplateFactory.abstractFactoryTemplateFromMbe(mbe);
Optional<String> header = abstractFactoryTemplate.getHeaderString();
List<FullyQualifiedName> providedServices = new ArrayList<>();
for (String providedService : mbe.getProvidedServices().keySet()) {
providedServices.add(FullyQualifiedName.fromString(providedService));
}
return toGeneratedObject(absFactoryFQN, copyright, header, classJavaDoc, mbe.getYangModuleQName(), mbe.getGloballyUniqueName(), providedServices, moduleFQN, abstractFactoryTemplate.getFields());
}
use of org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractFactoryTemplate in project controller by opendaylight.
the class ModuleMXBeanEntryTemplatesTest method test.
@Test
public void test() {
final ModuleMXBeanEntry mbe = mockMbe("package");
final AbstractFactoryTemplate template = TemplateFactory.abstractFactoryTemplateFromMbe(mbe);
assertNotNull(template);
}
Aggregations