finished refactoring to ixmlprovider

This commit is contained in:
Jochen Stärk
2017-10-07 09:49:02 +02:00
parent 001077b262
commit 47dbe73a7c
4 changed files with 132 additions and 11 deletions

View File

@@ -8,6 +8,8 @@ import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import org.mustangproject.ZUGFeRD.model.CrossIndustryDocumentType;
public class ZUGFeRD1PullProvider implements IXMLProvider {
@@ -58,8 +60,7 @@ public class ZUGFeRD1PullProvider implements IXMLProvider {
@Override
public byte[] getXML() {
// TODO Auto-generated method stub
return null;
return zugferdData;
}

View File

@@ -106,14 +106,9 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
@Override
public byte[] getXML() {
// TODO Auto-generated method stub
return null;
return zugferdData;
}
private BigDecimal getTotalGross() {
BigDecimal res=getTotal();

View File

@@ -53,14 +53,17 @@ public class ZUGFeRDExporter implements Closeable {
*/
public ZUGFeRDExporter() {
ZUGFeRD1PullProvider z1p =new ZUGFeRD1PullProvider();
this.xmlProvider=z1p;
init();
}
public ZUGFeRDExporter(PDDocument doc2) {
doc=doc2;
init();
}
private void init() {
ZUGFeRD1PullProvider z1p =new ZUGFeRD1PullProvider();
this.xmlProvider=z1p;
}
// // MAIN CLASS
@Deprecated
private PDFAConformanceLevel conformanceLevel = PDFAConformanceLevel.UNICODE;

View File

@@ -0,0 +1,122 @@
//
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 generiert
// Siehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// <20>nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren.
// Generiert: 2015.10.16 um 06:16:03 PM CEST
//
package org.mustangproject.ZUGFeRD.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java-Klasse f<>r CrossIndustryDocumentType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* &lt;complexType name="CrossIndustryDocumentType"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="SpecifiedExchangedDocumentContext" type="{urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12}ExchangedDocumentContextType"/&gt;
* &lt;element name="HeaderExchangedDocument" type="{urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12}ExchangedDocumentType"/&gt;
* &lt;element name="SpecifiedSupplyChainTradeTransaction" type="{urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12}SupplyChainTradeTransactionType"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name="CrossIndustryDocumentType", namespace="urn:ferd:CrossIndustryDocument:invoice:1p0")
@XmlType(name = "CrossIndustryDocumentType", namespace = "urn:ferd:CrossIndustryDocument:invoice:1p0", propOrder = {
"specifiedExchangedDocumentContext",
"headerExchangedDocument",
"specifiedSupplyChainTradeTransaction"
})
public class CrossIndustryDocumentType {
@XmlElement(name = "SpecifiedExchangedDocumentContext", required = true)
protected ExchangedDocumentContextType specifiedExchangedDocumentContext;
@XmlElement(name = "HeaderExchangedDocument", required = true)
protected ExchangedDocumentType headerExchangedDocument;
@XmlElement(name = "SpecifiedSupplyChainTradeTransaction", required = true)
protected SupplyChainTradeTransactionType specifiedSupplyChainTradeTransaction;
/**
* Ruft den Wert der specifiedExchangedDocumentContext-Eigenschaft ab.
*
* @return ExchangedDocumentContextType
*
*/
public ExchangedDocumentContextType getSpecifiedExchangedDocumentContext() {
return specifiedExchangedDocumentContext;
}
/**
* Legt den Wert der specifiedExchangedDocumentContext-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link ExchangedDocumentContextType }
*
*/
public void setSpecifiedExchangedDocumentContext(ExchangedDocumentContextType value) {
this.specifiedExchangedDocumentContext = value;
}
/**
* Ruft den Wert der headerExchangedDocument-Eigenschaft ab.
*
* @return ExchangedDocumentType
*
*/
public ExchangedDocumentType getHeaderExchangedDocument() {
return headerExchangedDocument;
}
/**
* Legt den Wert der headerExchangedDocument-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link ExchangedDocumentType }
*
*/
public void setHeaderExchangedDocument(ExchangedDocumentType value) {
this.headerExchangedDocument = value;
}
/**
* Ruft den Wert der specifiedSupplyChainTradeTransaction-Eigenschaft ab.
*
* @return SupplyChainTradeTransactionType
*
*/
public SupplyChainTradeTransactionType getSpecifiedSupplyChainTradeTransaction() {
return specifiedSupplyChainTradeTransaction;
}
/**
* Legt den Wert der specifiedSupplyChainTradeTransaction-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link SupplyChainTradeTransactionType }
*
*/
public void setSpecifiedSupplyChainTradeTransaction(SupplyChainTradeTransactionType value) {
this.specifiedSupplyChainTradeTransaction = value;
}
}