Package net.riccardocossu.autodoc.base

Examples of net.riccardocossu.autodoc.base.OutputPlugin


  @Test
  public void testHTMLShortName() {
    // tests that the JPA plugin is configurable through its short name
    PluginFactory factory = new PluginFactory();
    OutputPlugin op = factory.initOutputPlugin("HTML", null);
    assertNotNull(op);
  }
View Full Code Here


  @Test(expected = IllegalArgumentException.class)
  public void testHTMLNoConfig() {
    // tests that the JPA plugin is configurable through its short name
    PluginFactory factory = new PluginFactory();
    OutputPlugin op = factory.initOutputPlugin("HTML",
        "nonExistingConfig.xml");
    assertNotNull(op);
  }
View Full Code Here

  @Test
  public void testHTMLWithConfig() {
    // tests that the HTML plugin is configurable through its short name,
    // using the provided configuration
    PluginFactory factory = new PluginFactory();
    OutputPlugin op = factory.initOutputPlugin("HTML",
        "htmlOutputPlugin.properties");
    assertNotNull(op);
    assertTrue(op instanceof HtmlOutputPlugin);
    HtmlOutputPlugin html = (HtmlOutputPlugin) op;
    assertEquals("/html/templates", html.getBaseTemplatePath());
View Full Code Here

   *            plugin is left to its default configuration
   * @return the configured plugin instance if everything is ok
   */
  public OutputPlugin initOutputPlugin(String identifier,
      String configResource) {
    OutputPlugin pl = outputPluginsByShortName.get(identifier);
    if (pl == null) {
      try {
        Class<?> clazz = Class.forName(identifier);
        pl = (OutputPlugin) clazz.newInstance();
      } catch (Exception e) {
        throw new IllegalArgumentException("Unable to locate plugin "
            + identifier, e);
      }
    }
    if (pl != null && configResource != null) {
      pl.configure(configResource);
    }
    return pl;
  }
View Full Code Here

        String[] splittedPackage = p.split(",");
        // identifier is mandatory and it's always the first part
        String identifier = splittedPackage[0];
        String configResource = splittedPackage.length > 1 ? splittedPackage[1]
            : null;
        OutputPlugin pl = factory.initOutputPlugin(identifier,
            configResource);
        pl.process(parsedPackages, baseOutputDirectory);
      } catch (Exception e) {
        log.error("Error including or executing output plugin " + p, e);
      }
    }
    return parsedPackages;
View Full Code Here

TOP

Related Classes of net.riccardocossu.autodoc.base.OutputPlugin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.