Added MessageState enumeration and XJB file for message schema

This commit is contained in:
Kai S. K. Engelbart 2019-10-11 15:10:56 +02:00
parent a602e16372
commit a195ed2c7e
7 changed files with 73 additions and 7 deletions

View File

@ -6,11 +6,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
@ -41,5 +36,15 @@
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/xjb">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -1,6 +1,7 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/main/xjb=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding//target/generated-sources/jaxb=UTF-8

View File

@ -1,7 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="envoy-common">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
<wb-resource deploy-path="/" source-path="/target/generated-sources/jaxb"/>
<wb-resource deploy-path="/" source-path="/src/main/xjb"/>
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
</wb-module>
</project-modules>

View File

@ -26,6 +26,14 @@
<build>
<finalName>envoy-common</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/xjb</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>

View File

@ -0,0 +1,22 @@
package envoy.schema;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
/**
* Project: <strong>envoy-common</strong><br>
* File: <strong>MessageState.java</strong><br>
* Created: <strong>11 Oct 2019</strong><br>
*
* @author Kai S. K. Engelbart
*/
@XmlType(name = "")
@XmlEnum
public enum MessageState {
Waiting, Sent, Received, Read;
public String value() { return name(); }
public static MessageState fromValue(String v) { return valueOf(v); }
}

View File

@ -21,7 +21,16 @@
<xs:element name="Sender" type="xs:long" />
<xs:element name="Recipient" type="xs:long" />
<xs:element name="Date" type="xs:date" />
<xs:element name="State" type="xs:boolean" />
<xs:element name="State">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Waiting"/>
<xs:enumeration value="Sent"/>
<xs:enumeration value="Received"/>
<xs:enumeration value="Read"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

15
src/main/xjb/bindings.xml Normal file
View File

@ -0,0 +1,15 @@
<jaxb:bindings xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc" version="2.1">
<jaxb:globalBindings generateIsSetMethod="true"
fixedAttributeAsConstantProperty="true">
<xjc:serializable />
</jaxb:globalBindings>
<jaxb:bindings schemaLocation="../resources/message_schema.xsd">
<jaxb:bindings
node="//xs:element[@name='State']/xs:simpleType">
<jaxb:typesafeEnumClass name="MessageState" />
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>