@Named @Singleton public class InvoiceTransformer extends 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 Boolean |
formatXmlOutput() |
byte[] |
fromModel(Invoice invoice)
Transform from Invoice model to xml byte array.
|
void |
fromModel(Invoice invoice,
OutputStream outputStream)
Transform from Invoice model to output stream.
|
void |
fromModelAsync(Invoice invoice,
OutputStream outputStream)
From model Async.
|
Validator |
getZfSchemaValidator()
Gets the ZUGFeRD schema Validator.
|
Invoice |
toModel(File file)
Transform from XML content from File to the invoice model.
|
Invoice |
toModel(InputStream xmlInputStream)
Transform from XML input stream to the invoice model.
|
public InvoiceTransformer()
Instantiates a default invoice transformer.
protected Boolean formatXmlOutput()
public byte[] fromModel(Invoice invoice)
Transform from Invoice model to xml byte array.
invoice - the invoicepublic void fromModel(Invoice invoice, OutputStream outputStream)
Transform from Invoice model to output stream.
invoice - the invoiceoutputStream - the output streampublic void fromModelAsync(Invoice invoice, OutputStream outputStream)
From model Async.
Will start a new Thread for the transformation.
invoice - the invoiceoutputStream - the output streampublic Validator getZfSchemaValidator() throws SAXException
Gets the ZUGFeRD schema Validator.
SAXException - the SAX exceptionpublic Invoice toModel(File file)
Transform from XML content from File to the invoice model.
file - the filepublic Invoice toModel(InputStream xmlInputStream)
Transform from XML input stream to the invoice model.
xmlInputStream - the xml input streamCopyright © 2014-2016 Konik.io. All Rights Reserved.