@Named @Singleton public class InvoiceTransformer extends java.lang.Object
Transforms invoices from one representation to another. In other words marshaling and unmarshalling.
Constructor and Description |
---|
InvoiceTransformer()
Instantiates a default invoice transformer.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Boolean |
formatXmlOutput() |
byte[] |
fromModel(Invoice invoice)
Transform from Invoice model to xml byte array.
|
void |
fromModel(Invoice invoice,
java.io.OutputStream outputStream)
Transform from Invoice model to output stream.
|
void |
fromModelAsync(Invoice invoice,
java.io.OutputStream outputStream)
From model Async.
|
javax.xml.validation.Validator |
getZfSchemaValidator()
Gets the ZUGFeRD schema Validator.
|
Invoice |
toModel(java.io.File file)
Transform from XML content from File to the invoice model.
|
Invoice |
toModel(java.io.InputStream xmlInputStream)
Transform from XML input stream to the invoice model.
|
public InvoiceTransformer()
Instantiates a default invoice transformer.
protected java.lang.Boolean formatXmlOutput()
public byte[] fromModel(Invoice invoice)
Transform from Invoice model to xml byte array.
invoice
- the invoicepublic void fromModel(Invoice invoice, java.io.OutputStream outputStream)
Transform from Invoice model to output stream.
invoice
- the invoiceoutputStream
- the output streampublic void fromModelAsync(Invoice invoice, java.io.OutputStream outputStream)
From model Async.
Will start a new Thread for the transformation.
invoice
- the invoiceoutputStream
- the output streampublic javax.xml.validation.Validator getZfSchemaValidator() throws org.xml.sax.SAXException
Gets the ZUGFeRD schema Validator.
org.xml.sax.SAXException
- the SAX exceptionpublic Invoice toModel(java.io.File file)
Transform from XML content from File to the invoice model.
file
- the fileCopyright © 2014-2018 Konik.io. All Rights Reserved.