001package org.kuali.ole;
002
003import com.thoughtworks.xstream.XStream;
004import org.kuali.ole.pojo.edi.*;
005
006import java.util.Arrays;
007
008
009/**
010 * Created by IntelliJ IDEA.
011 * User: palanivel
012 * Date: 3/2/12
013 * Time: 8:11 PM
014 * To change this template use File | Settings | File Templates.
015 */
016public class OLETranscationalRecordGenerator {
017
018    public String toXml(EDIOrder ediOrder) {
019        EDIOrders ediOrders = new EDIOrders();
020        ediOrders.setOrders(Arrays.asList(ediOrder));
021        String xml = toXml(ediOrders);
022        return xml;
023    }
024
025    public String toXml(EDIOrders ediOrders) {
026        XStream xStream = intXStream();
027        String order = xStream.toXML(ediOrders);
028        return order;
029    }
030
031    public EDIOrders fromXml(String requestXML) {
032        XStream xStream = intXStream();
033        return (EDIOrders) xStream.fromXML(requestXML);
034    }
035
036    public INVOrders fromInvoiceXml(String requestXML) {
037        XStream xStream = intInvoiceXStream();
038        return (INVOrders) xStream.fromXML(requestXML);
039    }
040
041    public String toInvoiceXml(INVOrders invOrders) {
042        XStream xStream = intInvoiceXStream();
043        return xStream.toXML(invOrders);
044    }
045
046    private XStream intXStream() {
047        XStream xStream = new XStream();
048        xStream.alias("orders", EDIOrders.class);
049        xStream.alias("order", EDIOrder.class);
050        xStream.addImplicitCollection(EDIOrders.class, "orders", EDIOrder.class);
051
052        xStream.aliasField("sendersandreceiversidentification", EDIOrder.class, "senderAndReceiver");
053        xStream.aliasField("sendersandreceiversconstant", SenderAndReceiver.class, "sendersAndReceiversConstant");
054        xStream.aliasField("code", SendersAndReceiversConstant.class, "code");
055        xStream.aliasField("value", SendersAndReceiversConstant.class, "value");
056        xStream.aliasField("senderinformation", SenderAndReceiver.class, "senderInformation");
057        xStream.aliasField("senderid", SenderInformation.class, "senderId");
058        xStream.aliasField("senderidtype", SenderInformation.class, "senderIdType");
059        xStream.aliasField("receiverinformation", SenderAndReceiver.class, "receiverInformation");
060        xStream.aliasField("receiverid", ReceiverInformation.class, "receiverId");
061        xStream.aliasField("receiveridtype", ReceiverInformation.class, "receiverIdType");
062        xStream.aliasField("schedule", SenderAndReceiver.class, "schedule");
063        xStream.aliasField("preparationdate", Schedule.class, "preparationDate");
064        xStream.aliasField("preparationtime", Schedule.class, "preparationTime");
065        xStream.aliasField("interchangecontrolref", SenderAndReceiver.class, "interChangeControlReference");
066
067        xStream.aliasField("messageheader", EDIOrder.class, "messageHeader");
068        xStream.aliasField("interchangecontrolref", MessageHeader.class, "interchangeControlReference");
069        xStream.aliasField("messagetypeinformation", MessageHeader.class, "messsageTypeInformation");
070        xStream.aliasField("messagetypeid", MesssageTypeInformation.class, "messageTypeId");
071        xStream.aliasField("constant1", MesssageTypeInformation.class, "constant1");
072        xStream.aliasField("constant2", MesssageTypeInformation.class, "constant2");
073        xStream.aliasField("constant3", MesssageTypeInformation.class, "constant3");
074        xStream.aliasField("constant4", MesssageTypeInformation.class, "constant4");
075
076        xStream.aliasField("message", EDIOrder.class, "message");
077        xStream.aliasField("messagebeginning", Message.class, "messageBeginning");
078        xStream.aliasField("order", MessageBeginning.class, "messageBeginningOrder");
079        xStream.aliasField("interchangecontrolref", MessageBeginning.class, "messageBeginningInterchangeControlReference");
080        xStream.aliasField("codelistagency", MessageBeginning.class, "messageBeginningCodeListAgency");
081
082        xStream.aliasField("messagecreationinfo", Message.class, "messageCreationInformation");
083        xStream.aliasField("details", MessageCreationInformation.class, "messageCreationInfoDetails");
084        xStream.aliasField("constant", MessageCreationInfoDetails.class, "messageCreationInfoConstant");
085        xStream.aliasField("date", MessageCreationInfoDetails.class, "messageCreationInfoDate");
086        xStream.aliasField("dateformat", MessageCreationInfoDetails.class, "messageCreationInfoDateFormat");
087
088        xStream.aliasField("buyerpartyqualifier", Message.class, "buyerPartyQualifier");
089        xStream.aliasField("buyer", BuyerPartyQualifier.class, "buyer");
090        xStream.aliasField("buyerinfo", BuyerPartyQualifier.class, "buyerInformation");
091        xStream.aliasField("codedidentification", BuyerInformation.class, "buyerCodeIdentification");
092        xStream.aliasField("partyidentificationcode", BuyerInformation.class, "buyerPartyIdentificationCode");
093        xStream.aliasField("codelistagency", BuyerInformation.class, "buyerCodeListAgency");
094
095        xStream.aliasField("reference", Message.class, "messageReference");
096        xStream.aliasField("partydetails", MessageReference.class, "partyDetails");
097        xStream.aliasField("additionalpartyidentification", PartyDetails.class, "additionalPartyIdentification");
098        xStream.aliasField("partyname", PartyDetails.class, "partyName");
099
100        xStream.aliasField("supplierpartyqualifier", Message.class, "supplierPartyQualifier");
101        xStream.aliasField("supplier", SupplierPartyQualifier.class, "supplier");
102        xStream.aliasField("supplierinfo", SupplierPartyQualifier.class, "supplierInformation");
103        xStream.aliasField("codedidentification", SupplierInformation.class, "supplierCodeIdentification");
104        xStream.aliasField("partyidentificationcode", SupplierInformation.class, "supplierPartyIdentificationCode");
105        xStream.aliasField("codelistagency", SupplierInformation.class, "supplierCodeListAgency");
106
107        xStream.aliasField("currencydetails", Message.class, "currencyDetails");
108        xStream.aliasField("supplierinfo", CurrencyDetails.class, "currencyDetailsSupplierInformation");
109        xStream.aliasField("defaultcurrency", CurrencyDetailsSupplierInformation.class, "defaultCurrency");
110        xStream.aliasField("currencytype", CurrencyDetailsSupplierInformation.class, "currencyType");
111        xStream.aliasField("ordercurrency", CurrencyDetailsSupplierInformation.class, "orderCurrency");
112
113        xStream.alias("lineitemOrder", LineItemOrder.class);
114        xStream.alias("lineitem", LineItem.class);
115        xStream.alias("articlenumber", LineItemArticleNumber.class);
116        xStream.alias("productfunction", ProductFunction.class);
117        xStream.alias("articlenumber", ProductArticleNumber.class);
118        xStream.alias("itemdescription", ItemDescription.class);
119        xStream.alias("quantityinformation", QuantityInformation.class);
120        xStream.alias("quantity", Qunatity.class);
121        xStream.alias("priceinformation", PriceInformation.class);
122        xStream.alias("price", ItemPrice.class);
123        xStream.alias("referenceinformation", BuyerReferenceInformation.class);
124        xStream.alias("reference", BuyerLineItemReference.class);
125        xStream.alias("suppliersreferenceinformation", SupplierReferenceInformation.class);
126        xStream.alias("suppliersreference", SupplierLineItemReference.class);
127        xStream.alias("fundnumberreference", FundNumberReference.class);
128        xStream.alias("buyers", BuyersFundNumberReference.class);
129        xStream.alias("note", FreeTextNotes.class);
130        xStream.alias("transportstagequalifier", TransportStageQualifier.class);
131
132        xStream.addImplicitCollection(EDIOrder.class, "lineItemOrder", LineItemOrder.class);
133        xStream.addImplicitCollection(LineItemOrder.class, "lineItem", LineItem.class);
134
135        xStream.aliasField("sequencenumber", LineItem.class, "sequenceNumber");
136        xStream.aliasField("itemnumberid", LineItem.class, "itemNumberId");
137
138        xStream.addImplicitCollection(LineItem.class, "lineItemArticleNumber", LineItemArticleNumber.class);
139
140        xStream.aliasField("isbn", LineItemArticleNumber.class, "lineItemIsbn");
141        xStream.aliasField("itemnumbertype", LineItemArticleNumber.class, "lineItemNumberType");
142
143        xStream.addImplicitCollection(LineItemOrder.class, "productFunction", ProductFunction.class);
144
145        xStream.aliasField("productid", ProductFunction.class, "productId");
146
147        xStream.addImplicitCollection(ProductFunction.class, "productArticleNumber", ProductArticleNumber.class);
148
149        xStream.aliasField("isbn", ProductArticleNumber.class, "productIsbn");
150        xStream.aliasField("itemnumbertype", ProductArticleNumber.class, "productItemNumberType");
151
152        xStream.addImplicitCollection(LineItemOrder.class, "itemDescriptionList", ItemDescription.class);
153
154        xStream.aliasField("text", ItemDescription.class, "text");
155        xStream.aliasField("itemcharacteristiccode", ItemDescription.class, "itemCharacteristicCode");
156        xStream.aliasField("data", ItemDescription.class, "data");
157
158        xStream.addImplicitCollection(LineItemOrder.class, "quantityInformation", QuantityInformation.class);
159        xStream.addImplicitCollection(QuantityInformation.class, "qunatity", Qunatity.class);
160
161        xStream.aliasField("constant", Qunatity.class, "quantityConstant");
162        xStream.aliasField("quantity", Qunatity.class, "quantity");
163
164        xStream.addImplicitCollection(LineItemOrder.class, "priceInformation", PriceInformation.class);
165        xStream.addImplicitCollection(PriceInformation.class, "itemPrice", ItemPrice.class);
166
167        xStream.aliasField("grossprice", ItemPrice.class, "grossPrice");
168        xStream.aliasField("price", ItemPrice.class, "price");
169
170        xStream.addImplicitCollection(LineItemOrder.class, "buyerReferenceInformation", BuyerReferenceInformation.class);
171        xStream.addImplicitCollection(BuyerReferenceInformation.class, "buyerLineItemReference", BuyerLineItemReference.class);
172
173        xStream.aliasField("buyersorderline", BuyerLineItemReference.class, "buyersOrderLine");
174        xStream.aliasField("orderlinenumber", BuyerLineItemReference.class, "orderLineNumber");
175
176
177        xStream.addImplicitCollection(LineItemOrder.class, "supplierReferenceInformation", SupplierReferenceInformation.class);
178        xStream.addImplicitCollection(SupplierReferenceInformation.class, "supplierLineItemReference", SupplierLineItemReference.class);
179
180        xStream.aliasField("suppliersorderline", SupplierLineItemReference.class, "suppliersOrderLine");
181        xStream.aliasField("vendorreferencenumber", SupplierLineItemReference.class, "vendorReferenceNumber");
182
183
184        xStream.addImplicitCollection(LineItemOrder.class, "fundNumberReference", FundNumberReference.class);
185        xStream.addImplicitCollection(FundNumberReference.class, "buyersFundNumberReference", BuyersFundNumberReference.class);
186
187        xStream.aliasField("buyersfundnumber", BuyersFundNumberReference.class, "buyersFundNumber");
188        xStream.aliasField("budgetnumber", BuyersFundNumberReference.class, "budgetNumber");
189
190        xStream.addImplicitCollection(LineItemOrder.class, "note", FreeTextNotes.class);
191
192        xStream.aliasField("notelineitem", FreeTextNotes.class, "noteLineItem");
193        xStream.aliasField("noteempty1", FreeTextNotes.class, "noteempty1");
194        xStream.aliasField("noteempty2", FreeTextNotes.class, "noteempty2");
195        xStream.aliasField("noteempty3", FreeTextNotes.class, "noteempty3");
196
197
198        xStream.addImplicitCollection(LineItemOrder.class, "transportStageQualifier", TransportStageQualifier.class);
199
200        xStream.aliasField("transportstagequalifierconstant", TransportStageQualifier.class, "transportStageConstant");
201        xStream.aliasField("surfacemail", TransportStageQualifier.class, "surfaceMail");
202
203
204        xStream.aliasField("summary", LineItemOrder.class, "supplierReferenceInformation");
205        xStream.aliasField("summarysection", Summary.class, "summarySection");
206        xStream.aliasField("separatorinfo", SummarySection.class, "separatorInformation");
207
208        xStream.alias("controlinfomation", ControlInfomation.class);
209        xStream.alias("control", Control.class);
210
211        xStream.addImplicitCollection(Summary.class, "controlInfomation", ControlInfomation.class);
212        xStream.addImplicitCollection(ControlInfomation.class, "control", Control.class);
213
214        xStream.aliasField("controlqualifier", Control.class, "controlQualifier");
215        xStream.aliasField("totalqtysegments", Control.class, "totalQuantitySegments");
216
217
218        xStream.aliasField("unt", Summary.class, "untSummary");
219        xStream.aliasField("messagesegmentsnumber", UNTSummary.class, "segmentNumber");
220        xStream.aliasField("linsegmentstotal", UNTSummary.class, "linSegmentTotal");
221        xStream.addImplicitCollection(EDIOrders.class, "orders");
222        return xStream;
223    }
224
225
226    private XStream intInvoiceXStream() {
227        XStream xStream = new XStream();
228        xStream.alias("orders", INVOrders.class);
229
230        xStream.aliasField("sendersandreceiversidentification", INVOrders.class, "senderAndReceiver");
231        xStream.aliasField("sendersandreceiversconstant", SenderAndReceiver.class, "sendersAndReceiversConstant");
232        xStream.aliasField("code", SendersAndReceiversConstant.class, "code");
233        xStream.aliasField("value", SendersAndReceiversConstant.class, "value");
234        xStream.aliasField("senderinformation", SenderAndReceiver.class, "senderInformation");
235        xStream.aliasField("senderid", SenderInformation.class, "senderId");
236        xStream.aliasField("senderidtype", SenderInformation.class, "senderIdType");
237        xStream.aliasField("receiverinformation", SenderAndReceiver.class, "receiverInformation");
238        xStream.aliasField("receiverid", ReceiverInformation.class, "receiverId");
239        xStream.aliasField("receiveridtype", ReceiverInformation.class, "receiverIdType");
240        xStream.aliasField("schedule", SenderAndReceiver.class, "schedule");
241        xStream.aliasField("preparationdate", Schedule.class, "preparationDate");
242        xStream.aliasField("preparationtime", Schedule.class, "preparationTime");
243        xStream.aliasField("interchangecontrolref", SenderAndReceiver.class, "interChangeControlReference");
244        xStream.aliasField("field6", SenderAndReceiver.class, "field6");
245        xStream.aliasField("field7", SenderAndReceiver.class, "field7");
246        xStream.aliasField("field8", SenderAndReceiver.class, "field8");
247        xStream.aliasField("field9", SenderAndReceiver.class, "field9");
248        xStream.aliasField("field10", SenderAndReceiver.class, "field10");
249        xStream.aliasField("field11", SenderAndReceiver.class, "field11");
250
251        xStream.alias("order", INVOrder.class);
252        xStream.addImplicitCollection(INVOrders.class, "invOrder", INVOrder.class);
253
254
255        xStream.aliasField("messageheader", INVOrder.class, "messageHeader");
256        xStream.aliasField("interchangecontrolref", MessageHeader.class, "interchangeControlReference");
257        xStream.aliasField("messagetypeinformation", MessageHeader.class, "messsageTypeInformation");
258        xStream.aliasField("messagetypeid", MesssageTypeInformation.class, "messageTypeId");
259        xStream.aliasField("constant1", MesssageTypeInformation.class, "constant1");
260        xStream.aliasField("constant2", MesssageTypeInformation.class, "constant2");
261        xStream.aliasField("constant3", MesssageTypeInformation.class, "constant3");
262        xStream.aliasField("constant4", MesssageTypeInformation.class, "constant4");
263
264        xStream.aliasField("message", INVOrder.class, "message");
265        xStream.aliasField("messagebeginning", InvoiceMessage.class, "messageBeginning");
266        xStream.aliasField("order", MessageBeginning.class, "messageBeginningOrder");
267        xStream.aliasField("interchangecontrolref", MessageBeginning.class, "messageBeginningInterchangeControlReference");
268        xStream.aliasField("codelistagency", MessageBeginning.class, "messageBeginningCodeListAgency");
269
270        xStream.aliasField("messagecreationinfo", InvoiceMessage.class, "messageCreationInformation");
271        xStream.aliasField("details", MessageCreationInformation.class, "messageCreationInfoDetails");
272        xStream.aliasField("constant", MessageCreationInfoDetails.class, "messageCreationInfoConstant");
273        xStream.aliasField("date", MessageCreationInfoDetails.class, "messageCreationInfoDate");
274        xStream.aliasField("dateformat", MessageCreationInfoDetails.class, "messageCreationInfoDateFormat");
275
276        xStream.aliasField("purchaseordernumber", InvoiceMessage.class, "purchaseOrderQualifier");
277        xStream.aliasField("purchaseorderreference", PurchaseOrderQualifier.class, "purchaseOrderReference");
278        xStream.aliasField("purchaseorderline", PurchaseOrderReference.class, "purchaseOrderLine");
279        xStream.aliasField("purchaseordernumber", PurchaseOrderReference.class, "purchaseOrderNumber");
280
281        xStream.alias("partyqualifier", PartyQualifier.class);
282        xStream.alias("supplierpartyname", SupplierPartyName.class);
283        xStream.addImplicitCollection(InvoiceMessage.class, "partyQualifier", PartyQualifier.class);
284
285        xStream.aliasField("partyqualifier", InvoiceMessage.class, "partyQualifier");
286        xStream.aliasField("partycode", PartyQualifier.class, "partyCode");
287        xStream.aliasField("partyinfo", PartyQualifier.class, "partyInformation");
288        xStream.aliasField("codedidentification", PartyInformation.class, "codeIdentification");
289        xStream.aliasField("partyidentificationcode", PartyInformation.class, "partyIdentificationCode");
290        xStream.aliasField("codelistagency", PartyInformation.class, "codeListAgency");
291        xStream.aliasField("nameandaddress", PartyQualifier.class, "nameAndAddress");
292
293        xStream.aliasField("supplierpartyname", PartyQualifier.class, "supplierPartyName");
294
295        xStream.aliasField("partyname1", SupplierPartyName.class, "partyName1");
296        xStream.aliasField("partyname2", SupplierPartyName.class, "partyName2");
297        xStream.aliasField("partyname3", SupplierPartyName.class, "partyName3");
298        xStream.aliasField("partyname4", SupplierPartyName.class, "partyName4");
299        xStream.aliasField("partyname5", SupplierPartyName.class, "partyName5");
300
301
302        xStream.aliasField("partystreetname", PartyQualifier.class, "partyStreetName");
303
304        xStream.aliasField("streetname1", PartyStreetName.class, "partyStreetName1");
305        xStream.aliasField("streetname2", PartyStreetName.class, "partyStreetName2");
306        xStream.aliasField("streetname3", PartyStreetName.class, "partyStreetName3");
307
308        xStream.aliasField("partycityname", PartyQualifier.class, "partyCityName");
309        xStream.aliasField("partycountrysubentity", PartyQualifier.class, "partyCountrySubEntity");
310        xStream.aliasField("partypostalcode", PartyQualifier.class, "partyPostalCode");
311        xStream.aliasField("partycountrycode", PartyQualifier.class, "partyCountryCode");
312
313        xStream.aliasField("supplieradditionalpartyidentifier", InvoiceMessage.class, "supplierAdditionalPartyIdentifier");
314        xStream.aliasField("supplierreference", SupplierAdditionalPartyIdentifier.class, "supplierIdentifier");
315        xStream.aliasField("referencequalifier", SupplierIdentifier.class, "referenceQualifier");
316        xStream.aliasField("referencenumber", SupplierIdentifier.class, "referenceNumber");
317
318
319        xStream.alias("buyerpartyqualifier", BuyerQualifier.class);
320        xStream.alias("buyername", BuyerPartyName.class);
321        xStream.addImplicitCollection(InvoiceMessage.class, "buyerPartyQualifier", BuyerQualifier.class);
322
323        xStream.aliasField("buyerpartyqualifier", InvoiceMessage.class, "buyerPartyQualifier");
324        xStream.aliasField("buyercode", BuyerQualifier.class, "buyerCode");
325        xStream.aliasField("buyerinfo", BuyerQualifier.class, "buyerInformation");
326        xStream.aliasField("buyercodedidentification", PartyInformation.class, "codeIdentification");
327        xStream.aliasField("buyeridentificationcode", PartyInformation.class, "partyIdentificationCode");
328        xStream.aliasField("buyercodelistagency", PartyInformation.class, "codeListAgency");
329        xStream.aliasField("nameandaddress", BuyerQualifier.class, "nameAndAddress");
330
331        xStream.aliasField("buyername", BuyerQualifier.class, "buyerName");
332        xStream.aliasField("buyername1", BuyerPartyName.class, "partyName1");
333        xStream.aliasField("buyername2", BuyerPartyName.class, "partyName2");
334        xStream.aliasField("buyername3", BuyerPartyName.class, "partyName3");
335        xStream.aliasField("buyername4", BuyerPartyName.class, "partyName4");
336        xStream.aliasField("buyername5", BuyerPartyName.class, "partyName5");
337
338        xStream.aliasField("buyerstreetname", BuyerQualifier.class, "buyerStreetName");
339        xStream.aliasField("buyerstreetname1", PartyStreetName.class, "partyStreetName1");
340        xStream.aliasField("buyerstreetname2", PartyStreetName.class, "partyStreetName2");
341        xStream.aliasField("buyerstreetname3", PartyStreetName.class, "partyStreetName3");
342
343        xStream.aliasField("buyercityname", BuyerQualifier.class, "buyerCityName");
344        xStream.aliasField("buyercountrysubentity", BuyerQualifier.class, "buyerCountrySubEntity");
345        xStream.aliasField("buyerpostalcode", BuyerQualifier.class, "buyerPostalCode");
346        xStream.aliasField("buyercountrycode", BuyerQualifier.class, "buyerCountryCode");
347
348
349        xStream.aliasField("buyeradditionalpartyidentifier", InvoiceMessage.class, "buyerAdditionalPartyIdentifier");
350        xStream.aliasField("buyerreference", BuyerAdditionalPartyIdentifier.class, "buyerIdentifier");
351        xStream.aliasField("buyerreferencequalifier", BuyerIdentifier.class, "buyerReferenceQualifier");
352        xStream.aliasField("buyerreferencenumber", BuyerIdentifier.class, "buyerReferenceNumber");
353
354
355        xStream.aliasField("reference", InvoiceMessage.class, "messageReference");
356        xStream.aliasField("partydetails", MessageReference.class, "partyDetails");
357        xStream.aliasField("additionalpartyidentification", PartyDetails.class, "additionalPartyIdentification");
358        xStream.aliasField("partyname", PartyDetails.class, "partyName");
359
360        xStream.aliasField("currencydetails", InvoiceMessage.class, "currencyDetails");
361        xStream.aliasField("supplierinfo", CurrencyDetails.class, "currencyDetailsSupplierInformation");
362        xStream.aliasField("defaultcurrency", CurrencyDetailsSupplierInformation.class, "defaultCurrency");
363        xStream.aliasField("currencytype", CurrencyDetailsSupplierInformation.class, "currencyType");
364        xStream.aliasField("ordercurrency", CurrencyDetailsSupplierInformation.class, "orderCurrency");
365
366        xStream.aliasField("allowanceorcharge", InvoiceMessage.class, "allowanceOrCharge");
367        xStream.aliasField("allowanceorchargequalifier", AllowanceOrCharge.class, "allowanceOrChargeQualifier");
368        xStream.aliasField("freetext", AllowanceOrCharge.class, "freeText");
369        xStream.aliasField("settlement", AllowanceOrCharge.class, "settlement");
370        xStream.aliasField("calculationsequenceindicator", AllowanceOrCharge.class, "calculationSequenceIndicator");
371        xStream.aliasField("specialserviceidentification", AllowanceOrCharge.class, "specialServiceIdentification");
372        xStream.aliasField("specialservicecode", SpecialServiceIdentification.class, "specialServiceCode");
373        xStream.aliasField("codelistqualifier", SpecialServiceIdentification.class, "codeListQualifier");
374        xStream.aliasField("codelistqualifieragency", SpecialServiceIdentification.class, "codeListQualifierAgency");
375        xStream.aliasField("specialservice", SpecialServiceIdentification.class, "specialService");
376
377        xStream.aliasField("monetary", InvoiceMessage.class, "monetary");
378        xStream.aliasField("monetaryinfo", Monetary.class, "monetaryInformation");
379        xStream.aliasField("monetaryamounttype", MonetaryInformation.class, "amountType");
380        xStream.aliasField("monetaryamount", MonetaryInformation.class, "amount");
381
382
383        xStream.alias("lineitemOrder", LineItemOrder.class);
384        xStream.alias("lineitem", LineItem.class);
385        xStream.alias("linearticlenumber", LineItemArticleNumber.class);
386        xStream.alias("productfunction", ProductFunction.class);
387        xStream.alias("articlenumber", ProductArticleNumber.class);
388        xStream.alias("supplierarticlenumber", SupplierArticleNumber.class);
389        xStream.alias("itemdescription", ItemDescription.class);
390        xStream.alias("quantityinformation", QuantityInformation.class);
391        xStream.alias("quantity", Qunatity.class);
392        xStream.alias("datetimedetail", DateTimeDetail.class);
393        xStream.alias("datetimeinfo", DateTimeInformation.class);
394        xStream.alias("priceinformation", PriceInformation.class);
395        xStream.alias("price", ItemPrice.class);
396        xStream.alias("suppliersreferenceinformation", SupplierReferenceInformation.class);
397        xStream.alias("suppliersreference", SupplierLineItemReference.class);
398
399        xStream.alias("note", FreeTextNotes.class);
400        xStream.alias("monetary", MonetaryDetail.class);
401        xStream.alias("monetaryinfo", MonetaryLineItemInformation.class);
402
403        xStream.alias("lineitemallowanceorcharge", LineItemAllowanceOrCharge.class);
404        xStream.alias("lineitemspecialserviceidentification", LineItemSpecialServiceIdentification.class);
405
406        xStream.alias("allowancemonetaryadditionalcharge", AllowanceMonetaryDetail.class);
407        xStream.alias("allowancemonetaryinfo", AllowanceMonetaryLineItemInformation.class);
408
409        xStream.addImplicitCollection(INVOrder.class, "lineItemOrder", LineItemOrder.class);
410        xStream.addImplicitCollection(LineItemOrder.class, "lineItem", LineItem.class);
411
412        xStream.aliasField("sequencenumber", LineItem.class, "sequenceNumber");
413        xStream.aliasField("itemnumberid", LineItem.class, "itemNumberId");
414
415        xStream.addImplicitCollection(LineItem.class, "lineItemArticleNumber", LineItemArticleNumber.class);
416
417        xStream.aliasField("isbn", LineItemArticleNumber.class, "lineItemIsbn");
418        xStream.aliasField("itemnumbertype", LineItemArticleNumber.class, "lineItemNumberType");
419
420        xStream.addImplicitCollection(LineItemOrder.class, "productFunction", ProductFunction.class);
421
422        xStream.aliasField("productid", ProductFunction.class, "productId");
423
424        xStream.addImplicitCollection(ProductFunction.class, "productArticleNumber", ProductArticleNumber.class);
425
426        xStream.aliasField("isbn", ProductArticleNumber.class, "productIsbn");
427        xStream.aliasField("itemnumbertype", ProductArticleNumber.class, "productItemNumberType");
428        xStream.aliasField("unknown1", ProductArticleNumber.class, "unknown1");
429        xStream.aliasField("unknown2", ProductArticleNumber.class, "unknown2");
430        xStream.aliasField("unknown3", ProductArticleNumber.class, "unknown3");
431
432        xStream.addImplicitCollection(ProductFunction.class, "supplierArticleNumber", SupplierArticleNumber.class);
433
434        xStream.aliasField("isbn", SupplierArticleNumber.class, "isbn");
435        xStream.aliasField("supplierarticle", SupplierArticleNumber.class, "supplierArticle");
436
437        xStream.addImplicitCollection(LineItemOrder.class, "itemDescriptionList", ItemDescription.class);
438
439        xStream.aliasField("text", ItemDescription.class, "text");
440        xStream.aliasField("itemcharacteristiccode", ItemDescription.class, "itemCharacteristicCode");
441        xStream.aliasField("data", ItemDescription.class, "data");
442
443        xStream.addImplicitCollection(LineItemOrder.class, "quantityInformation", QuantityInformation.class);
444        xStream.addImplicitCollection(QuantityInformation.class, "qunatity", Qunatity.class);
445
446        xStream.aliasField("constant", Qunatity.class, "quantityConstant");
447        xStream.aliasField("quantity", Qunatity.class, "quantity");
448
449        xStream.addImplicitCollection(LineItemOrder.class, "dateTimeDetail", DateTimeDetail.class);
450        xStream.addImplicitCollection(DateTimeDetail.class, "dateTimeInformationList", DateTimeInformation.class);
451
452        xStream.aliasField("periodqualifier", DateTimeInformation.class, "periodQualifier");
453        xStream.aliasField("period", DateTimeInformation.class, "period");
454        xStream.aliasField("periodformat", DateTimeInformation.class, "periodFormat");
455
456        xStream.addImplicitCollection(LineItemOrder.class, "note", FreeTextNotes.class);
457
458        xStream.aliasField("notelineitem", FreeTextNotes.class, "noteLineItem");
459        xStream.aliasField("noteempty1", FreeTextNotes.class, "noteempty1");
460        xStream.aliasField("noteempty2", FreeTextNotes.class, "noteempty2");
461        xStream.aliasField("noteempty3", FreeTextNotes.class, "noteempty3");
462
463        xStream.addImplicitCollection(LineItemOrder.class, "monetaryDetail", MonetaryDetail.class);
464        xStream.addImplicitCollection(MonetaryDetail.class, "monetaryLineItemInformation", MonetaryLineItemInformation.class);
465
466        xStream.aliasField("monetaryamounttype", MonetaryLineItemInformation.class, "amountType");
467        xStream.aliasField("monetaryamount", MonetaryLineItemInformation.class, "amount");
468
469
470
471
472
473        xStream.addImplicitCollection(LineItemOrder.class, "lineItemAllowanceOrCharge", LineItemAllowanceOrCharge.class);
474        xStream.addImplicitCollection(LineItemAllowanceOrCharge.class, "lineItemSpecialServiceIdentification", LineItemSpecialServiceIdentification.class);
475
476        xStream.aliasField("allowanceorchargequalifier", LineItemAllowanceOrCharge.class, "allowanceOrChargeQualifier");
477        xStream.aliasField("freetext", LineItemAllowanceOrCharge.class, "freeText");
478        xStream.aliasField("settlement", LineItemAllowanceOrCharge.class, "settlement");
479        xStream.aliasField("calculationsequenceindicator", LineItemAllowanceOrCharge.class, "calculationSequenceIndicator");
480
481        xStream.aliasField("specialservicecode", LineItemSpecialServiceIdentification.class, "specialServiceCode");
482        xStream.aliasField("codelistqualifier", LineItemSpecialServiceIdentification.class, "codeListQualifier");
483        xStream.aliasField("codelistqualifieragency", LineItemSpecialServiceIdentification.class, "codeListQualifierAgency");
484        xStream.aliasField("specialservice", LineItemSpecialServiceIdentification.class, "specialService");
485
486
487
488
489        xStream.addImplicitCollection(LineItemOrder.class, "allowanceMonetaryDetail", AllowanceMonetaryDetail.class);
490        xStream.addImplicitCollection(AllowanceMonetaryDetail.class, "allowanceMonetaryLineItemInformation", AllowanceMonetaryLineItemInformation.class);
491
492        xStream.aliasField("monetaryamounttype", AllowanceMonetaryLineItemInformation.class, "amountType");
493        xStream.aliasField("monetaryamount", AllowanceMonetaryLineItemInformation.class, "amount");
494
495        xStream.addImplicitCollection(LineItemOrder.class, "priceInformation", PriceInformation.class);
496        xStream.addImplicitCollection(PriceInformation.class, "itemPrice", ItemPrice.class);
497
498        xStream.aliasField("grossprice", ItemPrice.class, "grossPrice");
499        xStream.aliasField("price", ItemPrice.class, "price");
500
501        xStream.addImplicitCollection(LineItemOrder.class, "supplierReferenceInformation", SupplierReferenceInformation.class);
502        xStream.addImplicitCollection(SupplierReferenceInformation.class, "supplierLineItemReference", SupplierLineItemReference.class);
503
504        xStream.aliasField("suppliersorderline", SupplierLineItemReference.class, "suppliersOrderLine");
505        xStream.aliasField("vendorreferencenumber", SupplierLineItemReference.class, "vendorReferenceNumber");
506
507        xStream.aliasField("summary", LineItemOrder.class, "supplierReferenceInformation");
508        xStream.aliasField("summarysection", Summary.class, "summarySection");
509        xStream.aliasField("separatorinfo", SummarySection.class, "separatorInformation");
510
511        xStream.alias("controlinfomation", ControlInfomation.class);
512        xStream.alias("control", Control.class);
513
514        xStream.alias("monetarysummary", MonetarySummary.class);
515        xStream.alias("monetaryinfosummary", MonetarySummaryInformation.class);
516
517        xStream.addImplicitCollection(Summary.class, "controlInfomation", ControlInfomation.class);
518        xStream.addImplicitCollection(ControlInfomation.class, "control", Control.class);
519
520        xStream.aliasField("controlqualifier", Control.class, "controlQualifier");
521        xStream.aliasField("totalqtysegments", Control.class, "totalQuantitySegments");
522
523        xStream.addImplicitCollection(Summary.class, "monetarySummary", MonetarySummary.class);
524        xStream.addImplicitCollection(MonetarySummary.class, "monetarySummaryInformation", MonetarySummaryInformation.class);
525
526        xStream.aliasField("monetaryamounttype", MonetarySummaryInformation.class, "amountType");
527        xStream.aliasField("monetaryamount", MonetarySummaryInformation.class, "amount");
528
529
530        xStream.aliasField("unt", Summary.class, "untSummary");
531        xStream.aliasField("messagesegmentsnumber", UNTSummary.class, "segmentNumber");
532        xStream.aliasField("linsegmentstotal", UNTSummary.class, "linSegmentTotal");
533        xStream.addImplicitCollection(INVOrders.class, "invOrder");
534        return xStream;
535    }
536
537}