Closed LeMoussel closed 4 years ago
The mapping is not automatic. Try having your listener also implement IXMLConfigurable
and add somethign like this:
@Override
public void loadFromXML(Reader in) throws IOException {
XMLConfiguration xml = XMLConfigurationUtil.newXMLConfiguration(in);
outputFile = xml.getString("outputFile", outputFile));
}
@Override
public void saveToXML(Writer out) throws IOException {
// You can leave this method blank if you have no use for savign back the XML
try {
EnhancedXMLStreamWriter writer = new EnhancedXMLStreamWriter(out);
writer.writeStartElement("listener");
writer.writeAttribute("class", getClass().getCanonicalName());
writer.writeElementString("outputFile", outputFile);
writer.writeEndElement();
writer.flush();
writer.close();
} catch (XMLStreamException e) {
throw new IOException("Cannot save as XML.", e);
}
}
OK. Thank you Pascal for your help.
I implementing this :
with this config :
Variable
outputFile
is not filled (always null value). It should have the valuetest.tsv
I don't understand why .....