Added MessageState enumeration and XJB file for message schema
This commit is contained in:
		
							
								
								
									
										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="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
									
								
							
							
						
						
									
										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