{"id":19958,"date":"2013-12-27T16:00:46","date_gmt":"2013-12-27T14:00:46","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=19958"},"modified":"2013-12-26T22:39:51","modified_gmt":"2013-12-26T20:39:51","slug":"orika-mapping-jaxb-objects-to-businessdomain-objects","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html","title":{"rendered":"Orika: Mapping JAXB Objects to Business\/Domain Objects"},"content":{"rendered":"<p>This post looks at mapping JAXB objects to business domain objects with <a href=\"https:\/\/code.google.com\/p\/orika\/\">Orika<\/a>. Earlier this month, <a href=\"http:\/\/marxsoftware.blogspot.com\/2013\/12\/dozer-mapping.html\">I covered the same mapping use case<\/a> using <a>reflection<\/a>-based <a href=\"http:\/\/dozer.sourceforge.net\/\">Dozer<\/a>. In this post, I&#8217;ll assume the same example classes need to be mapped, but they will be <a href=\"http:\/\/kenblair.net\/orika-spring-easy-bean-mapping\/\">mapped<\/a> using <a href=\"http:\/\/orika-mapper.github.io\/orika-docs\/intro.html\">Orika<\/a> instead of <a href=\"http:\/\/dozer.sourceforge.net\/documentation\/about.html\">Dozer<\/a>.<\/p>\n<p>Dozer and <a href=\"https:\/\/code.google.com\/p\/orika\/wiki\/GettingStartedGuide\">Orika<\/a> are intended to solve the same type of problem: the automatic mapping of two &#8220;data&#8221; objects that do not share a common inheritance but represent the same same of data fields. Dozer <a href=\"http:\/\/dozer.sourceforge.net\/documentation\/faq.html#dataobject-support\">uses reflection<\/a> to accomplish this while <a href=\"http:\/\/orika-mapper.github.io\/orika-docs\/faq.html\">Orika uses<\/a> reflection and <a href=\"http:\/\/arhipov.blogspot.com\/2011\/01\/java-bytecode-fundamentals.html\">bytecode<\/a> manipulation to accomplish it. Orika&#8217;s slogan is, &#8220;simpler, lighter and faster Java bean mapping.&#8221;<\/p>\n<p><a href=\"https:\/\/github.com\/orika-mapper\/orika\">Orika<\/a> has an <a href=\"http:\/\/www.apache.org\/licenses\/LICENSE-2.0\">Apache License, Version 2<\/a>, and can be downloaded at <a href=\"https:\/\/github.com\/orika-mapper\/orika\/archive\/master.zip\">https:\/\/github.com\/orika-mapper\/orika\/archive\/master.zip<\/a> (sources) or at <a href=\"http:\/\/search.maven.org\/#search|ga|1|orika\">http:\/\/search.maven.org\/#search|ga|1|orika<\/a> (binaries). Orika has <a href=\"http:\/\/orika-mapper.github.io\/orika-docs\/intro.html\">dependencies<\/a> on <a href=\"http:\/\/www.javassist.org\/\u200e\">Javassist<\/a> (for bytecode manipulation), <a href=\"http:\/\/www.slf4j.org\/\">SLF4J<\/a>, and <a href=\"https:\/\/github.com\/paul-hammant\/paranamer\">paranamer<\/a> (to access method\/constructor parameter names at runtime). Two of these three dependencies (JavaAssist and paranamer but not SLF4J) are bundled in <code>orika-core-1.4.4-deps-included.jar<\/code>. If the dependencies are already available, the slimmer <code>orika-core-1.4.4.jar<\/code> can be used instead. As the names of these JARs suggest, I&#8217;m using Orika 1.4.4 for my examples in this post.<\/p>\n<p>In my post <a href=\"http:\/\/marxsoftware.blogspot.com\/2013\/12\/dozer-mapping.html\">Dozer: Mapping JAXB Objects to Business\/Domain Objects<\/a>, I discussed reasons that using instances of JAXB-generatated classes as business or domain objects is often not desirable. I then showed &#8220;traditional&#8221; ways of mapping between JAXB-generated classes and custom data classes so that data could be passed throughout an application in the business domain data objects. For this post, I will be using the same approach, but with Orika doing the mapping rather than doing custom mapping or using Dozer for the mapping. For convenience, I include the cost listings here for the JAXB-generated classes <code>com.blogspot.marxsoftware.AddressType<\/code> and <code>com.blogspot.marxsoftware.PersonType<\/code> as well as the renamed custom data classes <code>dustin.examples.orikademo.Address<\/code> and <code>dustin.examples.orikademo.Person<\/code>.<\/p>\n<h2>JAXB-generated AddressType.java<\/h2>\n<pre class=\" brush:java\">\/\/\r\n\/\/ This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r\n\/\/ See &lt;a href=\"http:\/\/java.sun.com\/xml\/jaxb\"&gt;http:\/\/java.sun.com\/xml\/jaxb&lt;\/a&gt; \r\n\/\/ Any modifications to this file will be lost upon recompilation of the source schema. \r\n\/\/ Generated on: 2013.12.03 at 11:44:32 PM MST \r\n\/\/\r\n\r\npackage com.blogspot.marxsoftware;\r\n\r\nimport javax.xml.bind.annotation.XmlAccessType;\r\nimport javax.xml.bind.annotation.XmlAccessorType;\r\nimport javax.xml.bind.annotation.XmlAttribute;\r\nimport javax.xml.bind.annotation.XmlType;\r\n\r\n\/**\r\n * &lt;p&gt;Java class for AddressType complex type.\r\n * \r\n * &lt;p&gt;The following schema fragment specifies the expected content contained within this class.\r\n * \r\n * &lt;pre&gt;\r\n * &lt;complexType name=\"AddressType\"&gt;\r\n *   &lt;complexContent&gt;\r\n *     &lt;restriction base=\"{http:\/\/www.w3.org\/2001\/XMLSchema}anyType\"&gt;\r\n *       &lt;attribute name=\"streetAddress1\" use=\"required\" type=\"{http:\/\/www.w3.org\/2001\/XMLSchema}string\" \/&gt;\r\n *       &lt;attribute name=\"streetAddress2\" type=\"{http:\/\/www.w3.org\/2001\/XMLSchema}string\" \/&gt;\r\n *       &lt;attribute name=\"city\" use=\"required\" type=\"{http:\/\/www.w3.org\/2001\/XMLSchema}string\" \/&gt;\r\n *       &lt;attribute name=\"state\" use=\"required\" type=\"{http:\/\/www.w3.org\/2001\/XMLSchema}string\" \/&gt;\r\n *       &lt;attribute name=\"zipcode\" use=\"required\" type=\"{http:\/\/www.w3.org\/2001\/XMLSchema}string\" \/&gt;\r\n *     &lt;\/restriction&gt;\r\n *   &lt;\/complexContent&gt;\r\n * &lt;\/complexType&gt;\r\n * &lt;\/pre&gt;\r\n * \r\n * \r\n *\/\r\n@XmlAccessorType(XmlAccessType.FIELD)\r\n@XmlType(name = \"AddressType\")\r\npublic class AddressType {\r\n\r\n    @XmlAttribute(name = \"streetAddress1\", required = true)\r\n    protected String streetAddress1;\r\n    @XmlAttribute(name = \"streetAddress2\")\r\n    protected String streetAddress2;\r\n    @XmlAttribute(name = \"city\", required = true)\r\n    protected String city;\r\n    @XmlAttribute(name = \"state\", required = true)\r\n    protected String state;\r\n    @XmlAttribute(name = \"zipcode\", required = true)\r\n    protected String zipcode;\r\n\r\n    \/**\r\n     * Gets the value of the streetAddress1 property.\r\n     * \r\n     * @return\r\n     *     possible object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public String getStreetAddress1() {\r\n        return streetAddress1;\r\n    }\r\n\r\n    \/**\r\n     * Sets the value of the streetAddress1 property.\r\n     * \r\n     * @param value\r\n     *     allowed object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public void setStreetAddress1(String value) {\r\n        this.streetAddress1 = value;\r\n    }\r\n\r\n    \/**\r\n     * Gets the value of the streetAddress2 property.\r\n     * \r\n     * @return\r\n     *     possible object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public String getStreetAddress2() {\r\n        return streetAddress2;\r\n    }\r\n\r\n    \/**\r\n     * Sets the value of the streetAddress2 property.\r\n     * \r\n     * @param value\r\n     *     allowed object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public void setStreetAddress2(String value) {\r\n        this.streetAddress2 = value;\r\n    }\r\n\r\n    \/**\r\n     * Gets the value of the city property.\r\n     * \r\n     * @return\r\n     *     possible object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public String getCity() {\r\n        return city;\r\n    }\r\n\r\n    \/**\r\n     * Sets the value of the city property.\r\n     * \r\n     * @param value\r\n     *     allowed object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public void setCity(String value) {\r\n        this.city = value;\r\n    }\r\n\r\n    \/**\r\n     * Gets the value of the state property.\r\n     * \r\n     * @return\r\n     *     possible object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public String getState() {\r\n        return state;\r\n    }\r\n\r\n    \/**\r\n     * Sets the value of the state property.\r\n     * \r\n     * @param value\r\n     *     allowed object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public void setState(String value) {\r\n        this.state = value;\r\n    }\r\n\r\n    \/**\r\n     * Gets the value of the zipcode property.\r\n     * \r\n     * @return\r\n     *     possible object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public String getZipcode() {\r\n        return zipcode;\r\n    }\r\n\r\n    \/**\r\n     * Sets the value of the zipcode property.\r\n     * \r\n     * @param value\r\n     *     allowed object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public void setZipcode(String value) {\r\n        this.zipcode = value;\r\n    }\r\n\r\n}<\/pre>\n<h2>JAXB-generated PersonType.java<\/h2>\n<pre class=\" brush:java\">\/\/\r\n\/\/ This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r\n\/\/ See &lt;a href=\"http:\/\/java.sun.com\/xml\/jaxb\"&gt;http:\/\/java.sun.com\/xml\/jaxb&lt;\/a&gt; \r\n\/\/ Any modifications to this file will be lost upon recompilation of the source schema. \r\n\/\/ Generated on: 2013.12.03 at 11:44:32 PM MST \r\n\/\/\r\n\r\npackage com.blogspot.marxsoftware;\r\n\r\nimport javax.xml.bind.annotation.XmlAccessType;\r\nimport javax.xml.bind.annotation.XmlAccessorType;\r\nimport javax.xml.bind.annotation.XmlAttribute;\r\nimport javax.xml.bind.annotation.XmlElement;\r\nimport javax.xml.bind.annotation.XmlType;\r\n\r\n\/**\r\n * &lt;p&gt;Java class for PersonType complex type.\r\n * \r\n * &lt;p&gt;The following schema fragment specifies the expected content contained within this class.\r\n * \r\n * &lt;pre&gt;\r\n * &lt;complexType name=\"PersonType\"&gt;\r\n *   &lt;complexContent&gt;\r\n *     &lt;restriction base=\"{http:\/\/www.w3.org\/2001\/XMLSchema}anyType\"&gt;\r\n *       &lt;sequence&gt;\r\n *         &lt;element name=\"MailingAddress\" type=\"{http:\/\/marxsoftware.blogspot.com\/}AddressType\"\/&gt;\r\n *         &lt;element name=\"ResidentialAddress\" type=\"{http:\/\/marxsoftware.blogspot.com\/}AddressType\" minOccurs=\"0\"\/&gt;\r\n *       &lt;\/sequence&gt;\r\n *       &lt;attribute name=\"firstName\" type=\"{http:\/\/www.w3.org\/2001\/XMLSchema}string\" \/&gt;\r\n *       &lt;attribute name=\"lastName\" type=\"{http:\/\/www.w3.org\/2001\/XMLSchema}string\" \/&gt;\r\n *     &lt;\/restriction&gt;\r\n *   &lt;\/complexContent&gt;\r\n * &lt;\/complexType&gt;\r\n * &lt;\/pre&gt;\r\n * \r\n * \r\n *\/\r\n@XmlAccessorType(XmlAccessType.FIELD)\r\n@XmlType(name = \"PersonType\", propOrder = {\r\n    \"mailingAddress\",\r\n    \"residentialAddress\"\r\n})\r\npublic class PersonType {\r\n\r\n    @XmlElement(name = \"MailingAddress\", required = true)\r\n    protected AddressType mailingAddress;\r\n    @XmlElement(name = \"ResidentialAddress\")\r\n    protected AddressType residentialAddress;\r\n    @XmlAttribute(name = \"firstName\")\r\n    protected String firstName;\r\n    @XmlAttribute(name = \"lastName\")\r\n    protected String lastName;\r\n\r\n    \/**\r\n     * Gets the value of the mailingAddress property.\r\n     * \r\n     * @return\r\n     *     possible object is\r\n     *     {@link AddressType }\r\n     *     \r\n     *\/\r\n    public AddressType getMailingAddress() {\r\n        return mailingAddress;\r\n    }\r\n\r\n    \/**\r\n     * Sets the value of the mailingAddress property.\r\n     * \r\n     * @param value\r\n     *     allowed object is\r\n     *     {@link AddressType }\r\n     *     \r\n     *\/\r\n    public void setMailingAddress(AddressType value) {\r\n        this.mailingAddress = value;\r\n    }\r\n\r\n    \/**\r\n     * Gets the value of the residentialAddress property.\r\n     * \r\n     * @return\r\n     *     possible object is\r\n     *     {@link AddressType }\r\n     *     \r\n     *\/\r\n    public AddressType getResidentialAddress() {\r\n        return residentialAddress;\r\n    }\r\n\r\n    \/**\r\n     * Sets the value of the residentialAddress property.\r\n     * \r\n     * @param value\r\n     *     allowed object is\r\n     *     {@link AddressType }\r\n     *     \r\n     *\/\r\n    public void setResidentialAddress(AddressType value) {\r\n        this.residentialAddress = value;\r\n    }\r\n\r\n    \/**\r\n     * Gets the value of the firstName property.\r\n     * \r\n     * @return\r\n     *     possible object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public String getFirstName() {\r\n        return firstName;\r\n    }\r\n\r\n    \/**\r\n     * Sets the value of the firstName property.\r\n     * \r\n     * @param value\r\n     *     allowed object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public void setFirstName(String value) {\r\n        this.firstName = value;\r\n    }\r\n\r\n    \/**\r\n     * Gets the value of the lastName property.\r\n     * \r\n     * @return\r\n     *     possible object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public String getLastName() {\r\n        return lastName;\r\n    }\r\n\r\n    \/**\r\n     * Sets the value of the lastName property.\r\n     * \r\n     * @param value\r\n     *     allowed object is\r\n     *     {@link String }\r\n     *     \r\n     *\/\r\n    public void setLastName(String value) {\r\n        this.lastName = value;\r\n    }\r\n\r\n}<\/pre>\n<h2>Domain\/Business Class Address.java<\/h2>\n<pre class=\" brush:java\">package dustin.examples.orikademo;\r\n\r\nimport java.util.Objects;\r\n\r\n\/**\r\n * Address class.\r\n * \r\n * @author Dustin\r\n *\/\r\npublic class Address\r\n{\r\n   private String streetAddress1;\r\n   private String streetAddress2;\r\n   private String municipality;\r\n   private String state;\r\n   private String zipCode;\r\n\r\n   public Address() {}\r\n\r\n   public Address(\r\n      final String newStreetAddress1,\r\n      final String newStreetAddress2,\r\n      final String newMunicipality,\r\n      final String newState,\r\n      final String newZipCode)\r\n   {\r\n      this.streetAddress1 = newStreetAddress1;\r\n      this.streetAddress2 = newStreetAddress2;\r\n      this.municipality = newMunicipality;\r\n      this.state = newState;\r\n      this.zipCode = newZipCode;\r\n   }\r\n\r\n   public String getStreetAddress1()\r\n   {\r\n      return this.streetAddress1;\r\n   }\r\n\r\n   public void setStreetAddress1(String streetAddress1)\r\n   {\r\n      this.streetAddress1 = streetAddress1;\r\n   }\r\n\r\n   public String getStreetAddress2()\r\n   {\r\n      return this.streetAddress2;\r\n   }\r\n\r\n   public void setStreetAddress2(String streetAddress2)\r\n   {\r\n      this.streetAddress2 = streetAddress2;\r\n   }\r\n\r\n   public String getMunicipality()\r\n   {\r\n      return this.municipality;\r\n   }\r\n\r\n   public void setMunicipality(String municipality)\r\n   {\r\n      this.municipality = municipality;\r\n   }\r\n\r\n   public String getState() {\r\n      return this.state;\r\n   }\r\n\r\n   public void setState(String state)\r\n   {\r\n      this.state = state;\r\n   }\r\n\r\n   public String getZipCode() \r\n   {\r\n      return this.zipCode;\r\n   }\r\n\r\n   public void setZipCode(String zipCode)\r\n   {\r\n      this.zipCode = zipCode;\r\n   }\r\n\r\n   @Override\r\n   public int hashCode()\r\n   {\r\n      return Objects.hash(\r\n         this.streetAddress1, this.streetAddress2, this.municipality,\r\n         this.state, this.zipCode);\r\n   }\r\n\r\n   @Override\r\n   public boolean equals(Object obj)\r\n   {\r\n      if (obj == null) {\r\n         return false;\r\n      }\r\n      if (getClass() != obj.getClass()) {\r\n         return false;\r\n      }\r\n      final Address other = (Address) obj;\r\n      if (!Objects.equals(this.streetAddress1, other.streetAddress1))\r\n      {\r\n         return false;\r\n      }\r\n      if (!Objects.equals(this.streetAddress2, other.streetAddress2))\r\n      {\r\n         return false;\r\n      }\r\n      if (!Objects.equals(this.municipality, other.municipality))\r\n      {\r\n         return false;\r\n      }\r\n      if (!Objects.equals(this.state, other.state))\r\n      {\r\n         return false;\r\n      }\r\n      if (!Objects.equals(this.zipCode, other.zipCode))\r\n      {\r\n         return false;\r\n      }\r\n      return true;\r\n   }\r\n\r\n   @Override\r\n   public String toString()\r\n   {\r\n      return \"Address{\" + \"streetAddress1=\" + streetAddress1 + \", streetAddress2=\"\r\n         + streetAddress2 + \", municipality=\" + municipality + \", state=\" + state\r\n         + \", zipCode=\" + zipCode + '}';\r\n   }\r\n\r\n}<\/pre>\n<h2>Domain\/Business Class Person.java<\/h2>\n<pre class=\" brush:java\">package dustin.examples.orikademo;\r\n\r\nimport java.util.Objects;\r\n\r\n\/**\r\n * Person class.\r\n * \r\n * @author Dustin\r\n *\/\r\npublic class Person\r\n{\r\n   private String lastName;\r\n   private String firstName;\r\n   private Address mailingAddress;\r\n   private Address residentialAddress;\r\n\r\n   public Person() {}\r\n\r\n   public Person(\r\n      final String newLastName,\r\n      final String newFirstName,\r\n      final Address newResidentialAddress,\r\n      final Address newMailingAddress)\r\n   {\r\n      this.lastName = newLastName;\r\n      this.firstName = newFirstName;\r\n      this.residentialAddress = newResidentialAddress;\r\n      this.mailingAddress = newMailingAddress;\r\n   }\r\n\r\n   public String getLastName()\r\n   {\r\n      return this.lastName;\r\n   }\r\n\r\n   public void setLastName(String lastName) {\r\n      this.lastName = lastName;\r\n   }\r\n\r\n   public String getFirstName()\r\n   {\r\n      return this.firstName;\r\n   }\r\n\r\n   public void setFirstName(String firstName)\r\n   {\r\n      this.firstName = firstName;\r\n   }\r\n\r\n   public Address getMailingAddress()\r\n   {\r\n      return this.mailingAddress;\r\n   }\r\n\r\n   public void setMailingAddress(Address mailingAddress)\r\n   {\r\n      this.mailingAddress = mailingAddress;\r\n   }\r\n\r\n   public Address getResidentialAddress()\r\n   {\r\n      return this.residentialAddress;\r\n   }\r\n\r\n   public void setResidentialAddress(Address residentialAddress)\r\n   {\r\n      this.residentialAddress = residentialAddress;\r\n   }\r\n\r\n   @Override\r\n   public int hashCode()\r\n   {\r\n      int hash = 3;\r\n      hash = 19 * hash + Objects.hashCode(this.lastName);\r\n      hash = 19 * hash + Objects.hashCode(this.firstName);\r\n      hash = 19 * hash + Objects.hashCode(this.mailingAddress);\r\n      hash = 19 * hash + Objects.hashCode(this.residentialAddress);\r\n      return hash;\r\n   }\r\n\r\n   @Override\r\n   public boolean equals(Object obj)\r\n   {\r\n      if (obj == null)\r\n      {\r\n         return false;\r\n      }\r\n      if (getClass() != obj.getClass())\r\n      {\r\n         return false;\r\n      }\r\n      final Person other = (Person) obj;\r\n      if (!Objects.equals(this.lastName, other.lastName))\r\n      {\r\n         return false;\r\n      }\r\n      if (!Objects.equals(this.firstName, other.firstName))\r\n      {\r\n         return false;\r\n      }\r\n      if (!Objects.equals(this.mailingAddress, other.mailingAddress))\r\n      {\r\n         return false;\r\n      }\r\n      if (!Objects.equals(this.residentialAddress, other.residentialAddress))\r\n      {\r\n         return false;\r\n      }\r\n      return true;\r\n   }\r\n\r\n   @Override\r\n   public String toString() {\r\n      return  \"Person{\" + \"lastName=\" + lastName + \", firstName=\" + firstName\r\n            + \", mailingAddress=\" + mailingAddress + \", residentialAddress=\"\r\n            + residentialAddress + '}';\r\n   }\r\n\r\n}<\/pre>\n<p>As was the case with Dozer, the classes being mapped need to have no-arguments constructors and &#8220;set&#8221; and &#8220;get&#8221; methods to support conversion in both directions without any special additional configuration. Also, as was the case with Dozer, Orika maps same-named fields automatically and makes it easy to configure the mapping of the exceptions (fields whose names don&#8217;t match). The next code listing, for a class I call <code>OrikaPersonConverter<\/code>, demonstrates the instantiation and <a href=\"http:\/\/orika-mapper.github.io\/orika-docs\/mapper-factory.html\">configuration of an Orika MapperFactory<\/a> to map most fields by default and to <a href=\"http:\/\/orika-mapper.github.io\/orika-docs\/examples.html\">map the fields with different names<\/a> than each other (&#8220;municipality&#8221; and &#8220;city&#8221;) through explicit mapping configuration. Once the <a href=\"http:\/\/orika-mapper.github.io\/orika-docs\/advanced-mappings.html\">MapperFactory is configured<\/a>, copying from one object to another is easy and both directions are depicted in the methods <code>copyPersonTypeFromPerson<\/code> and <code>copyPersonFromPersonType<\/code>.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h2>OrikaPersonConverter<\/h2>\n<pre class=\" brush:java\">package dustin.examples.orikademo;\r\n\r\nimport com.blogspot.marxsoftware.AddressType;\r\nimport com.blogspot.marxsoftware.PersonType;\r\nimport ma.glasnost.orika.MapperFacade;\r\nimport ma.glasnost.orika.MapperFactory;\r\nimport ma.glasnost.orika.impl.DefaultMapperFactory;\r\n\r\n\/**\r\n * Convert between instances of {@link com.blogspot.marxsoftware.PersonType}\r\n * and {@link dustin.examples.orikademo.Person}.\r\n * \r\n * @author Dustin\r\n *\/\r\npublic class OrikaPersonConverter\r\n{\r\n   \/** Orika Mapper Facade. *\/\r\n   private final static MapperFacade mapper;\r\n\r\n   static\r\n   {\r\n      final MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();\r\n      mapperFactory.classMap(Address.class, AddressType.class)\r\n                   .field(\"municipality\", \"city\")\r\n                   .byDefault()\r\n                   .register();\r\n      mapper = mapperFactory.getMapperFacade();\r\n   }\r\n\r\n   \/** No-arguments constructor. *\/\r\n   public OrikaPersonConverter() {}\r\n\r\n   \/**\r\n    * Provide an instance of {@link com.blogspot.marxsoftware.PersonType}\r\n    * that corresponds with provided {@link dustin.examples.orikademo.Person} as\r\n    * mapped by Dozer Mapper.\r\n    * \r\n    * @param person Instance of {@link dustin.examples.orikademo.Person} from which\r\n    *    {@link com.blogspot.marxsoftware.PersonType} will be extracted.\r\n    * @return Instance of {@link com.blogspot.marxsoftware.PersonType} that\r\n    *    is based on provided {@link dustin.examples.orikademo.Person} instance.\r\n    *\/\r\n   public PersonType copyPersonTypeFromPerson(final Person person)\r\n   {\r\n      PersonType personType = mapper.map(person, PersonType.class);\r\n      return personType;\r\n   }\r\n\r\n   \/**\r\n    * Provide an instance of {@link dustin.examples.orikademo.Person} that corresponds\r\n    * with the provided {@link com.blogspot.marxsoftware.PersonType} as \r\n    * mapped by Dozer Mapper.\r\n    * \r\n    * @param personType Instance of {@link com.blogspot.marxsoftware.PersonType}\r\n    *    from which {@link dustin.examples.orikademo.Person} will be extracted.\r\n    * @return Instance of {@link dustin.examples.orikademo.Person} that is based on the\r\n    *    provided {@link com.blogspot.marxsoftware.PersonType}.\r\n    *\/\r\n   public Person copyPersonFromPersonType(final PersonType personType)\r\n   {\r\n      Person person = mapper.map(personType, Person.class);\r\n      return person;\r\n   }\r\n}<\/pre>\n<p>As is the case with Dozer, the mapping between two classes is bidirectional and so only needs to be made once and will apply in copying from either object to the other.<\/p>\n<h2>Conclusion<\/h2>\n<p>Like Dozer, Orika offers much more customizability and flexibility than demonstrated in this post. However, for relatively simple mappings (which are very common with applications using JAXB-generated objects), Orika is very easy to use out of the box. A good resource for learning more about Orika is the <a href=\"http:\/\/orika-mapper.github.io\/orika-docs\/index.html\">Orika User Guide<\/a>.<br \/>\n&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/marxsoftware.blogspot.com\/2013\/12\/orika-mapping.html\">Orika: Mapping JAXB Objects to Business\/Domain Objects<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Dustin Marx at the <a href=\"http:\/\/marxsoftware.blogspot.com\/\">Inspired by Actual Events <\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This post looks at mapping JAXB objects to business domain objects with Orika. Earlier this month, I covered the same mapping use case using reflection-based Dozer. In this post, I&#8217;ll assume the same example classes need to be mapped, but they will be mapped using Orika instead of Dozer. Dozer and Orika are intended to &hellip;<\/p>\n","protected":false},"author":122,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[144,902],"class_list":["post-19958","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-jaxb","tag-orika"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Orika: Mapping JAXB Objects to Business\/Domain Objects<\/title>\n<meta name=\"description\" content=\"This post looks at mapping JAXB objects to business domain objects with Orika. Earlier this month, I covered the same mapping use case using\" \/>\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\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Orika: Mapping JAXB Objects to Business\/Domain Objects\" \/>\n<meta property=\"og:description\" content=\"This post looks at mapping JAXB objects to business domain objects with Orika. Earlier this month, I covered the same mapping use case using\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html\" \/>\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:published_time\" content=\"2013-12-27T14:00:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Dustin Marx\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dustin Marx\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html\"},\"author\":{\"name\":\"Dustin Marx\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/945db7c24d37de80481570a5643f7958\"},\"headline\":\"Orika: Mapping JAXB Objects to Business\\\/Domain Objects\",\"datePublished\":\"2013-12-27T14:00:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html\"},\"wordCount\":568,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"JAXB\",\"Orika\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html\",\"name\":\"Orika: Mapping JAXB Objects to Business\\\/Domain Objects\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2013-12-27T14:00:46+00:00\",\"description\":\"This post looks at mapping JAXB objects to business domain objects with Orika. Earlier this month, I covered the same mapping use case using\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#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\\\/2013\\\/12\\\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Orika: Mapping JAXB Objects to Business\\\/Domain Objects\"}]},{\"@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\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/945db7c24d37de80481570a5643f7958\",\"name\":\"Dustin Marx\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a11cce21db49686299ad9afde297b5213759b39e79a54820195cf16b842639c0?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a11cce21db49686299ad9afde297b5213759b39e79a54820195cf16b842639c0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a11cce21db49686299ad9afde297b5213759b39e79a54820195cf16b842639c0?s=96&d=mm&r=g\",\"caption\":\"Dustin Marx\"},\"sameAs\":[\"http:\\\/\\\/marxsoftware.blogspot.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Dustin-Marx\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Orika: Mapping JAXB Objects to Business\/Domain Objects","description":"This post looks at mapping JAXB objects to business domain objects with Orika. Earlier this month, I covered the same mapping use case using","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\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html","og_locale":"en_US","og_type":"article","og_title":"Orika: Mapping JAXB Objects to Business\/Domain Objects","og_description":"This post looks at mapping JAXB objects to business domain objects with Orika. Earlier this month, I covered the same mapping use case using","og_url":"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-12-27T14:00:46+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Dustin Marx","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Dustin Marx","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html"},"author":{"name":"Dustin Marx","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/945db7c24d37de80481570a5643f7958"},"headline":"Orika: Mapping JAXB Objects to Business\/Domain Objects","datePublished":"2013-12-27T14:00:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html"},"wordCount":568,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["JAXB","Orika"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html","url":"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html","name":"Orika: Mapping JAXB Objects to Business\/Domain Objects","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2013-12-27T14:00:46+00:00","description":"This post looks at mapping JAXB objects to business domain objects with Orika. Earlier this month, I covered the same mapping use case using","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#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\/2013\/12\/orika-mapping-jaxb-objects-to-businessdomain-objects.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Orika: Mapping JAXB Objects to Business\/Domain Objects"}]},{"@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"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/945db7c24d37de80481570a5643f7958","name":"Dustin Marx","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a11cce21db49686299ad9afde297b5213759b39e79a54820195cf16b842639c0?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a11cce21db49686299ad9afde297b5213759b39e79a54820195cf16b842639c0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a11cce21db49686299ad9afde297b5213759b39e79a54820195cf16b842639c0?s=96&d=mm&r=g","caption":"Dustin Marx"},"sameAs":["http:\/\/marxsoftware.blogspot.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Dustin-Marx"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/19958","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/122"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=19958"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/19958\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=19958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=19958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=19958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}