Search in sources :

Example 1 with Digester

use of org.apache.commons.digester3.Digester in project hudson-2.x by hudson.

the class ExtractChangeLogParser method parse.

public ExtractChangeLogSet parse(AbstractBuild build, InputStream changeLogStream) throws IOException, SAXException {
    ArrayList<ExtractChangeLogEntry> changeLog = new ArrayList<ExtractChangeLogEntry>();
    Digester digester = new Digester();
    digester.setClassLoader(ExtractChangeLogSet.class.getClassLoader());
    digester.push(changeLog);
    digester.addObjectCreate("*/extractChanges/entry", ExtractChangeLogEntry.class);
    digester.addBeanPropertySetter("*/extractChanges/entry/zipFile");
    digester.addObjectCreate("*/extractChanges/entry/file", FileInZip.class);
    digester.addBeanPropertySetter("*/extractChanges/entry/file/fileName");
    digester.addSetNext("*/extractChanges/entry/file", "addFile");
    digester.addSetNext("*/extractChanges/entry", "add");
    digester.parse(changeLogStream);
    return new ExtractChangeLogSet(build, changeLog);
}
Also used : Digester(org.apache.commons.digester3.Digester) ArrayList(java.util.ArrayList)

Example 2 with Digester

use of org.apache.commons.digester3.Digester in project ocvn by devgateway.

the class XMLFileImport method process.

@Async
public void process(final InputStream inputStream) throws IOException, SAXException {
    DigesterLoader digesterLoader = DigesterLoader.newLoader(getAbstractRulesModule());
    Digester digester = digesterLoader.newDigester();
    // Push this object onto Digester's stack to handle object save operation (call saveRelease method)
    digester.push(this);
    digester.parse(inputStream);
}
Also used : DigesterLoader(org.apache.commons.digester3.binder.DigesterLoader) Digester(org.apache.commons.digester3.Digester) Async(org.springframework.scheduling.annotation.Async)

Aggregations

Digester (org.apache.commons.digester3.Digester)2 ArrayList (java.util.ArrayList)1 DigesterLoader (org.apache.commons.digester3.binder.DigesterLoader)1 Async (org.springframework.scheduling.annotation.Async)1