Search in sources :

Example 1 with AbstractFactoryTemplate

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());
}
Also used : AbstractFactoryTemplate(org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractFactoryTemplate) FullyQualifiedName(org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName) ArrayList(java.util.ArrayList)

Example 2 with AbstractFactoryTemplate

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);
}
Also used : AbstractFactoryTemplate(org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractFactoryTemplate) ModuleMXBeanEntry(org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry) Test(org.junit.Test)

Aggregations

AbstractFactoryTemplate (org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractFactoryTemplate)2 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 ModuleMXBeanEntry (org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry)1 FullyQualifiedName (org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName)1