{"id":85969,"date":"2019-01-11T01:11:38","date_gmt":"2019-01-10T23:11:38","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?page_id=85969"},"modified":"2023-03-06T16:33:06","modified_gmt":"2023-03-06T14:33:06","slug":"jaxb-tutorials","status":"publish","type":"page","link":"https:\/\/www.javacodegeeks.com\/jaxb-tutorials","title":{"rendered":"JAXB Tutorials"},"content":{"rendered":"<p><img decoding=\"async\" class=\"aligncenter wp-image-62\" style=\"border: none;\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" alt=\"JAXB TUTORIALS\" width=\"300\" height=\"300\"><\/p>\n<p>In this detailed Resource page, we feature <strong>JAXB Tutorials<\/strong>!<\/p>\n<p>Java Architecture for XML Binding (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Java_Architecture_for_XML_Binding\">JAXB<\/a>) is a software framework that allows Java developers to map Java classes to XML representations. JAXB provides two main features: the ability to marshal Java objects into XML and the inverse, i.e. to unmarshal XML back into Java objects. In other words, JAXB allows storing and retrieving data in memory in any XML format, without the need to implement a specific set of XML loading and saving routines for the program&#8217;s class structure. It is similar to <code>xsd.exe<\/code> and <code>XmlSerializer<\/code> in the .NET Framework.<\/p>\n<p>JAXB is particularly useful when the specification is complex and changing. In such a case, regularly changing the XML Schema definitions to keep them synchronised with the Java definitions can be time consuming and error-prone.<\/p>\n<p>JAXB is a part of the Java SE platform and one of the APIs in the Java EE platform, and is part of the Java Web Services Development Pack (JWSDP). It is also one of the foundations for WSIT. As of Java 11, JAXB will be removed from the Java SE platform and moved to the Jakarta EE project. For details, see JEP 320.<\/p>\n<p>JAXB 1.0 was developed under the Java Community Process as JSR 31. In 2006 JAXB 2.0 was released under JSR 222 and Maintenance Release 2 released in December 2009. Reference implementations for these specifications are available under the CDDL open source license at java.net.<\/p>\n<p><strong>Usage<\/strong><\/p>\n<p>The tool &#8220;<tt>xjc<\/tt>&#8221; can be used to convert XML Schema and other schema file types (as of Java 1.6, RELAX NG, XML DTD, and WSDL are supported experimentally) to class representations. Classes are marked up using annotations from <tt>javax.xml.bind.annotation.*<\/tt> namespace, for example, <tt>@XmlRootElement<\/tt> and <tt>@XmlElement<\/tt>. XML list sequences are represented by attributes of type <tt>java.util.List<\/tt>. Marshallers and Unmarshallers are created through an instance of JAXBContext.<\/p>\n<p>In addition, JAXB includes a &#8220;<tt>schemagen<\/tt>&#8221; tool that can essentially perform the inverse of &#8220;<tt>xjc<\/tt>&#8220;, creating an XML Schema from a set of annotated classes.<\/p>\n<div class=\"tip\"><strong>Note<\/strong><br \/>\nIf you wish to build up your JAXB knowledge first, check out our&nbsp;<a href=\"https:\/\/www.javacodegeeks.com\/2014\/12\/jaxb-tutorial-xml-binding.html\">JAXB Tutorial for Java XML Binding \u2013 The ULTIMATE Guide<\/a>.<\/div>\n<p>[ulp id=&#8217;MOSziNmDYMVLcpBd&#8217;]<\/p>\n<h2>JAXB Tutorials \u2013 Getting Started<\/h2>\n<h4>Simple examples based on Java Architecture for XML Binding<\/h4>\n<ul>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/core-java\/xml\/bind\/jaxbcontext\/jaxb-hello-world-example\/\">JAXB Hello World example<\/a><br \/>\nWith this example we shall show you how to work with the JAXB framework in Java.<\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/enterprise-java\/jws\/jax-ws-jaxb-example\/\">JAX-WS JAXB Example<\/a><br \/>\nIn this example, I will build a JAX-WS service with three steps.<\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/core-java\/xml\/bind\/jaxb-schema-validation-example\/\">JAXB Schema Validation Example<\/a><br \/>\nIn this example, we shall learn how to validate XML against schema using JAXB.<\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/core-java\/xml\/bind\/jaxb-binding-example\/\">JAXB Binding Example<\/a><br \/>\nThis is an example of JAXB Binding.<\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/core-java\/xml\/bind\/jaxb-json-example\/\">JAXB JSON Example<\/a><br \/>\nIn this example we shall show you how to make use of JAXB-JSON.<\/li>\n<\/ul>\n<h2>JAXB Tutorials \u2013 Integrations<\/h2>\n<h4>Learn how to use JAXB with RESTEasy and Jettison<\/h4>\n<ul>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/enterprise-java\/rest\/resteasy\/json-example-with-resteasy-jaxb-jettison\/\">JSON Example With RESTEasy + JAXB + Jettison<\/a><br \/>\nIn this tutorial we are going to see how you can integrate RESTEasy with Jettison to develop JAX-RS RESTful services that produce and consume JSON streams.<\/li>\n<li><a href=\"https:\/\/examples.javacodegeeks.com\/enterprise-java\/rest\/resteasy\/xml-example-with-resteasy-jaxb\/\">XML Example With RESTEasy+ JAXB<\/a><br \/>\nIn this example we are going to see how you can integrate RESTEasy&nbsp;with&nbsp;JAXB&nbsp;(Java Architecture for XML Binding) to create RESTful services that consume and produce XML streams.<\/li>\n<\/ul>\n<p>[undereg]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this detailed Resource page, we feature JAXB Tutorials! Java Architecture for XML Binding (JAXB) is a software framework that allows Java developers to map Java classes to XML representations. JAXB provides two main features: the ability to marshal Java objects into XML and the inverse, i.e. to unmarshal XML back into Java objects. In &hellip;<\/p>\n","protected":false},"author":34987,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-85969","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JAXB Tutorials - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Intersted to learn more about JAXB? Then check out our detailed Resource page where we feature an abundance of JAXB Tutorials!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/jaxb-tutorials\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JAXB Tutorials - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Intersted to learn more about JAXB? Then check out our detailed Resource page where we feature an abundance of JAXB Tutorials!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/jaxb-tutorials\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-06T14:33:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/jaxb-tutorials\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/jaxb-tutorials\",\"name\":\"JAXB Tutorials - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/jaxb-tutorials#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/jaxb-tutorials#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2019-01-10T23:11:38+00:00\",\"dateModified\":\"2023-03-06T14:33:06+00:00\",\"description\":\"Intersted to learn more about JAXB? Then check out our detailed Resource page where we feature an abundance of JAXB Tutorials!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/jaxb-tutorials#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/jaxb-tutorials\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/jaxb-tutorials#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/jaxb-tutorials#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JAXB Tutorials\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JAXB Tutorials - Java Code Geeks","description":"Intersted to learn more about JAXB? Then check out our detailed Resource page where we feature an abundance of JAXB Tutorials!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/jaxb-tutorials","og_locale":"en_US","og_type":"article","og_title":"JAXB Tutorials - Java Code Geeks","og_description":"Intersted to learn more about JAXB? Then check out our detailed Resource page where we feature an abundance of JAXB Tutorials!","og_url":"https:\/\/www.javacodegeeks.com\/jaxb-tutorials","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_modified_time":"2023-03-06T14:33:06+00:00","og_image":[{"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_site":"@javacodegeeks","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/jaxb-tutorials","url":"https:\/\/www.javacodegeeks.com\/jaxb-tutorials","name":"JAXB Tutorials - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/jaxb-tutorials#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/jaxb-tutorials#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2019-01-10T23:11:38+00:00","dateModified":"2023-03-06T14:33:06+00:00","description":"Intersted to learn more about JAXB? Then check out our detailed Resource page where we feature an abundance of JAXB Tutorials!","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/jaxb-tutorials#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/jaxb-tutorials"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/jaxb-tutorials#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/jaxb-tutorials#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JAXB Tutorials"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/pages\/85969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/34987"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=85969"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/pages\/85969\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=85969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}