From da82f3b492c3cd36f2e8723632a63a6cc1f4e39b Mon Sep 17 00:00:00 2001 From: Kostya Date: Sun, 6 Sep 2026 09:21:37 +0300 Subject: catalog: add generated v3 JAXB binding and ex-2 test data The ex-2 schema describes a nested Guess-Market/GM-events document in which every event carries its pricing mechanism inline, as either a GM-LMSR element holding the liquidity parameter b or a GM-order-book element holding the allow-mint, initial and d attributes, instead of naming a mechanism and passing its parameters separately. Add the xjc-generated classes for that schema under catalog.model.v3, along with the fixtures the loader will be tested against: small.xml with two events, one per mechanism, multiple.xml with four, and two negative cases -- error-2.xml, where a market maker is funded with zero initial cash, and error-3.xml, where a market maker points at event id 12, which no event declares -- so the cross-reference and funding checks have something to reject. The binding covers the GM-events subtree only. The GM-users half of the document and the per-event id element are not bound yet, so nothing reads these classes so far. --- .../guess/service/catalog/model/v3/Commission.java | 77 +++++++++++ .../guess/service/catalog/model/v3/GMEvent.java | 148 +++++++++++++++++++++ .../guess/service/catalog/model/v3/GMEvents.java | 67 ++++++++++ .../guess/service/catalog/model/v3/GMLMSR.java | 49 +++++++ .../guess/service/catalog/model/v3/GMMethod.java | 81 +++++++++++ .../guess/service/catalog/model/v3/GMOptions.java | 67 ++++++++++ .../service/catalog/model/v3/GMOrderBook.java | 90 +++++++++++++ .../service/catalog/model/v3/GuessMarket.java | 59 ++++++++ .../service/catalog/model/v3/ObjectFactory.java | 140 +++++++++++++++++++ 9 files changed, 778 insertions(+) create mode 100644 service/src/main/java/market/guess/service/catalog/model/v3/Commission.java create mode 100644 service/src/main/java/market/guess/service/catalog/model/v3/GMEvent.java create mode 100644 service/src/main/java/market/guess/service/catalog/model/v3/GMEvents.java create mode 100644 service/src/main/java/market/guess/service/catalog/model/v3/GMLMSR.java create mode 100644 service/src/main/java/market/guess/service/catalog/model/v3/GMMethod.java create mode 100644 service/src/main/java/market/guess/service/catalog/model/v3/GMOptions.java create mode 100644 service/src/main/java/market/guess/service/catalog/model/v3/GMOrderBook.java create mode 100644 service/src/main/java/market/guess/service/catalog/model/v3/GuessMarket.java create mode 100644 service/src/main/java/market/guess/service/catalog/model/v3/ObjectFactory.java (limited to 'service/src') diff --git a/service/src/main/java/market/guess/service/catalog/model/v3/Commission.java b/service/src/main/java/market/guess/service/catalog/model/v3/Commission.java new file mode 100644 index 0000000..81fcda9 --- /dev/null +++ b/service/src/main/java/market/guess/service/catalog/model/v3/Commission.java @@ -0,0 +1,77 @@ +// +// This file was generated by the Eclipse Implementation of JAXB, v4.0.5 +// See https://eclipse-ee4j.github.io/jaxb-ri +// Any modifications to this file will be lost upon recompilation of the source schema. +// + +package market.guess.service.catalog.model.v3; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlValue; + +/** + * Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *           
+ *             
+ *             
+ *           
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType( + name = "", + propOrder = {"value"}) +@XmlRootElement(name = "commission") +public class Commission { + + @XmlValue protected int value; + + @XmlAttribute(name = "type", required = true) + protected String type; + + /** Gets the value of the value property. */ + public int getValue() { + return value; + } + + /** Sets the value of the value property. */ + public void setValue(int value) { + this.value = value; + } + + /** + * Gets the value of the type property. + * + * @return possible object is {@link String } + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value allowed object is {@link String } + */ + public void setType(String value) { + this.type = value; + } +} diff --git a/service/src/main/java/market/guess/service/catalog/model/v3/GMEvent.java b/service/src/main/java/market/guess/service/catalog/model/v3/GMEvent.java new file mode 100644 index 0000000..be08ef4 --- /dev/null +++ b/service/src/main/java/market/guess/service/catalog/model/v3/GMEvent.java @@ -0,0 +1,148 @@ +// +// This file was generated by the Eclipse Implementation of JAXB, v4.0.5 +// See https://eclipse-ee4j.github.io/jaxb-ri +// Any modifications to this file will be lost upon recompilation of the source schema. +// + +package market.guess.service.catalog.model.v3; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; + +/** + * Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *         
+ *         
+ *       
+ *       
+ *     
+ *   
+ * 
+ * }
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType( + name = "", + propOrder = {"description", "commission", "gmOptions", "gmMethod"}) +@XmlRootElement(name = "GM-event") +public class GMEvent { + + @XmlElement(required = true) + protected String description; + + @XmlElement(required = true) + protected Commission commission; + + @XmlElement(name = "GM-options", required = true) + protected GMOptions gmOptions; + + @XmlElement(name = "GM-method", required = true) + protected GMMethod gmMethod; + + @XmlAttribute(name = "name", required = true) + protected String name; + + /** + * Gets the value of the description property. + * + * @return possible object is {@link String } + */ + public String getDescription() { + return description; + } + + /** + * Sets the value of the description property. + * + * @param value allowed object is {@link String } + */ + public void setDescription(String value) { + this.description = value; + } + + /** + * Gets the value of the commission property. + * + * @return possible object is {@link Commission } + */ + public Commission getCommission() { + return commission; + } + + /** + * Sets the value of the commission property. + * + * @param value allowed object is {@link Commission } + */ + public void setCommission(Commission value) { + this.commission = value; + } + + /** + * Gets the value of the gmOptions property. + * + * @return possible object is {@link GMOptions } + */ + public GMOptions getGMOptions() { + return gmOptions; + } + + /** + * Sets the value of the gmOptions property. + * + * @param value allowed object is {@link GMOptions } + */ + public void setGMOptions(GMOptions value) { + this.gmOptions = value; + } + + /** + * Gets the value of the gmMethod property. + * + * @return possible object is {@link GMMethod } + */ + public GMMethod getGMMethod() { + return gmMethod; + } + + /** + * Sets the value of the gmMethod property. + * + * @param value allowed object is {@link GMMethod } + */ + public void setGMMethod(GMMethod value) { + this.gmMethod = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(String value) { + this.name = value; + } +} diff --git a/service/src/main/java/market/guess/service/catalog/model/v3/GMEvents.java b/service/src/main/java/market/guess/service/catalog/model/v3/GMEvents.java new file mode 100644 index 0000000..a6ee73d --- /dev/null +++ b/service/src/main/java/market/guess/service/catalog/model/v3/GMEvents.java @@ -0,0 +1,67 @@ +// +// This file was generated by the Eclipse Implementation of JAXB, v4.0.5 +// See https://eclipse-ee4j.github.io/jaxb-ri +// Any modifications to this file will be lost upon recompilation of the source schema. +// + +package market.guess.service.catalog.model.v3; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; +import java.util.ArrayList; +import java.util.List; + +/** + * Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType( + name = "", + propOrder = {"gmEvent"}) +@XmlRootElement(name = "GM-events") +public class GMEvents { + + @XmlElement(name = "GM-event", required = true) + protected List gmEvent; + + /** + * Gets the value of the gmEvent property. + * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the gmEvent property. + * + *

For example, to add a new item, do as follows: + * + *

+   * getGMEvent().add(newItem);
+   * 
+ * + *

Objects of the following type(s) are allowed in the list {@link GMEvent } + * + * @return The value of the gmEvent property. + */ + public List getGMEvent() { + if (gmEvent == null) { + gmEvent = new ArrayList<>(); + } + return this.gmEvent; + } +} diff --git a/service/src/main/java/market/guess/service/catalog/model/v3/GMLMSR.java b/service/src/main/java/market/guess/service/catalog/model/v3/GMLMSR.java new file mode 100644 index 0000000..415d434 --- /dev/null +++ b/service/src/main/java/market/guess/service/catalog/model/v3/GMLMSR.java @@ -0,0 +1,49 @@ +// +// This file was generated by the Eclipse Implementation of JAXB, v4.0.5 +// See https://eclipse-ee4j.github.io/jaxb-ri +// Any modifications to this file will be lost upon recompilation of the source schema. +// + +package market.guess.service.catalog.model.v3; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; + +/** + * Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType( + name = "", + propOrder = {"b"}) +@XmlRootElement(name = "GM-LMSR") +public class GMLMSR { + + protected int b; + + /** Gets the value of the b property. */ + public int getB() { + return b; + } + + /** Sets the value of the b property. */ + public void setB(int value) { + this.b = value; + } +} diff --git a/service/src/main/java/market/guess/service/catalog/model/v3/GMMethod.java b/service/src/main/java/market/guess/service/catalog/model/v3/GMMethod.java new file mode 100644 index 0000000..62b9a12 --- /dev/null +++ b/service/src/main/java/market/guess/service/catalog/model/v3/GMMethod.java @@ -0,0 +1,81 @@ +// +// This file was generated by the Eclipse Implementation of JAXB, v4.0.5 +// See https://eclipse-ee4j.github.io/jaxb-ri +// Any modifications to this file will be lost upon recompilation of the source schema. +// + +package market.guess.service.catalog.model.v3; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; + +/** + * Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType( + name = "", + propOrder = {"gmlmsr", "gmOrderBook"}) +@XmlRootElement(name = "GM-method") +public class GMMethod { + + @XmlElement(name = "GM-LMSR") + protected GMLMSR gmlmsr; + + @XmlElement(name = "GM-order-book") + protected GMOrderBook gmOrderBook; + + /** + * Gets the value of the gmlmsr property. + * + * @return possible object is {@link GMLMSR } + */ + public GMLMSR getGMLMSR() { + return gmlmsr; + } + + /** + * Sets the value of the gmlmsr property. + * + * @param value allowed object is {@link GMLMSR } + */ + public void setGMLMSR(GMLMSR value) { + this.gmlmsr = value; + } + + /** + * Gets the value of the gmOrderBook property. + * + * @return possible object is {@link GMOrderBook } + */ + public GMOrderBook getGMOrderBook() { + return gmOrderBook; + } + + /** + * Sets the value of the gmOrderBook property. + * + * @param value allowed object is {@link GMOrderBook } + */ + public void setGMOrderBook(GMOrderBook value) { + this.gmOrderBook = value; + } +} diff --git a/service/src/main/java/market/guess/service/catalog/model/v3/GMOptions.java b/service/src/main/java/market/guess/service/catalog/model/v3/GMOptions.java new file mode 100644 index 0000000..ebd2968 --- /dev/null +++ b/service/src/main/java/market/guess/service/catalog/model/v3/GMOptions.java @@ -0,0 +1,67 @@ +// +// This file was generated by the Eclipse Implementation of JAXB, v4.0.5 +// See https://eclipse-ee4j.github.io/jaxb-ri +// Any modifications to this file will be lost upon recompilation of the source schema. +// + +package market.guess.service.catalog.model.v3; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; +import java.util.ArrayList; +import java.util.List; + +/** + * Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType( + name = "", + propOrder = {"gmOption"}) +@XmlRootElement(name = "GM-options") +public class GMOptions { + + @XmlElement(name = "GM-option", required = true) + protected List gmOption; + + /** + * Gets the value of the gmOption property. + * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the gmOption property. + * + *

For example, to add a new item, do as follows: + * + *

+   * getGMOption().add(newItem);
+   * 
+ * + *

Objects of the following type(s) are allowed in the list {@link String } + * + * @return The value of the gmOption property. + */ + public List getGMOption() { + if (gmOption == null) { + gmOption = new ArrayList<>(); + } + return this.gmOption; + } +} diff --git a/service/src/main/java/market/guess/service/catalog/model/v3/GMOrderBook.java b/service/src/main/java/market/guess/service/catalog/model/v3/GMOrderBook.java new file mode 100644 index 0000000..b4bdd6c --- /dev/null +++ b/service/src/main/java/market/guess/service/catalog/model/v3/GMOrderBook.java @@ -0,0 +1,90 @@ +// +// This file was generated by the Eclipse Implementation of JAXB, v4.0.5 +// See https://eclipse-ee4j.github.io/jaxb-ri +// Any modifications to this file will be lost upon recompilation of the source schema. +// + +package market.guess.service.catalog.model.v3; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; + +/** + * Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

{@code
+ * 
+ *   
+ *     
+ *       
+ *       
+ *       
+ *         
+ *           
+ *             
+ *             
+ *           
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "GM-order-book") +public class GMOrderBook { + + @XmlAttribute(name = "initial", required = true) + protected int initial; + + @XmlAttribute(name = "d", required = true) + protected int d; + + @XmlAttribute(name = "allow-mint", required = true) + protected String allowMint; + + /** Gets the value of the initial property. */ + public int getInitial() { + return initial; + } + + /** Sets the value of the initial property. */ + public void setInitial(int value) { + this.initial = value; + } + + /** Gets the value of the d property. */ + public int getD() { + return d; + } + + /** Sets the value of the d property. */ + public void setD(int value) { + this.d = value; + } + + /** + * Gets the value of the allowMint property. + * + * @return possible object is {@link String } + */ + public String getAllowMint() { + return allowMint; + } + + /** + * Sets the value of the allowMint property. + * + * @param value allowed object is {@link String } + */ + public void setAllowMint(String value) { + this.allowMint = value; + } +} diff --git a/service/src/main/java/market/guess/service/catalog/model/v3/GuessMarket.java b/service/src/main/java/market/guess/service/catalog/model/v3/GuessMarket.java new file mode 100644 index 0000000..0865612 --- /dev/null +++ b/service/src/main/java/market/guess/service/catalog/model/v3/GuessMarket.java @@ -0,0 +1,59 @@ +// +// This file was generated by the Eclipse Implementation of JAXB, v4.0.5 +// See https://eclipse-ee4j.github.io/jaxb-ri +// Any modifications to this file will be lost upon recompilation of the source schema. +// + +package market.guess.service.catalog.model.v3; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; + +/** + * Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType( + name = "", + propOrder = {"gmEvents"}) +@XmlRootElement(name = "Guess-Market") +public class GuessMarket { + + @XmlElement(name = "GM-events", required = true) + protected GMEvents gmEvents; + + /** + * Gets the value of the gmEvents property. + * + * @return possible object is {@link GMEvents } + */ + public GMEvents getGMEvents() { + return gmEvents; + } + + /** + * Sets the value of the gmEvents property. + * + * @param value allowed object is {@link GMEvents } + */ + public void setGMEvents(GMEvents value) { + this.gmEvents = value; + } +} diff --git a/service/src/main/java/market/guess/service/catalog/model/v3/ObjectFactory.java b/service/src/main/java/market/guess/service/catalog/model/v3/ObjectFactory.java new file mode 100644 index 0000000..0fcc285 --- /dev/null +++ b/service/src/main/java/market/guess/service/catalog/model/v3/ObjectFactory.java @@ -0,0 +1,140 @@ +// +// This file was generated by the Eclipse Implementation of JAXB, v4.0.5 +// See https://eclipse-ee4j.github.io/jaxb-ri +// Any modifications to this file will be lost upon recompilation of the source schema. +// + +package market.guess.service.catalog.model.v3; + +import jakarta.xml.bind.JAXBElement; +import jakarta.xml.bind.annotation.XmlElementDecl; +import jakarta.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + +/** + * This object contains factory methods for each Java content interface and Java element interface + * generated in the market.guess.service.model.v3 package. + * + *

An ObjectFactory allows you to programmatically construct new instances of the Java + * representation for XML content. The Java representation of XML content can consist of schema + * derived interfaces and classes representing the binding of schema type definitions, element + * declarations and model groups. Factory methods for each of these are provided in this class. + */ +@XmlRegistry +public class ObjectFactory { + + private static final QName _Description_QNAME = new QName("", "description"); + private static final QName _B_QNAME = new QName("", "b"); + private static final QName _GMOption_QNAME = new QName("", "GM-option"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes + * for package: market.guess.service.model.v3 + */ + public ObjectFactory() {} + + /** + * Create an instance of {@link Commission } + * + * @return the new instance of {@link Commission } + */ + public Commission createCommission() { + return new Commission(); + } + + /** + * Create an instance of {@link GuessMarket } + * + * @return the new instance of {@link GuessMarket } + */ + public GuessMarket createGuessMarket() { + return new GuessMarket(); + } + + /** + * Create an instance of {@link GMEvents } + * + * @return the new instance of {@link GMEvents } + */ + public GMEvents createGMEvents() { + return new GMEvents(); + } + + /** + * Create an instance of {@link GMEvent } + * + * @return the new instance of {@link GMEvent } + */ + public GMEvent createGMEvent() { + return new GMEvent(); + } + + /** + * Create an instance of {@link GMOptions } + * + * @return the new instance of {@link GMOptions } + */ + public GMOptions createGMOptions() { + return new GMOptions(); + } + + /** + * Create an instance of {@link GMMethod } + * + * @return the new instance of {@link GMMethod } + */ + public GMMethod createGMMethod() { + return new GMMethod(); + } + + /** + * Create an instance of {@link GMLMSR } + * + * @return the new instance of {@link GMLMSR } + */ + public GMLMSR createGMLMSR() { + return new GMLMSR(); + } + + /** + * Create an instance of {@link GMOrderBook } + * + * @return the new instance of {@link GMOrderBook } + */ + public GMOrderBook createGMOrderBook() { + return new GMOrderBook(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} + * + * @param value Java instance representing xml element's value. + * @return the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} + */ + @XmlElementDecl(namespace = "", name = "description") + public JAXBElement createDescription(String value) { + return new JAXBElement<>(_Description_QNAME, String.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >} + * + * @param value Java instance representing xml element's value. + * @return the new instance of {@link JAXBElement }{@code <}{@link Integer }{@code >} + */ + @XmlElementDecl(namespace = "", name = "b") + public JAXBElement createB(Integer value) { + return new JAXBElement<>(_B_QNAME, Integer.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} + * + * @param value Java instance representing xml element's value. + * @return the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} + */ + @XmlElementDecl(namespace = "", name = "GM-option") + public JAXBElement createGMOption(String value) { + return new JAXBElement<>(_GMOption_QNAME, String.class, null, value); + } +} -- cgit v1.2.3