Java 类org.apache.maven.model.io.DefaultModelWriter 实例源码

项目:elpaaso-core    文件:PomGenerator.java   
/**
 * Generate a pom.xml file from a MavenProject description
 * @return
 */
private String modelToStringXml(Model model) {

    DefaultModelWriter modelWriter = new DefaultModelWriter();

    StringWriter output = new StringWriter();
    String result = "";
    try {
        modelWriter.write(output, null, model);
        result = output.getBuffer().toString();
    } catch (IOException e) {
        logger.error("Cannot convert model to pom: " + e.getMessage());
        throw new TechnicalException("Cannot convert model to pom", e);
    }
    return result;
}
项目:neoscada    文件:ChangeManager.java   
public ChangeManager ( final Log log )
{
    this.log = log;
    this.writer = new DefaultModelWriter ();
    this.reader = new DefaultModelReader ();
}