Create XRechnungImporter to import data from raw xml
The XRechnungImporter extends from ZUGFeRDImporter. It simply sets the given raw xml and provides otherwise the same functionality as the parent class.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class XRechnungImporter extends ZUGFeRDImporter {
|
||||
|
||||
public XRechnungImporter(byte[] rawXml) {
|
||||
super();
|
||||
|
||||
try {
|
||||
setRawXML(rawXml);
|
||||
containsMeta = true;
|
||||
} catch (final IOException e) {
|
||||
Logger.getLogger(ZUGFeRDImporter.class.getName()).log(Level.SEVERE, null, e);
|
||||
throw new ZUGFeRDExportException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -48,7 +48,7 @@ public class ZUGFeRDImporter {
|
||||
/**
|
||||
* if metadata has been found
|
||||
*/
|
||||
private boolean containsMeta = false;
|
||||
protected boolean containsMeta = false;
|
||||
/**
|
||||
* map filenames of additional XML files to their contents
|
||||
*/
|
||||
@@ -67,6 +67,10 @@ public class ZUGFeRDImporter {
|
||||
private Document document;
|
||||
|
||||
|
||||
protected ZUGFeRDImporter() {
|
||||
//constructor for extending classes
|
||||
}
|
||||
|
||||
public ZUGFeRDImporter(String pdfFilename) {
|
||||
try (InputStream bis = Files.newInputStream(Paths.get(pdfFilename), StandardOpenOption.READ)) {
|
||||
extractLowLevel(bis);
|
||||
|
||||
Reference in New Issue
Block a user