updated javadoc

This commit is contained in:
jstaerk
2020-11-17 11:10:50 +01:00
parent 8ddfd3aa57
commit 8d48e992f8
9 changed files with 108 additions and 100 deletions

View File

@@ -22,8 +22,8 @@ public class BankDetails implements IZUGFeRDTradeSettlementPayment {
* identify the IBAN. Of course you will specify your own IBAN in full length but * identify the IBAN. Of course you will specify your own IBAN in full length but
* if you deduct from a customer's account you may e.g. leave out the first or last * if you deduct from a customer's account you may e.g. leave out the first or last
* digits so that nobody spying on the invoice gets to know the complete number * digits so that nobody spying on the invoice gets to know the complete number
* @param IBAN * @param IBAN the "IBAN ID", i.e. the IBAN or parts of it
* @return * @return fluent setter
*/ */
public BankDetails setIBAN(String IBAN) { public BankDetails setIBAN(String IBAN) {
this.IBAN = IBAN; this.IBAN = IBAN;

View File

@@ -15,9 +15,9 @@ public class Contact implements IZUGFeRDExportableContact {
/*** /***
* default constructor. * default constructor.
* Name, phone and email of sender contact person are e.g. required by XRechnung * Name, phone and email of sender contact person are e.g. required by XRechnung
* @param name * @param name full name of the contact
* @param phone * @param phone full phone number
* @param email * @param email email address of the contact
*/ */
public Contact(String name, String phone, String email) { public Contact(String name, String phone, String email) {
this.name = name; this.name = name;
@@ -27,13 +27,13 @@ public class Contact implements IZUGFeRDExportableContact {
/*** /***
* complete specification of a named contact with a different address * complete specification of a named contact with a different address
* @param name * @param name full name
* @param phone * @param phone full phone number
* @param email * @param email full email
* @param street * @param street street+number
* @param zip * @param zip postcode
* @param location * @param location city
* @param country * @param country two-letter iso code
*/ */
public Contact(String name, String phone, String email, String street, String zip, String location, String country) { public Contact(String name, String phone, String email, String street, String zip, String location, String country) {
this.name = name; this.name = name;
@@ -53,8 +53,8 @@ public class Contact implements IZUGFeRDExportableContact {
/** /**
* the first and last name of the contact * the first and last name of the contact
* @param name * @param name first and last name
* @return * @return fluent setter
*/ */
public Contact setName(String name) { public Contact setName(String name) {
this.name = name; this.name = name;
@@ -68,8 +68,8 @@ public class Contact implements IZUGFeRDExportableContact {
/*** /***
* complete phone number of the contact * complete phone number of the contact
* @param phone * @param phone the complete phone number
* @return * @return fluent setter
*/ */
public Contact setPhone(String phone) { public Contact setPhone(String phone) {
this.phone = phone; this.phone = phone;
@@ -83,8 +83,8 @@ public class Contact implements IZUGFeRDExportableContact {
/*** /***
* (optional) complete fax number * (optional) complete fax number
* @param fax * @param fax complete fax number of the contact
* @return * @return fluent setter
*/ */
public Contact setFax(String fax) { public Contact setFax(String fax) {
this.fax = fax; this.fax = fax;
@@ -97,8 +97,8 @@ public class Contact implements IZUGFeRDExportableContact {
/*** /***
* personal email address of the contact person * personal email address of the contact person
* @param email * @param email the email address of the contact
* @return * @return fluent setter
*/ */
public Contact setEMail(String email) { public Contact setEMail(String email) {
this.email = email; this.email = email;
@@ -111,8 +111,8 @@ public class Contact implements IZUGFeRDExportableContact {
/*** /***
* the postcode, if the address is different to the organisation * the postcode, if the address is different to the organisation
* @param zip * @param zip the postcode of the contact
* @return * @return fluent setter
*/ */
public Contact setZIP(String zip) { public Contact setZIP(String zip) {
this.zip = zip; this.zip = zip;
@@ -126,8 +126,8 @@ public class Contact implements IZUGFeRDExportableContact {
/** /**
* street and number, if the address is different to the organisation * street and number, if the address is different to the organisation
* @param street * @param street street and number of the contact
* @return * @return fluent setter
*/ */
public Contact setStreet(String street) { public Contact setStreet(String street) {
this.street = street; this.street = street;
@@ -141,8 +141,8 @@ public class Contact implements IZUGFeRDExportableContact {
/*** /***
* city of the contact person, if different from organisation * city of the contact person, if different from organisation
* @param location * @param location city
* @return * @return fluent setter
*/ */
public Contact setLocation(String location) { public Contact setLocation(String location) {
this.location = location; this.location = location;
@@ -156,8 +156,8 @@ public class Contact implements IZUGFeRDExportableContact {
/*** /***
* two-letter ISO country code of the contact, if different from organisation * two-letter ISO country code of the contact, if different from organisation
* @param country * @param country two-letter iso code
* @return * @return fluent setter
*/ */
public Contact setCountry(String country) { public Contact setCountry(String country) {
this.country = country; this.country = country;

View File

@@ -191,8 +191,8 @@ public class Invoice implements IExportableTransaction {
/*** /***
* usually the order number or in case of a correction the original invoice number * usually the order number or in case of a correction the original invoice number
* @param buyerOrderReferencedDocumentID * @param buyerOrderReferencedDocumentID string with number
* @return * @return fluent setter
*/ */
public Invoice setBuyerOrderReferencedDocumentID(String buyerOrderReferencedDocumentID) { public Invoice setBuyerOrderReferencedDocumentID(String buyerOrderReferencedDocumentID) {
this.buyerOrderReferencedDocumentID = buyerOrderReferencedDocumentID; this.buyerOrderReferencedDocumentID = buyerOrderReferencedDocumentID;
@@ -205,9 +205,9 @@ public class Invoice implements IExportableTransaction {
} }
/*** /***
* when the order (or whatever reference in BuyerOrderReferencedDocumentID) was issued * when the order (or whatever reference in BuyerOrderReferencedDocumentID) was issued (@todo switch to date?)
* @param buyerOrderReferencedDocumentIssueDateTime * @param buyerOrderReferencedDocumentIssueDateTime IssueDateTime in format CCYY-MM-DDTHH:MM:SS
* @return * @return fluent setter
*/ */
public Invoice setBuyerOrderReferencedDocumentIssueDateTime(String buyerOrderReferencedDocumentIssueDateTime) { public Invoice setBuyerOrderReferencedDocumentIssueDateTime(String buyerOrderReferencedDocumentIssueDateTime) {
this.buyerOrderReferencedDocumentIssueDateTime = buyerOrderReferencedDocumentIssueDateTime; this.buyerOrderReferencedDocumentIssueDateTime = buyerOrderReferencedDocumentIssueDateTime;
@@ -374,8 +374,10 @@ public class Invoice implements IExportableTransaction {
/*** /***
* sets a named sender contact * sets a named sender contact
* @param ownContact * @deprecated use setSender
* @return * @see Contact
* @param ownContact the sender contact
* @return fluent setter
*/ */
public Invoice setOwnContact(Contact ownContact) { public Invoice setOwnContact(Contact ownContact) {
this.sender.setContact(ownContact); this.sender.setContact(ownContact);
@@ -389,8 +391,8 @@ public class Invoice implements IExportableTransaction {
/** /**
* required. * required.
* sets the invoice receiving institution = invoicee * sets the invoice receiving institution = invoicee
* @param recipient * @param recipient the invoicee organisation
* @return * @return fluent setter
*/ */
public Invoice setRecipient(TradeParty recipient) { public Invoice setRecipient(TradeParty recipient) {
this.recipient = recipient; this.recipient = recipient;
@@ -400,8 +402,8 @@ public class Invoice implements IExportableTransaction {
/** /**
* required. * required.
* sets the invoicing institution = invoicer * sets the invoicing institution = invoicer
* @param sender * @param sender the invoicer
* @return * @return fluent setter
*/ */
public Invoice setSender(TradeParty sender) { public Invoice setSender(TradeParty sender) {
this.sender = sender; this.sender = sender;
@@ -468,8 +470,8 @@ public class Invoice implements IExportableTransaction {
/*** /***
* if the delivery address is not the recipient address, it can be specified here * if the delivery address is not the recipient address, it can be specified here
* @param deliveryAddress * @param deliveryAddress the goods receiving organisation
* @return * @return fluent setter
*/ */
public Invoice setDeliveryAddress(TradeParty deliveryAddress) { public Invoice setDeliveryAddress(TradeParty deliveryAddress) {
this.deliveryAddress = deliveryAddress; this.deliveryAddress = deliveryAddress;
@@ -484,8 +486,9 @@ public class Invoice implements IExportableTransaction {
/** /**
* required * required
* adds invoice "lines" :-) * adds invoice "lines" :-)
* @param item * @see Item
* @return * @param item the invoice line
* @return fluent setter
*/ */
public Invoice addItem(IZUGFeRDExportableItem item) { public Invoice addItem(IZUGFeRDExportableItem item) {
ZFItems.add(item); ZFItems.add(item);
@@ -510,8 +513,9 @@ public class Invoice implements IExportableTransaction {
/*** /***
* adds a document level addition to the price * adds a document level addition to the price
* @param izac * @see Charge
* @return * @param izac the charge to be applied
* @return fluent setter
*/ */
public Invoice addCharge(IZUGFeRDAllowanceCharge izac) { public Invoice addCharge(IZUGFeRDAllowanceCharge izac) {
Charges.add(izac); Charges.add(izac);
@@ -520,8 +524,9 @@ public class Invoice implements IExportableTransaction {
/*** /***
* adds a document level rebate * adds a document level rebate
* @param izac * @see Allowance
* @return * @param izac the allowance to be applied
* @return fluent setter
*/ */
public Invoice addAllowance(IZUGFeRDAllowanceCharge izac) { public Invoice addAllowance(IZUGFeRDAllowanceCharge izac) {
Allowances.add(izac); Allowances.add(izac);
@@ -530,8 +535,8 @@ public class Invoice implements IExportableTransaction {
/*** /***
* adds the ID of a contract referenced in the invoice * adds the ID of a contract referenced in the invoice
* @param s * @param s the contract number
* @return * @return fluent setter
*/ */
public Invoice setContractReferencedDocument(String s) { public Invoice setContractReferencedDocument(String s) {
contractReferencedDocument = s; contractReferencedDocument = s;
@@ -543,8 +548,8 @@ public class Invoice implements IExportableTransaction {
* sets a document level delivery period, * sets a document level delivery period,
* which is optional additional to the mandatory deliverydate * which is optional additional to the mandatory deliverydate
* and which will become a BillingSpecifiedPeriod-Element * and which will become a BillingSpecifiedPeriod-Element
* @param start * @param start the date of first delivery
* @param end * @param end the date of last delivery
* @return fluent setter * @return fluent setter
*/ */
public Invoice setDetailedDeliveryPeriod(Date start, Date end) { public Invoice setDetailedDeliveryPeriod(Date start, Date end) {
@@ -568,7 +573,7 @@ public class Invoice implements IExportableTransaction {
/*** /***
* adds a free text paragraph, which will become a includedNote element * adds a free text paragraph, which will become a includedNote element
* @param text * @param text freeform UTF8 plain text
* @return fluent setter * @return fluent setter
*/ */
public Invoice addNote(String text) { public Invoice addNote(String text) {

View File

@@ -35,8 +35,8 @@ public class Item implements IZUGFeRDExportableItem {
/** /**
* should only be set by calculator classes or maybe when reading from XML * should only be set by calculator classes or maybe when reading from XML
* @param lineTotalAmount * @param lineTotalAmount price*quantity of this line
* @return * @return fluent setter
*/ */
public Item setLineTotalAmount(BigDecimal lineTotalAmount) { public Item setLineTotalAmount(BigDecimal lineTotalAmount) {
this.lineTotalAmount = lineTotalAmount; this.lineTotalAmount = lineTotalAmount;
@@ -50,7 +50,8 @@ public class Item implements IZUGFeRDExportableItem {
/*** /***
* the list price without VAT (sic!), refer to EN16931-1 for definition * the list price without VAT (sic!), refer to EN16931-1 for definition
* @return * @param grossPrice the list price without VAT
* @return fluent setter
*/ */
public Item setGrossPrice(BigDecimal grossPrice) { public Item setGrossPrice(BigDecimal grossPrice) {
this.grossPrice = grossPrice; this.grossPrice = grossPrice;
@@ -146,8 +147,8 @@ public class Item implements IZUGFeRDExportableItem {
/*** /***
* adds item level freetext fields (includednote) * adds item level freetext fields (includednote)
* @param text * @param text UTF8 plain text
* @return * @return fluent setter
*/ */
public Item addNote(String text) { public Item addNote(String text) {
if (notes==null) { if (notes==null) {

View File

@@ -13,10 +13,10 @@ public class Product implements IZUGFeRDExportableProduct {
/*** /***
* default constructor * default constructor
* @param name * @param name product short name
* @param description * @param description product long name
* @param unit a two/three letter UN/ECE rec 20 unit code, e.g. "C62" for piece * @param unit a two/three letter UN/ECE rec 20 unit code, e.g. "C62" for piece
* @param VATPercent * @param VATPercent product vat rate
*/ */
public Product(String name, String description, String unit, BigDecimal VATPercent) { public Product(String name, String description, String unit, BigDecimal VATPercent) {
this.unit = unit; this.unit = unit;
@@ -32,8 +32,8 @@ public class Product implements IZUGFeRDExportableProduct {
/*** /***
* how the seller identifies this type of product * how the seller identifies this type of product
* @param sellerAssignedID * @param sellerAssignedID a unique String
* @return * @return fluent setter
*/ */
public Product setSellerAssignedID(String sellerAssignedID) { public Product setSellerAssignedID(String sellerAssignedID) {
this.sellerAssignedID = sellerAssignedID; this.sellerAssignedID = sellerAssignedID;
@@ -46,8 +46,8 @@ public class Product implements IZUGFeRDExportableProduct {
/*** /***
* if the buyer provided an ID how he refers to this product * if the buyer provided an ID how he refers to this product
* @param buyerAssignedID * @param buyerAssignedID a string the buyer provided
* @return * @return fluent setter
*/ */
public Product setBuyerAssignedID(String buyerAssignedID) { public Product setBuyerAssignedID(String buyerAssignedID) {
this.buyerAssignedID = buyerAssignedID; this.buyerAssignedID = buyerAssignedID;
@@ -61,8 +61,8 @@ public class Product implements IZUGFeRDExportableProduct {
/*** /***
* sets a UN/ECE rec 20 or 21 code which unit the product ships in, e.g. C62=piece * sets a UN/ECE rec 20 or 21 code which unit the product ships in, e.g. C62=piece
* @param unit * @param unit 2-3 letter UN/ECE rec 20 or 21
* @return * @return fluent setter
*/ */
public Product setUnit(String unit) { public Product setUnit(String unit) {
this.unit = unit; this.unit = unit;
@@ -76,8 +76,8 @@ public class Product implements IZUGFeRDExportableProduct {
/** /**
* name of the product * name of the product
* @param name * @param name short name
* @return * @return fluent setter
*/ */
public Product setName(String name) { public Product setName(String name) {
this.name = name; this.name = name;
@@ -91,8 +91,8 @@ public class Product implements IZUGFeRDExportableProduct {
/** /**
* description of the product (required) * description of the product (required)
* @param description * @param description long name
* @return * @return fluent setter
*/ */
public Product setDescription(String description) { public Product setDescription(String description) {
this.description = description; this.description = description;
@@ -106,8 +106,8 @@ public class Product implements IZUGFeRDExportableProduct {
/**** /****
* VAT rate of the product * VAT rate of the product
* @param VATPercent * @param VATPercent vat rate of the product
* @return * @return fluent setter
*/ */
public Product setVATPercent(BigDecimal VATPercent) { public Product setVATPercent(BigDecimal VATPercent) {
this.VATPercent = VATPercent; this.VATPercent = VATPercent;

View File

@@ -37,7 +37,7 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
/*** /***
* XML parsing constructor * XML parsing constructor
* @param nodes * @param nodes the nodelist returned e.g. from xpath
*/ */
public TradeParty(NodeList nodes) { public TradeParty(NodeList nodes) {
/** /**
@@ -109,8 +109,8 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
/** /**
* if it's a customer, this can e.g. be the customer ID * if it's a customer, this can e.g. be the customer ID
* @param ID * @param ID customer/seller number
* @return * @return fluent setter
*/ */
public TradeParty setID(String ID) { public TradeParty setID(String ID) {
this.ID = ID; this.ID = ID;
@@ -119,8 +119,9 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
/*** /***
* (optional) a named contact person * (optional) a named contact person
* @param c * @see Contact
* @return * @param c the named contact person
* @return fluent setter
*/ */
public TradeParty setContact(Contact c) { public TradeParty setContact(Contact c) {
this.contact = c; this.contact = c;
@@ -129,8 +130,8 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
/*** /***
* required (for senders, if payment is not debit): the BIC and IBAN * required (for senders, if payment is not debit): the BIC and IBAN
* @param s * @param s bank credentials
* @return * @return fluent setter
*/ */
public TradeParty addBankDetails(BankDetails s) { public TradeParty addBankDetails(BankDetails s) {
bankDetails.add(s); bankDetails.add(s);
@@ -143,8 +144,8 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
/*** /***
* a general tax ID * a general tax ID
* @param taxID * @param taxID tax number of the organisation
* @return * @return fluent setter
*/ */
public TradeParty addTaxID(String taxID) { public TradeParty addTaxID(String taxID) {
this.taxID = taxID; this.taxID = taxID;
@@ -153,8 +154,8 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
/*** /***
* the USt-ID * the USt-ID
* @param vatID * @param vatID Ust-ID
* @return * @return fluent setter
*/ */
public TradeParty addVATID(String vatID) { public TradeParty addVATID(String vatID) {
this.vatID = vatID; this.vatID = vatID;
@@ -178,7 +179,8 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
/*** /***
* required, usually done in the constructor: the complete name of the organisation * required, usually done in the constructor: the complete name of the organisation
* @return * @param name complete legal name
* @return fluent setter
*/ */
public TradeParty setName(String name) { public TradeParty setName(String name) {
this.name = name; this.name = name;
@@ -192,8 +194,8 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
/*** /***
* usually set in the constructor, required for recipients in german invoices: postcode * usually set in the constructor, required for recipients in german invoices: postcode
* @param zip * @param zip postcode
* @return * @return fluent setter
*/ */
public TradeParty setZIP(String zip) { public TradeParty setZIP(String zip) {
this.zip = zip; this.zip = zip;
@@ -207,8 +209,8 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
/*** /***
* usually set in constructor, required in germany, street and house number * usually set in constructor, required in germany, street and house number
* @param street * @param street street name and number
* @return * @return fluent setter
*/ */
public TradeParty setStreet(String street) { public TradeParty setStreet(String street) {
this.street = street; this.street = street;
@@ -222,8 +224,8 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
/*** /***
* usually set in constructor, usually required in germany, the city of the organisation * usually set in constructor, usually required in germany, the city of the organisation
* @param location * @param location city
* @return * @return fluent setter
*/ */
public TradeParty setLocation(String location) { public TradeParty setLocation(String location) {
this.location = location; this.location = location;
@@ -237,8 +239,8 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
/*** /***
* two-letter ISO code of the country * two-letter ISO code of the country
* @param country * @param country two-letter-code
* @return * @return fluent setter
*/ */
public TradeParty setCountry(String country) { public TradeParty setCountry(String country) {
this.country = country; this.country = country;
@@ -275,8 +277,8 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
/*** /***
* additional parts of the address, e.g. which floor. * additional parts of the address, e.g. which floor.
* Street address will become "lineOne", this will become "lineTwo" * Street address will become "lineOne", this will become "lineTwo"
* @param additionalAddress * @param additionalAddress additional address description
* @return * @return fluent setter
*/ */
public TradeParty setAdditionalAddress(String additionalAddress) { public TradeParty setAdditionalAddress(String additionalAddress) {
this.additionalAddress = additionalAddress; this.additionalAddress = additionalAddress;

View File

@@ -122,7 +122,7 @@ public class XMLTools extends XMLWriter {
/*** /***
* removes utf8 byte order marks from byte arrays, in case one is there * removes utf8 byte order marks from byte arrays, in case one is there
* @param zugferdRaw * @param zugferdRaw the CII XML
* @return the byte array without bom * @return the byte array without bom
*/ */
public static byte[] removeBOM(byte[] zugferdRaw) { public static byte[] removeBOM(byte[] zugferdRaw) {

View File

@@ -33,7 +33,7 @@ public class Profiles {
{"BASIC", new Profile("BASIC", "urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic")}, {"BASIC", new Profile("BASIC", "urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic")},
{"EN16931", new Profile("EN16931", "urn:cen.eu:en16931:2017")}, {"EN16931", new Profile("EN16931", "urn:cen.eu:en16931:2017")},
{"EXTENDED", new Profile("EXTENDED", "urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended")}, {"EXTENDED", new Profile("EXTENDED", "urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended")},
{"XRECHNUNG", new Profile("XRECHNUNG", "XRECHNUNG")} {"XRECHNUNG", new Profile("XRECHNUNG", "urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0")}
}).collect(Collectors.toMap(data -> (String) data[0], data -> (Profile) data[1])); }).collect(Collectors.toMap(data -> (String) data[0], data -> (Profile) data[1]));
static Map<String, Profile> zf1Map = Stream.of(new Object[][]{ static Map<String, Profile> zf1Map = Stream.of(new Object[][]{

View File

@@ -27,11 +27,11 @@ public class XMLUpgrader {
/*** /***
* Takes a filename of a ZF1 XML file and returns the string of ZF2 XML * Takes a filename of a ZF1 XML file and returns the string of ZF2 XML
* @param xmlFilename * @param xmlFilename the filename of the source
* @return String the updated XML * @return String the updated XML
* @throws FileNotFoundException * @throws FileNotFoundException if the source could not be found
* @throws TransformerException * @throws TransformerException if the source could not be transformed
* @throws UnsupportedEncodingException * @throws UnsupportedEncodingException if the source was not utf8
*/ */
public String migrateFromV1ToV2(String xmlFilename) throws FileNotFoundException, TransformerException, UnsupportedEncodingException { public String migrateFromV1ToV2(String xmlFilename) throws FileNotFoundException, TransformerException, UnsupportedEncodingException {
/** /**