Advertisement
Guest User

Untitled

a guest
Dec 17th, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.09 KB | None | 0 0
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>jd</groupId>
  5. <artifactId>jd</artifactId>
  6. <version>0.0.1-SNAPSHOT</version>
  7. <packaging>jar</packaging>
  8. <name>JD Example XSD to Java</name>
  9.  
  10. <properties>
  11. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  12. </properties>
  13. <build>
  14. <plugins>
  15. <!-- Plugin required to build java classes from XSD using XJC -->
  16. <plugin>
  17. <groupId>org.codehaus.mojo</groupId>
  18. <artifactId>jaxb2-maven-plugin</artifactId>
  19. <version>1.5</version>
  20. <executions>
  21. <execution>
  22. <id>xjc</id>
  23. <goals>
  24. <goal>xjc</goal>
  25. </goals>
  26. <configuration>
  27. <extension>true</extension>
  28. <arguments>-Xannotate</arguments>
  29. </configuration>
  30. </execution>
  31. </executions>
  32. <dependencies>
  33. <dependency>
  34. <groupId>org.jvnet.jaxb2_commons</groupId>
  35. <artifactId>jaxb2-basics-annotate</artifactId>
  36. <version>0.6.4</version>
  37. </dependency>
  38. </dependencies>
  39. </plugin>
  40.  
  41. </plugins>
  42. </build>
  43.  
  44. </project>
  45.  
  46. <xs:schema attributeFormDefault="unqualified"
  47. elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
  48. xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1"
  49. xmlns:annox="http://annox.dev.java.net" jaxb:extensionBindingPrefixes="annox">
  50.  
  51. <xs:element name="MyClass">
  52. <xs:complexType>
  53. <xs:annotation>
  54. <xs:appinfo>
  55. <annox:annotate>@java.lang.SuppressWarnings({"unchecked","rawtypes"})
  56. </annox:annotate>
  57. <annox:annotate target="package">@javax.annotation.Generated({"XJC","JAXB2
  58. Annotate Plugin"})</annox:annotate>
  59. </xs:appinfo>
  60. </xs:annotation>
  61. <xs:sequence>
  62. <xs:element type="xs:integer" name="id" />
  63. <xs:element type="xs:string" name="name">
  64. <xs:annotation>
  65. <xs:appinfo>
  66. <annox:annotate>@java.lang.SuppressWarnings({"unchecked","rawtypes"})
  67. </annox:annotate>
  68. <annox:annotate target="setter">@java.lang.Deprecated
  69. </annox:annotate>
  70. <annox:annotate target="setter-parameter">@java.lang.Deprecated
  71. </annox:annotate>
  72. <annox:annotate target="getter">@java.lang.Deprecated
  73. </annox:annotate>
  74. <annox:annotate target="field">@java.lang.Deprecated
  75. </annox:annotate>
  76. <annox:annotate target="class">@java.lang.Deprecated
  77. </annox:annotate>
  78. </xs:appinfo>
  79. </xs:annotation>
  80. </xs:element>
  81. <xs:element type="xs:string" name="description" />
  82. <xs:element type="xs:string" name="address" />
  83. <xs:element type="xs:dateTime" name="birthdate" />
  84. </xs:sequence>
  85. </xs:complexType>
  86. </xs:element>
  87. </xs:schema>
  88.  
  89. //
  90. // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2
  91. // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
  92. // Any modifications to this file will be lost upon recompilation of the source schema.
  93. // Generated on: 2015.12.17 at 03:45:33 PM MEZ
  94. //
  95.  
  96.  
  97. package generated;
  98.  
  99. import java.math.BigInteger;
  100. import javax.xml.bind.annotation.XmlAccessType;
  101. import javax.xml.bind.annotation.XmlAccessorType;
  102. import javax.xml.bind.annotation.XmlElement;
  103. import javax.xml.bind.annotation.XmlRootElement;
  104. import javax.xml.bind.annotation.XmlSchemaType;
  105. import javax.xml.bind.annotation.XmlType;
  106. import javax.xml.datatype.XMLGregorianCalendar;
  107.  
  108.  
  109. /**
  110. * <p>Java class for anonymous complex type.
  111. *
  112. * <p>The following schema fragment specifies the expected content contained within this class.
  113. *
  114. * <pre>
  115. * <complexType>
  116. * <complexContent>
  117. * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  118. * <sequence>
  119. * <element name="id" type="{http://www.w3.org/2001/XMLSchema}integer"/>
  120. * <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
  121. * <element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
  122. * <element name="address" type="{http://www.w3.org/2001/XMLSchema}string"/>
  123. * <element name="birthdate" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
  124. * </sequence>
  125. * </restriction>
  126. * </complexContent>
  127. * </complexType>
  128. * </pre>
  129. *
  130. *
  131. */
  132. @XmlAccessorType(XmlAccessType.FIELD)
  133. @XmlType(name = "", propOrder = {
  134. "id",
  135. "name",
  136. "description",
  137. "address",
  138. "birthdate"
  139. })
  140. @XmlRootElement(name = "MyClass")
  141. public class MyClass {
  142.  
  143. @XmlElement(required = true)
  144. protected BigInteger id;
  145. @XmlElement(required = true)
  146. protected String name;
  147. @XmlElement(required = true)
  148. protected String description;
  149. @XmlElement(required = true)
  150. protected String address;
  151. @XmlElement(required = true)
  152. @XmlSchemaType(name = "dateTime")
  153. protected XMLGregorianCalendar birthdate;
  154.  
  155. /**
  156. * Gets the value of the id property.
  157. *
  158. * @return
  159. * possible object is
  160. * {@link BigInteger }
  161. *
  162. */
  163. public BigInteger getId() {
  164. return id;
  165. }
  166.  
  167. /**
  168. * Sets the value of the id property.
  169. *
  170. * @param value
  171. * allowed object is
  172. * {@link BigInteger }
  173. *
  174. */
  175. public void setId(BigInteger value) {
  176. this.id = value;
  177. }
  178.  
  179. /**
  180. * Gets the value of the name property.
  181. *
  182. * @return
  183. * possible object is
  184. * {@link String }
  185. *
  186. */
  187. public String getName() {
  188. return name;
  189. }
  190.  
  191. /**
  192. * Sets the value of the name property.
  193. *
  194. * @param value
  195. * allowed object is
  196. * {@link String }
  197. *
  198. */
  199. public void setName(String value) {
  200. this.name = value;
  201. }
  202.  
  203. /**
  204. * Gets the value of the description property.
  205. *
  206. * @return
  207. * possible object is
  208. * {@link String }
  209. *
  210. */
  211. public String getDescription() {
  212. return description;
  213. }
  214.  
  215. /**
  216. * Sets the value of the description property.
  217. *
  218. * @param value
  219. * allowed object is
  220. * {@link String }
  221. *
  222. */
  223. public void setDescription(String value) {
  224. this.description = value;
  225. }
  226.  
  227. /**
  228. * Gets the value of the address property.
  229. *
  230. * @return
  231. * possible object is
  232. * {@link String }
  233. *
  234. */
  235. public String getAddress() {
  236. return address;
  237. }
  238.  
  239. /**
  240. * Sets the value of the address property.
  241. *
  242. * @param value
  243. * allowed object is
  244. * {@link String }
  245. *
  246. */
  247. public void setAddress(String value) {
  248. this.address = value;
  249. }
  250.  
  251. /**
  252. * Gets the value of the birthdate property.
  253. *
  254. * @return
  255. * possible object is
  256. * {@link XMLGregorianCalendar }
  257. *
  258. */
  259. public XMLGregorianCalendar getBirthdate() {
  260. return birthdate;
  261. }
  262.  
  263. /**
  264. * Sets the value of the birthdate property.
  265. *
  266. * @param value
  267. * allowed object is
  268. * {@link XMLGregorianCalendar }
  269. *
  270. */
  271. public void setBirthdate(XMLGregorianCalendar value) {
  272. this.birthdate = value;
  273. }
  274.  
  275. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement