@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()
|
InvoiceTransformer(javax.xml.bind.JAXBContext jaxbContext)
|
public InvoiceTransformer()
Instantiates a new invoice transformer.
@Inject public InvoiceTransformer(javax.xml.bind.JAXBContext jaxbContext)
Instantiates a new invoice transformer.
jaxbContext - the jaxb contextpublic Invoice from(java.io.File file)
Transform from XML content from File to the invoice model.
file - the filepublic Invoice from(java.io.InputStream xmlIs)
Transform from XML input stream to the invoice model.
xmlIs - the xml input streampublic byte[] from(Invoice invoice)
Transform from Invoice model to xml byte array.
invoice - the invoicepublic void from(Invoice invoice, java.io.ByteArrayOutputStream outputStream)
Transform from Invoice model to output stream.
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 exceptionCopyright © 2014 konik.io. All Rights Reserved.