Added MessageState enumeration and XJB file for message schema
This commit is contained in:
parent
e258416d2a
commit
46e10fb1a0
15
.classpath
15
.classpath
@ -6,11 +6,6 @@
|
|||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</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">
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
@ -41,5 +36,15 @@
|
|||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</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"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
encoding//src/main/java=UTF-8
|
encoding//src/main/java=UTF-8
|
||||||
encoding//src/main/resources=UTF-8
|
encoding//src/main/resources=UTF-8
|
||||||
|
encoding//src/main/xjb=UTF-8
|
||||||
encoding//src/test/java=UTF-8
|
encoding//src/test/java=UTF-8
|
||||||
encoding//src/test/resources=UTF-8
|
encoding//src/test/resources=UTF-8
|
||||||
encoding//target/generated-sources/jaxb=UTF-8
|
encoding//target/generated-sources/jaxb=UTF-8
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||||
|
|
||||||
<wb-module deploy-name="envoy-common">
|
<wb-module deploy-name="envoy-common">
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/java"/>
|
<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="/target/generated-sources/jaxb"/>
|
||||||
|
<wb-resource deploy-path="/" source-path="/src/main/xjb"/>
|
||||||
|
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
|
||||||
|
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
||||||
</project-modules>
|
</project-modules>
|
||||||
|
8
pom.xml
8
pom.xml
@ -26,6 +26,14 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>envoy-common</finalName>
|
<finalName>envoy-common</finalName>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/xjb</directory>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
22
src/main/java/envoy/schema/MessageState.java
Normal file
22
src/main/java/envoy/schema/MessageState.java
Normal 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); }
|
||||||
|
}
|
@ -21,7 +21,16 @@
|
|||||||
<xs:element name="Sender" type="xs:long" />
|
<xs:element name="Sender" type="xs:long" />
|
||||||
<xs:element name="Recipient" type="xs:long" />
|
<xs:element name="Recipient" type="xs:long" />
|
||||||
<xs:element name="Date" type="xs:date" />
|
<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:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
15
src/main/xjb/bindings.xml
Normal file
15
src/main/xjb/bindings.xml
Normal 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>
|
Reference in New Issue
Block a user