package org.openestate.io.immobiliare_it.xml;

import java.io.Serializable;
import java.math.BigInteger;
import javax.annotation.Generated;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb2_commons.lang.CopyStrategy2;
import org.jvnet.jaxb2_commons.lang.CopyTo2;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBCopyStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;

/**
 *
Java class for box complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="box">
 *   <simpleContent>
 *     <extension base="<http://www.w3.org/2001/XMLSchema>integer">
 *       <attribute name="type">
 *         <simpleType>
 *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *             <enumeration value="No"/>
 *             <enumeration value="Box"/>
 *             <enumeration value="Rimessa"/>
 *             <enumeration value="PostoAuto"/>
 *           </restriction>
 *         </simpleType>
 *       </attribute>
 *     </extension>
 *   </simpleContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "box", propOrder = {
    "value"
})
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
public class Box implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
{

    @XmlValue
    @XmlJavaTypeAdapter(Adapter2 .class)
    @XmlSchemaType(name = "integer")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    protected BigInteger value;
    @XmlAttribute(name = "type")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    protected Box.BoxType type;

    /**
     * Gets the value of the value property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public BigInteger getValue() {
        return value;
    }

    /**
     * Sets the value of the value property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public void setValue(BigInteger value) {
        this.value = value;
    }

    /**
     * Gets the value of the type property.
     *
     * @return
     *     possible object is
     *     {@link Box.BoxType }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public Box.BoxType getType() {
        return type;
    }

    /**
     * Sets the value of the type property.
     *
     * @param value
     *     allowed object is
     *     {@link Box.BoxType }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public void setType(Box.BoxType value) {
        this.type = value;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public String toString() {
        final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
        final StringBuilder buffer = new StringBuilder();
        append(null, buffer, strategy);
        return buffer.toString();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        strategy.appendStart(locator, this, buffer);
        appendFields(locator, buffer, strategy);
        strategy.appendEnd(locator, this, buffer);
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        {
            BigInteger theValue;
            theValue = this.getValue();
            strategy.appendField(locator, this, "value", buffer, theValue, (this.value!= null));
        }
        {
            Box.BoxType theType;
            theType = this.getType();
            strategy.appendField(locator, this, "type", buffer, theType, (this.type!= null));
        }
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public Object clone() {
        return copyTo(createNewInstance());
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public Object copyTo(Object target) {
        final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE;
        return copyTo(null, target, strategy);
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
        final Object draftCopy = ((target == null)?createNewInstance():target);
        if (draftCopy instanceof Box) {
            final Box copy = ((Box) draftCopy);
            {
                Boolean valueShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.value!= null));
                if (valueShouldBeCopiedAndSet == Boolean.TRUE) {
                    BigInteger sourceValue;
                    sourceValue = this.getValue();
                    BigInteger copyValue = ((BigInteger) strategy.copy(LocatorUtils.property(locator, "value", sourceValue), sourceValue, (this.value!= null)));
                    copy.setValue(copyValue);
                } else {
                    if (valueShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.value = null;
                    }
                }
            }
            {
                Boolean typeShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.type!= null));
                if (typeShouldBeCopiedAndSet == Boolean.TRUE) {
                    Box.BoxType sourceType;
                    sourceType = this.getType();
                    Box.BoxType copyType = ((Box.BoxType) strategy.copy(LocatorUtils.property(locator, "type", sourceType), sourceType, (this.type!= null)));
                    copy.setType(copyType);
                } else {
                    if (typeShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.type = null;
                    }
                }
            }
        }
        return draftCopy;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public Object createNewInstance() {
        return new Box();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
        if ((object == null)||(this.getClass()!= object.getClass())) {
            return false;
        }
        if (this == object) {
            return true;
        }
        final Box that = ((Box) object);
        {
            BigInteger lhsValue;
            lhsValue = this.getValue();
            BigInteger rhsValue;
            rhsValue = that.getValue();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue, (this.value!= null), (that.value!= null))) {
                return false;
            }
        }
        {
            Box.BoxType lhsType;
            lhsType = this.getType();
            Box.BoxType rhsType;
            rhsType = that.getType();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType, (this.type!= null), (that.type!= null))) {
                return false;
            }
        }
        return true;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public boolean equals(Object object) {
        final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE;
        return equals(null, null, object, strategy);
    }

    /**
     *
Java class for null.
     *
     *
The following schema fragment specifies the expected content contained within this class.
     *

     *

     * <simpleType>
     *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
     *     <enumeration value="No"/>
     *     <enumeration value="Box"/>
     *     <enumeration value="Rimessa"/>
     *     <enumeration value="PostoAuto"/>
     *   </restriction>
     * </simpleType>
     *

     *
     */
    @XmlType(name = "")
    @XmlEnum
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    public enum BoxType {

        @XmlEnumValue("No")
        NO("No"),
        @XmlEnumValue("Box")
        BOX("Box"),
        @XmlEnumValue("Rimessa")
        RIMESSA("Rimessa"),
        @XmlEnumValue("PostoAuto")
        POSTO_AUTO("PostoAuto");
        private final String value;

        BoxType(String v) {
            value = v;
        }

        public String value() {
            return value;
        }

        public static Box.BoxType fromValue(String v) {
            for (Box.BoxType c: Box.BoxType.values()) {
                if (c.value.equals(v)) {
                    return c;
                }
            }
            throw new IllegalArgumentException(v);
        }

    }

}


package org.openestate.io.is24_xml.xml;

import java.io.Serializable;
import java.util.Calendar;
import javax.annotation.Generated;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb2_commons.lang.CopyStrategy2;
import org.jvnet.jaxb2_commons.lang.CopyTo2;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBCopyStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;

/**
 *
Java class for VersteigerungsterminTyp complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="VersteigerungsterminTyp">
 *   <simpleContent>
 *     <extension base="<http://www.w3.org/2001/XMLSchema>date">
 *       <attribute name="Wiederholungstermin" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
 *       <attribute name="Teilungsversteigerung" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
 *     </extension>
 *   </simpleContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VersteigerungsterminTyp", propOrder = {
    "value"
})
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public class VersteigerungsterminTyp implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
{

    @XmlValue
    @XmlJavaTypeAdapter(Adapter1 .class)
    @XmlSchemaType(name = "date")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    protected Calendar value;
    @XmlAttribute(name = "Wiederholungstermin")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    protected Boolean wiederholungstermin;
    @XmlAttribute(name = "Teilungsversteigerung")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    protected Boolean teilungsversteigerung;

    /**
     * Gets the value of the value property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public Calendar getValue() {
        return value;
    }

    /**
     * Sets the value of the value property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public void setValue(Calendar value) {
        this.value = value;
    }

    /**
     * Gets the value of the wiederholungstermin property.
     *
     * @return
     *     possible object is
     *     {@link Boolean }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public Boolean getWiederholungstermin() {
        if (wiederholungstermin == null) {
            return false;
        } else {
            return wiederholungstermin;
        }
    }

    /**
     * Sets the value of the wiederholungstermin property.
     *
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public void setWiederholungstermin(Boolean value) {
        this.wiederholungstermin = value;
    }

    /**
     * Gets the value of the teilungsversteigerung property.
     *
     * @return
     *     possible object is
     *     {@link Boolean }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public Boolean getTeilungsversteigerung() {
        if (teilungsversteigerung == null) {
            return false;
        } else {
            return teilungsversteigerung;
        }
    }

    /**
     * Sets the value of the teilungsversteigerung property.
     *
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public void setTeilungsversteigerung(Boolean value) {
        this.teilungsversteigerung = value;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public String toString() {
        final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
        final StringBuilder buffer = new StringBuilder();
        append(null, buffer, strategy);
        return buffer.toString();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        strategy.appendStart(locator, this, buffer);
        appendFields(locator, buffer, strategy);
        strategy.appendEnd(locator, this, buffer);
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        {
            Calendar theValue;
            theValue = this.getValue();
            strategy.appendField(locator, this, "value", buffer, theValue, (this.value!= null));
        }
        {
            Boolean theWiederholungstermin;
            theWiederholungstermin = this.getWiederholungstermin();
            strategy.appendField(locator, this, "wiederholungstermin", buffer, theWiederholungstermin, (this.wiederholungstermin!= null));
        }
        {
            Boolean theTeilungsversteigerung;
            theTeilungsversteigerung = this.getTeilungsversteigerung();
            strategy.appendField(locator, this, "teilungsversteigerung", buffer, theTeilungsversteigerung, (this.teilungsversteigerung!= null));
        }
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public Object clone() {
        return copyTo(createNewInstance());
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public Object copyTo(Object target) {
        final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE;
        return copyTo(null, target, strategy);
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
        final Object draftCopy = ((target == null)?createNewInstance():target);
        if (draftCopy instanceof VersteigerungsterminTyp) {
            final VersteigerungsterminTyp copy = ((VersteigerungsterminTyp) draftCopy);
            {
                Boolean valueShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.value!= null));
                if (valueShouldBeCopiedAndSet == Boolean.TRUE) {
                    Calendar sourceValue;
                    sourceValue = this.getValue();
                    Calendar copyValue = ((Calendar) strategy.copy(LocatorUtils.property(locator, "value", sourceValue), sourceValue, (this.value!= null)));
                    copy.setValue(copyValue);
                } else {
                    if (valueShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.value = null;
                    }
                }
            }
            {
                Boolean wiederholungsterminShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.wiederholungstermin!= null));
                if (wiederholungsterminShouldBeCopiedAndSet == Boolean.TRUE) {
                    Boolean sourceWiederholungstermin;
                    sourceWiederholungstermin = this.getWiederholungstermin();
                    Boolean copyWiederholungstermin = ((Boolean) strategy.copy(LocatorUtils.property(locator, "wiederholungstermin", sourceWiederholungstermin), sourceWiederholungstermin, (this.wiederholungstermin!= null)));
                    copy.setWiederholungstermin(copyWiederholungstermin);
                } else {
                    if (wiederholungsterminShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.wiederholungstermin = null;
                    }
                }
            }
            {
                Boolean teilungsversteigerungShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.teilungsversteigerung!= null));
                if (teilungsversteigerungShouldBeCopiedAndSet == Boolean.TRUE) {
                    Boolean sourceTeilungsversteigerung;
                    sourceTeilungsversteigerung = this.getTeilungsversteigerung();
                    Boolean copyTeilungsversteigerung = ((Boolean) strategy.copy(LocatorUtils.property(locator, "teilungsversteigerung", sourceTeilungsversteigerung), sourceTeilungsversteigerung, (this.teilungsversteigerung!= null)));
                    copy.setTeilungsversteigerung(copyTeilungsversteigerung);
                } else {
                    if (teilungsversteigerungShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.teilungsversteigerung = null;
                    }
                }
            }
        }
        return draftCopy;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public Object createNewInstance() {
        return new VersteigerungsterminTyp();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
        if ((object == null)||(this.getClass()!= object.getClass())) {
            return false;
        }
        if (this == object) {
            return true;
        }
        final VersteigerungsterminTyp that = ((VersteigerungsterminTyp) object);
        {
            Calendar lhsValue;
            lhsValue = this.getValue();
            Calendar rhsValue;
            rhsValue = that.getValue();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue, (this.value!= null), (that.value!= null))) {
                return false;
            }
        }
        {
            Boolean lhsWiederholungstermin;
            lhsWiederholungstermin = this.getWiederholungstermin();
            Boolean rhsWiederholungstermin;
            rhsWiederholungstermin = that.getWiederholungstermin();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "wiederholungstermin", lhsWiederholungstermin), LocatorUtils.property(thatLocator, "wiederholungstermin", rhsWiederholungstermin), lhsWiederholungstermin, rhsWiederholungstermin, (this.wiederholungstermin!= null), (that.wiederholungstermin!= null))) {
                return false;
            }
        }
        {
            Boolean lhsTeilungsversteigerung;
            lhsTeilungsversteigerung = this.getTeilungsversteigerung();
            Boolean rhsTeilungsversteigerung;
            rhsTeilungsversteigerung = that.getTeilungsversteigerung();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "teilungsversteigerung", lhsTeilungsversteigerung), LocatorUtils.property(thatLocator, "teilungsversteigerung", rhsTeilungsversteigerung), lhsTeilungsversteigerung, rhsTeilungsversteigerung, (this.teilungsversteigerung!= null), (that.teilungsversteigerung!= null))) {
                return false;
            }
        }
        return true;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public boolean equals(Object object) {
        final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE;
        return equals(null, null, object, strategy);
    }

}


package org.openestate.io.is24_xml.xml;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.annotation.Generated;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb2_commons.lang.CopyStrategy2;
import org.jvnet.jaxb2_commons.lang.CopyTo2;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBCopyStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;

/**
 *
Java class for VermarktungGrundstueckWohnenKaufTyp complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="VermarktungGrundstueckWohnenKaufTyp">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <choice>
 *         <element name="Kauf">
 *           <complexType>
 *             <complexContent>
 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *               </restriction>
 *             </complexContent>
 *           </complexType>
 *         </element>
 *         <element name="Erbpacht">
 *           <complexType>
 *             <complexContent>
 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 <attribute name="DauerInJahren" use="required" type="{http://www.immobilienscout24.de/immobilientransfer}Zahl3Typ" />
 *               </restriction>
 *             </complexContent>
 *           </complexType>
 *         </element>
 *       </choice>
 *       <attribute name="Preis" use="required" type="{http://www.immobilienscout24.de/immobilientransfer}PreisAufAnfrage" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VermarktungGrundstueckWohnenKaufTyp", propOrder = {
    "kauf",
    "erbpacht"
})
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public class VermarktungGrundstueckWohnenKaufTyp implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
{

    @XmlElementRef(name = "Kauf", namespace = "http://www.immobilienscout24.de/immobilientransfer", type = JAXBElement.class, required = false)
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    protected JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Kauf> kauf;
    @XmlElementRef(name = "Erbpacht", namespace = "http://www.immobilienscout24.de/immobilientransfer", type = JAXBElement.class, required = false)
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    protected JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Erbpacht> erbpacht;
    @XmlAttribute(name = "Preis", required = true)
    @XmlJavaTypeAdapter(Adapter36 .class)
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    protected BigDecimal preis;

    /**
     * Gets the value of the kauf property.
     *
     * @return
     *     possible object is
     *     {@link JAXBElement }{@code <}{@link VermarktungGrundstueckWohnenKaufTyp.Kauf }{@code >}
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Kauf> getKauf() {
        return kauf;
    }

    /**
     * Sets the value of the kauf property.
     *
     * @param value
     *     allowed object is
     *     {@link JAXBElement }{@code <}{@link VermarktungGrundstueckWohnenKaufTyp.Kauf }{@code >}
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public void setKauf(JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Kauf> value) {
        this.kauf = value;
    }

    /**
     * Gets the value of the erbpacht property.
     *
     * @return
     *     possible object is
     *     {@link JAXBElement }{@code <}{@link VermarktungGrundstueckWohnenKaufTyp.Erbpacht }{@code >}
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Erbpacht> getErbpacht() {
        return erbpacht;
    }

    /**
     * Sets the value of the erbpacht property.
     *
     * @param value
     *     allowed object is
     *     {@link JAXBElement }{@code <}{@link VermarktungGrundstueckWohnenKaufTyp.Erbpacht }{@code >}
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public void setErbpacht(JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Erbpacht> value) {
        this.erbpacht = value;
    }

    /**
     * Gets the value of the preis property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public BigDecimal getPreis() {
        return preis;
    }

    /**
     * Sets the value of the preis property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public void setPreis(BigDecimal value) {
        this.preis = value;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public String toString() {
        final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
        final StringBuilder buffer = new StringBuilder();
        append(null, buffer, strategy);
        return buffer.toString();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        strategy.appendStart(locator, this, buffer);
        appendFields(locator, buffer, strategy);
        strategy.appendEnd(locator, this, buffer);
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        {
            JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Kauf> theKauf;
            theKauf = this.getKauf();
            strategy.appendField(locator, this, "kauf", buffer, theKauf, (this.kauf!= null));
        }
        {
            JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Erbpacht> theErbpacht;
            theErbpacht = this.getErbpacht();
            strategy.appendField(locator, this, "erbpacht", buffer, theErbpacht, (this.erbpacht!= null));
        }
        {
            BigDecimal thePreis;
            thePreis = this.getPreis();
            strategy.appendField(locator, this, "preis", buffer, thePreis, (this.preis!= null));
        }
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public Object clone() {
        return copyTo(createNewInstance());
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public Object copyTo(Object target) {
        final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE;
        return copyTo(null, target, strategy);
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
        final Object draftCopy = ((target == null)?createNewInstance():target);
        if (draftCopy instanceof VermarktungGrundstueckWohnenKaufTyp) {
            final VermarktungGrundstueckWohnenKaufTyp copy = ((VermarktungGrundstueckWohnenKaufTyp) draftCopy);
            {
                Boolean kaufShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.kauf!= null));
                if (kaufShouldBeCopiedAndSet == Boolean.TRUE) {
                    JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Kauf> sourceKauf;
                    sourceKauf = this.getKauf();
                    @SuppressWarnings("unchecked")
                    JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Kauf> copyKauf = ((JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Kauf> ) strategy.copy(LocatorUtils.property(locator, "kauf", sourceKauf), sourceKauf, (this.kauf!= null)));
                    copy.setKauf(copyKauf);
                } else {
                    if (kaufShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.kauf = null;
                    }
                }
            }
            {
                Boolean erbpachtShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.erbpacht!= null));
                if (erbpachtShouldBeCopiedAndSet == Boolean.TRUE) {
                    JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Erbpacht> sourceErbpacht;
                    sourceErbpacht = this.getErbpacht();
                    @SuppressWarnings("unchecked")
                    JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Erbpacht> copyErbpacht = ((JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Erbpacht> ) strategy.copy(LocatorUtils.property(locator, "erbpacht", sourceErbpacht), sourceErbpacht, (this.erbpacht!= null)));
                    copy.setErbpacht(copyErbpacht);
                } else {
                    if (erbpachtShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.erbpacht = null;
                    }
                }
            }
            {
                Boolean preisShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.preis!= null));
                if (preisShouldBeCopiedAndSet == Boolean.TRUE) {
                    BigDecimal sourcePreis;
                    sourcePreis = this.getPreis();
                    BigDecimal copyPreis = ((BigDecimal) strategy.copy(LocatorUtils.property(locator, "preis", sourcePreis), sourcePreis, (this.preis!= null)));
                    copy.setPreis(copyPreis);
                } else {
                    if (preisShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.preis = null;
                    }
                }
            }
        }
        return draftCopy;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public Object createNewInstance() {
        return new VermarktungGrundstueckWohnenKaufTyp();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
        if ((object == null)||(this.getClass()!= object.getClass())) {
            return false;
        }
        if (this == object) {
            return true;
        }
        final VermarktungGrundstueckWohnenKaufTyp that = ((VermarktungGrundstueckWohnenKaufTyp) object);
        {
            JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Kauf> lhsKauf;
            lhsKauf = this.getKauf();
            JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Kauf> rhsKauf;
            rhsKauf = that.getKauf();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "kauf", lhsKauf), LocatorUtils.property(thatLocator, "kauf", rhsKauf), lhsKauf, rhsKauf, (this.kauf!= null), (that.kauf!= null))) {
                return false;
            }
        }
        {
            JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Erbpacht> lhsErbpacht;
            lhsErbpacht = this.getErbpacht();
            JAXBElement<VermarktungGrundstueckWohnenKaufTyp.Erbpacht> rhsErbpacht;
            rhsErbpacht = that.getErbpacht();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "erbpacht", lhsErbpacht), LocatorUtils.property(thatLocator, "erbpacht", rhsErbpacht), lhsErbpacht, rhsErbpacht, (this.erbpacht!= null), (that.erbpacht!= null))) {
                return false;
            }
        }
        {
            BigDecimal lhsPreis;
            lhsPreis = this.getPreis();
            BigDecimal rhsPreis;
            rhsPreis = that.getPreis();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "preis", lhsPreis), LocatorUtils.property(thatLocator, "preis", rhsPreis), lhsPreis, rhsPreis, (this.preis!= null), (that.preis!= null))) {
                return false;
            }
        }
        return true;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public boolean equals(Object object) {
        final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE;
        return equals(null, null, object, strategy);
    }

    /**
     *
Java class for anonymous complex type.
     *
     *
The following schema fragment specifies the expected content contained within this class.
     *
     *

     * <complexType>
     *   <complexContent>
     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       <attribute name="DauerInJahren" use="required" type="{http://www.immobilienscout24.de/immobilientransfer}Zahl3Typ" />
     *     </restriction>
     *   </complexContent>
     * </complexType>
     *

     *
     *
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public static class Erbpacht implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
    {

        @XmlAttribute(name = "DauerInJahren", required = true)
        @XmlJavaTypeAdapter(Adapter21 .class)
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        protected Long dauerInJahren;

        /**
         * Gets the value of the dauerInJahren property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public Long getDauerInJahren() {
            return dauerInJahren;
        }

        /**
         * Sets the value of the dauerInJahren property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public void setDauerInJahren(Long value) {
            this.dauerInJahren = value;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public String toString() {
            final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
            final StringBuilder buffer = new StringBuilder();
            append(null, buffer, strategy);
            return buffer.toString();
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
            strategy.appendStart(locator, this, buffer);
            appendFields(locator, buffer, strategy);
            strategy.appendEnd(locator, this, buffer);
            return buffer;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
            {
                Long theDauerInJahren;
                theDauerInJahren = this.getDauerInJahren();
                strategy.appendField(locator, this, "dauerInJahren", buffer, theDauerInJahren, (this.dauerInJahren!= null));
            }
            return buffer;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public Object clone() {
            return copyTo(createNewInstance());
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public Object copyTo(Object target) {
            final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE;
            return copyTo(null, target, strategy);
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
            final Object draftCopy = ((target == null)?createNewInstance():target);
            if (draftCopy instanceof VermarktungGrundstueckWohnenKaufTyp.Erbpacht) {
                final VermarktungGrundstueckWohnenKaufTyp.Erbpacht copy = ((VermarktungGrundstueckWohnenKaufTyp.Erbpacht) draftCopy);
                {
                    Boolean dauerInJahrenShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.dauerInJahren!= null));
                    if (dauerInJahrenShouldBeCopiedAndSet == Boolean.TRUE) {
                        Long sourceDauerInJahren;
                        sourceDauerInJahren = this.getDauerInJahren();
                        Long copyDauerInJahren = ((Long) strategy.copy(LocatorUtils.property(locator, "dauerInJahren", sourceDauerInJahren), sourceDauerInJahren, (this.dauerInJahren!= null)));
                        copy.setDauerInJahren(copyDauerInJahren);
                    } else {
                        if (dauerInJahrenShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.dauerInJahren = null;
                        }
                    }
                }
            }
            return draftCopy;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public Object createNewInstance() {
            return new VermarktungGrundstueckWohnenKaufTyp.Erbpacht();
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
            if ((object == null)||(this.getClass()!= object.getClass())) {
                return false;
            }
            if (this == object) {
                return true;
            }
            final VermarktungGrundstueckWohnenKaufTyp.Erbpacht that = ((VermarktungGrundstueckWohnenKaufTyp.Erbpacht) object);
            {
                Long lhsDauerInJahren;
                lhsDauerInJahren = this.getDauerInJahren();
                Long rhsDauerInJahren;
                rhsDauerInJahren = that.getDauerInJahren();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "dauerInJahren", lhsDauerInJahren), LocatorUtils.property(thatLocator, "dauerInJahren", rhsDauerInJahren), lhsDauerInJahren, rhsDauerInJahren, (this.dauerInJahren!= null), (that.dauerInJahren!= null))) {
                    return false;
                }
            }
            return true;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public boolean equals(Object object) {
            final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE;
            return equals(null, null, object, strategy);
        }

    }

    /**
     *
Java class for anonymous complex type.
     *
     *
The following schema fragment specifies the expected content contained within this class.
     *
     *

     * <complexType>
     *   <complexContent>
     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *     </restriction>
     *   </complexContent>
     * </complexType>
     *

     *
     *
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public static class Kauf implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
    {

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public String toString() {
            final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
            final StringBuilder buffer = new StringBuilder();
            append(null, buffer, strategy);
            return buffer.toString();
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
            strategy.appendStart(locator, this, buffer);
            appendFields(locator, buffer, strategy);
            strategy.appendEnd(locator, this, buffer);
            return buffer;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
            return buffer;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public Object clone() {
            return copyTo(createNewInstance());
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public Object copyTo(Object target) {
            final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE;
            return copyTo(null, target, strategy);
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
            final Object draftCopy = ((target == null)?createNewInstance():target);
            return draftCopy;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public Object createNewInstance() {
            return new VermarktungGrundstueckWohnenKaufTyp.Kauf();
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
            if ((object == null)||(this.getClass()!= object.getClass())) {
                return false;
            }
            if (this == object) {
                return true;
            }
            return true;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        public boolean equals(Object object) {
            final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE;
            return equals(null, null, object, strategy);
        }

    }

}


/*
 * Copyright 2015-2018 OpenEstate.org.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.openestate.io.openimmo.converters;

import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.jaxen.JaxenException;
import org.openestate.io.core.XmlConverter;
import org.openestate.io.core.XmlUtils;
import org.openestate.io.openimmo.OpenImmoDocument;
import org.openestate.io.openimmo.OpenImmoTransferDocument;
import org.openestate.io.openimmo.OpenImmoVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

/**
 * Converter for version 1.2.3.
 *
 * @author Andreas Rudolph
 * @since 1.0
 */
@SuppressWarnings({"SpellCheckingInspection", "WeakerAccess"})
public class OpenImmo_1_2_3 extends XmlConverter<OpenImmoDocument, OpenImmoVersion> {
    @SuppressWarnings("unused")
    private final static Logger LOGGER = LoggerFactory.getLogger(OpenImmo_1_2_3.class);

    @Override
    public OpenImmoVersion getVersion() {
        return OpenImmoVersion.V1_2_3;
    }

    /**
     * Downgrade an OpenImmo document from version 1.2.3 to 1.2.2.
     *
     * @param doc OpenImmo document in version 1.2.3
     */
    @Override
    public void downgradeToPreviousVersion(OpenImmoDocument doc) {
        doc.setDocumentVersion(OpenImmoVersion.V1_2_2);

        if (doc instanceof OpenImmoTransferDocument) {
            try {
                this.removeEmailFeedbackElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't remove unsupported <email_feedback> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.removePreiseChildElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't remove unsupported children of <preise> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.downgradeFlaechenChildElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <flaechen> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.removeAusstattungChildElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't remove unsupported children of <ausstattung> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.removeZustandAngabenChildElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't remove unsupported children of <zustand_angaben> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.removeUserDefinedExtendElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't remove unsupported <user_defined_extend> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.downgradeParkenElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <parken> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.downgradeBadElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <bad> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.downgradeKuecheElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <kueche> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.downgradeBodenElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <boden> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.downgradeBefeuerungElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <befeuerung> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.downgradeAusrichtBalkonTerrasseElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <ausricht_balkon_terrasse> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.downgradeDachformElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <dachform> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.downgradeWohnungElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <wohnung> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.downgradeHausElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <haus> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.downgradeSonstigeElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <sonstige> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.downgradeZinshausRenditeobjektElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <zinshaus_renditeobjekt> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }
        }
    }

    /**
     * Upgrade an OpenImmo document from version 1.2.2 to 1.2.3.
     *
     * @param doc OpenImmo document in version 1.2.2
     */
    @Override
    public void upgradeFromPreviousVersion(OpenImmoDocument doc) {
        doc.setDocumentVersion(OpenImmoVersion.V1_2_3);

        if (doc instanceof OpenImmoTransferDocument) {
            try {
                this.upgradeSonstigeElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <sonstige> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

            try {
                this.upgradeZinshausRenditeobjektElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <zinshaus_renditeobjekt> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }
        }
    }

    /**
     * Downgrade <ausricht_balkon_terrasse> elements to OpenImmo 1.2.2.
     *

     * The attributes "NORDOST", "NORDWEST", "SUEDOST", "SUEDWEST" for
     * <ausricht_balkon_terrasse> elements are not available in version
     * 1.2.2.
     *

     * Any occurences of these values are replaced by the single components -
     * e.g. "NORDOST" is removed and "NORD" + "OST" is set.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeAusrichtBalkonTerrasseElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:ausricht_balkon_terrasse[@NORDOST or @NORDWEST or @SUEDOST or @SUEDWEST]",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            if (node.hasAttribute("NORDOST")) {
                String value = StringUtils.trimToEmpty(node.getAttribute("NORDOST")).toLowerCase();
                if (value.equals("1") || value.equals("true")) {
                    node.setAttribute("NORD", "true");
                    node.setAttribute("OST", "true");
                }
                node.removeAttribute("NORDOST");
            }
            if (node.hasAttribute("NORDWEST")) {
                String value = StringUtils.trimToEmpty(node.getAttribute("NORDWEST")).toLowerCase();
                if (value.equals("1") || value.equals("true")) {
                    node.setAttribute("NORD", "true");
                    node.setAttribute("WEST", "true");
                }
                node.removeAttribute("NORDWEST");
            }
            if (node.hasAttribute("SUEDOST")) {
                String value = StringUtils.trimToEmpty(node.getAttribute("SUEDOST")).toLowerCase();
                if (value.equals("1") || value.equals("true")) {
                    node.setAttribute("SUED", "true");
                    node.setAttribute("OST", "true");
                }
                node.removeAttribute("SUEDOST");
            }
            if (node.hasAttribute("SUEDWEST")) {
                String value = StringUtils.trimToEmpty(node.getAttribute("SUEDWEST")).toLowerCase();
                if (value.equals("1") || value.equals("true")) {
                    node.setAttribute("SUED", "true");
                    node.setAttribute("WEST", "true");
                }
                node.removeAttribute("SUEDWEST");
            }
        }
    }

    /**
     * Downgrade <bad> elements to OpenImmo 1.2.2.
     *

     * The attributes "BIDET", "PISSOIR" for <bad> elements are not
     * available in version 1.2.2.
     *

     * Any occurences of these values are removed.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeBadElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:bad[@BIDET or @PISSOIR]",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            node.removeAttribute("BIDET");
            node.removeAttribute("PISSOIR");
        }
    }

    /**
     * Downgrade <befeuerung> elements to OpenImmo 1.2.2.
     *

     * The attribute "PELLET" for <befeuerung> elements is not available in
     * version 1.2.2.
     *

     * Any occurences of these values are removed.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeBefeuerungElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:befeuerung[@PELLET]",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            node.removeAttribute("PELLET");
        }
    }

    /**
     * Downgrade <boden> elements to OpenImmo 1.2.2.
     *

     * The attributes "MARMOR", "TERRAKOTTA" for <boden> elements are not
     * available in version 1.2.2.
     *

     * Any occurences of these values are removed.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeBodenElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:boden[@MARMOR or @TERRAKOTTA]",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            node.removeAttribute("MARMOR");
            node.removeAttribute("TERRAKOTTA");
        }
    }

    /**
     * Downgrade <dachform> elements to OpenImmo 1.2.2.
     *

     * The attributes "FLACHDACH", "PYRAMIDENDACH" for <dachform> elements
     * are not available in version 1.2.2.
     *

     * Any occurences of these values are removed.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeDachformElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:dachform[@FLACHDACH or @PYRAMIDENDACH]",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            node.removeAttribute("FLACHDACH");
            node.removeAttribute("PYRAMIDENDACH");
        }
    }

    /**
     * Remove unsupported children from all <flaechen> elements.
     *

     * OpenImmo 1.2.2 does not support the following children for
     * <flaechen> elements: <anzahl_balkone>, <anzahl_terrassen>
     *

     * These elements are removed by this function. If
     * <anzahl_balkon_terrassen> is not already specified, the sum values of
     * <anzahl_balkone> and <anzahl_terrassen> are written into
     * <anzahl_balkon_terrassen>.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeFlaechenChildElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:flaechen",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element parentNode = (Element) item;
            boolean passedAnzahlBalkone = false;
            boolean passedAnzahlTerrassen = false;
            double sum = 0;

            List childNodes = XmlUtils.newXPath("io:anzahl_balkone", doc)
                    .selectNodes(parentNode);
            for (Object childItem : childNodes) {
                Node node = (Node) childItem;
                if (!passedAnzahlBalkone) {
                    passedAnzahlBalkone = true;
                    String value = StringUtils.trimToNull(node.getTextContent());
                    try {
                        sum += (value != null) ? Double.parseDouble(value) : 0;
                    } catch (NumberFormatException ex) {
                        LOGGER.warn("Can't parse <anzahl_balkone>" + value + "</anzahl_balkone> into a numeric value!");
                        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
                    }
                }
                parentNode.removeChild(node);
            }

            childNodes = XmlUtils.newXPath("io:anzahl_terrassen", doc)
                    .selectNodes(parentNode);
            for (Object childItem : childNodes) {
                Node node = (Node) childItem;
                if (!passedAnzahlTerrassen) {
                    passedAnzahlTerrassen = true;
                    String value = StringUtils.trimToNull(node.getTextContent());
                    try {
                        sum += (value != null) ? Double.parseDouble(value) : 0;
                    } catch (NumberFormatException ex) {
                        LOGGER.warn("Can't parse <anzahl_terrassen>" + value + "</anzahl_terrassen> into a numeric value!");
                        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
                    }
                }
                parentNode.removeChild(node);
            }

            if (sum > 0) {
                Element node = (Element) XmlUtils.newXPath("io:anzahl_balkon_terrassen", doc)
                        .selectSingleNode(parentNode);
                if (node == null) {
                    node = doc.createElementNS(StringUtils.EMPTY, "anzahl_balkon_terrassen");
                    node.setTextContent(String.valueOf(sum));
                    parentNode.appendChild(node);
                } else if (StringUtils.isBlank(node.getTextContent())) {
                    node.setTextContent(String.valueOf(sum));
                }
            }
        }
    }

    /**
     * Downgrade <haus> elements to OpenImmo 1.2.2.
     *

     * The options "APARTMENTHAUS", "BURG", "HERRENHAUS", "FINCA", "RUSTICO" for
     * the "haustyp" attribute of <haus> elements are not available in
     * version 1.2.2.
     *

     * Any occurence of these values is replaced by the "KEINE_ANGABE" value.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeHausElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart/io:haus[@haustyp]",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            String value = StringUtils.trimToNull(node.getAttribute("haustyp"));
            if ("APARTMENTHAUS".equalsIgnoreCase(value))
                node.setAttribute("haustyp", "KEINE_ANGABE");
            else if ("BURG".equalsIgnoreCase(value))
                node.setAttribute("haustyp", "KEINE_ANGABE");
            else if ("HERRENHAUS".equalsIgnoreCase(value))
                node.setAttribute("haustyp", "KEINE_ANGABE");
            else if ("FINCA".equalsIgnoreCase(value))
                node.setAttribute("haustyp", "KEINE_ANGABE");
            else if ("RUSTICO".equalsIgnoreCase(value))
                node.setAttribute("haustyp", "KEINE_ANGABE");
        }
    }

    /**
     * Downgrade <kueche> elements to OpenImmo 1.2.2.
     *

     * The attribute "PANTRY" for <kueche> elements is not available in
     * version 1.2.2.
     *

     * Any occurences of these values are removed.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeKuecheElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:kueche[@PANTRY]",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            node.removeAttribute("PANTRY");
        }
    }

    /**
     * Replace <parken> elements with <sonstige> elements.
     *

     * OpenImmo 1.2.2 does not support <parken> elements. Any occurence is
     * converted into <sonstige> elements.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeParkenElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart/io:parken",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            Element parentNode = (Element) node.getParentNode();
            parentNode.removeChild(node);

            Element newNode = doc.createElementNS(StringUtils.EMPTY, "sonstige");
            newNode.setAttribute("sonstige_typ", "PARKFLACHE");
            parentNode.appendChild(newNode);
        }
    }

    /**
     * Downgrade <sonstige> elements to OpenImmo 1.2.2.
     *

     * The option "KRANKENHAUS" for the "sonstige_typ"
     * attribute of <sonstige> elements is placed in the <haus>
     * element in version 1.2.2.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeSonstigeElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart/io:sonstige[@sonstige_typ]",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            Element parent = (Element) node.getParentNode();
            String value = StringUtils.trimToNull(node.getAttribute("sonstige_typ"));
            if ("KRANKENHAUS".equalsIgnoreCase(value)) {
                parent.removeChild(node);
                Element newNode = doc.createElementNS(StringUtils.EMPTY, "haus");
                newNode.setAttribute("haustyp", "KRANKENHAUS");
                parent.appendChild(newNode);
            }
        }
    }

    /**
     * Downgrade <wohnung> elements to OpenImmo 1.2.2.
     *

     * The options "APARTMENT", "FERIENWOHNUNG", "GALERIE" for the "wohnungtyp"
     * attribute of <wohnung> elements are not available in version 1.2.2.
     *

     * Any occurence of these values is replaced by the "KEINE_ANGABE" value.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeWohnungElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart/io:wohnung[@wohnungtyp]",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            String value = StringUtils.trimToNull(node.getAttribute("wohnungtyp"));
            if ("APARTMENT".equalsIgnoreCase(value))
                node.setAttribute("wohnungtyp", "KEINE_ANGABE");
            else if ("FERIENWOHNUNG".equalsIgnoreCase(value))
                node.setAttribute("wohnungtyp", "KEINE_ANGABE");
            else if ("GALERIE".equalsIgnoreCase(value))
                node.setAttribute("wohnungtyp", "KEINE_ANGABE");
        }
    }

    /**
     * Downgrade <zinshaus_renditeobjekt> elements to OpenImmo 1.2.2.
     *

     * The options "PFLEGEHEIM", "SANATORIUM", "SENIORENHEIM", "BETREUTES-WOHNEN"
     * for the "zins_typ" attribute of <zinshaus_renditeobjekt> elements are
     * placed in the <haus> element in version 1.2.2.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeZinshausRenditeobjektElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart/io:zinshaus_renditeobjekt[@zins_typ]",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            Element parent = (Element) node.getParentNode();
            String value = StringUtils.trimToNull(node.getAttribute("zins_typ"));
            if ("PFLEGEHEIM".equalsIgnoreCase(value)) {
                parent.removeChild(node);
                Element newNode = doc.createElementNS(StringUtils.EMPTY, "haus");
                newNode.setAttribute("haustyp", "PFLEGEHEIM");
                parent.appendChild(newNode);
            } else if ("SANATORIUM".equalsIgnoreCase(value)) {
                parent.removeChild(node);
                Element newNode = doc.createElementNS(StringUtils.EMPTY, "haus");
                newNode.setAttribute("haustyp", "SANATORIUM");
                parent.appendChild(newNode);
            } else if ("SENIORENHEIM".equalsIgnoreCase(value)) {
                parent.removeChild(node);
                Element newNode = doc.createElementNS(StringUtils.EMPTY, "haus");
                newNode.setAttribute("haustyp", "SENIORENHEIM");
                parent.appendChild(newNode);
            } else if ("BETREUTES-WOHNEN".equalsIgnoreCase(value)) {
                parent.removeChild(node);
                Element newNode = doc.createElementNS(StringUtils.EMPTY, "haus");
                newNode.setAttribute("haustyp", "BETREUTES-WOHNEN");
                parent.appendChild(newNode);
            }
        }
    }

    /**
     * Remove unsupported children from all <ausstattung> elements.
     *

     * OpenImmo 1.2.2 does not support the following children for
     * <ausstattung> elements: <energietyp>, <bibliothek>,
     * <dachboden>, <gaestewc>, <kabelkanaele>,
     * <seniorengerecht>
     *

     * These elements are removed by this function.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void removeAusstattungChildElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:energietyp | " +
                        "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:bibliothek | " +
                        "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:dachboden | " +
                        "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:gaestewc | " +
                        "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:kabelkanaele | " +
                        "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:seniorengerecht",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            Element parentNode = (Element) node.getParentNode();
            parentNode.removeChild(node);
        }
    }

    /**
     * Remove <email_feedback> elements.
     *

     * OpenImmo 1.2.2 does not support <email_feedback> elements.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void removeEmailFeedbackElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:kontaktperson/io:email_feedback",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            Element parentNode = (Element) node.getParentNode();
            parentNode.removeChild(node);
        }
    }

    /**
     * Remove unsupported children from all <preise> elements.
     *

     * OpenImmo 1.2.2 does not support the following children for
     * <preise> elements: <courtage_hinweis>,
     * <nettorendite_soll>, <nettorendite_ist>
     *

     * These elements are removed by this function.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void removePreiseChildElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:preise/io:courtage_hinweis | " +
                        "/io:openimmo/io:anbieter/io:immobilie/io:preise/io:nettorendite_soll | " +
                        "/io:openimmo/io:anbieter/io:immobilie/io:preise/io:nettorendite_ist",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            Element parentNode = (Element) node.getParentNode();
            parentNode.removeChild(node);
        }
    }

    /**
     * Remove <user_defined_extend> elements.
     *

     * OpenImmo 1.2.2 does not support <user_defined_extend> elements in
     * <freitexte> and <anhaenge> elements.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void removeUserDefinedExtendElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:freitexte/io:user_defined_extend | " +
                        "/io:openimmo/io:anbieter/io:immobilie/io:anhaenge/io:user_defined_extend",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            Element parentNode = (Element) node.getParentNode();
            parentNode.removeChild(node);
        }
    }

    /**
     * Remove unsupported children from all <zustand_angaben> elements.
     *

     * OpenImmo 1.2.2 does not support the following children for
     * <zustand_angaben> elements: <letztemodernisierung>,
     * <verkaufstatus>
     *

     * These elements are removed by this function.
     *
     * @param doc OpenImmo document in version 1.2.3
     * @throws JaxenException if xpath evaluation failed
     */
    protected void removeZustandAngabenChildElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:letztemodernisierung | " +
                        "/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:verkaufstatus",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            Element parentNode = (Element) node.getParentNode();
            parentNode.removeChild(node);
        }
    }

    /**
     * Upgrade <sonstige> elements to OpenImmo 1.2.3.
     *

     * The option "KRANKENHAUS" for the "haustyp" attribute of <haus>
     * elements is placed in the <sonstige> element in version 1.2.3.
     *
     * @param doc OpenImmo document in version 1.2.2
     * @throws JaxenException if xpath evaluation failed
     */
    protected void upgradeSonstigeElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart/io:haus[@haustyp]",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            Element parent = (Element) node.getParentNode();
            String value = StringUtils.trimToNull(node.getAttribute("haustyp"));
            if ("KRANKENHAUS".equalsIgnoreCase(value)) {
                parent.removeChild(node);
                Element newNode = doc.createElementNS(StringUtils.EMPTY, "sonstige");
                newNode.setAttribute("sonstige_typ", "KRANKENHAUS");
                parent.appendChild(newNode);
            }
        }
    }

    /**
     * Upgrade <zinshaus_renditeobjekt> elements to OpenImmo 1.2.3.
     *

     * The options "PFLEGEHEIM", "SANATORIUM", "SENIORENHEIM", "BETREUTES-WOHNEN"
     * for the "haustyp" attribute of <haus> elements are placed in the
     * <zinshaus_renditeobjekt> element in version 1.2.3.
     *
     * @param doc OpenImmo document in version 1.2.2
     * @throws JaxenException if xpath evaluation failed
     */
    protected void upgradeZinshausRenditeobjektElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:objektkategorie/io:objektart/io:haus[@haustyp]",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element node = (Element) item;
            Element parent = (Element) node.getParentNode();
            String value = StringUtils.trimToNull(node.getAttribute("haustyp"));
            if ("PFLEGEHEIM".equalsIgnoreCase(value)) {
                parent.removeChild(node);
                Element newNode = doc.createElementNS(StringUtils.EMPTY, "zinshaus_renditeobjekt");
                newNode.setAttribute("zins_typ", "PFLEGEHEIM");
                parent.appendChild(newNode);
            } else if ("SANATORIUM".equalsIgnoreCase(value)) {
                parent.removeChild(node);
                Element newNode = doc.createElementNS(StringUtils.EMPTY, "zinshaus_renditeobjekt");
                newNode.setAttribute("zins_typ", "SANATORIUM");
                parent.appendChild(newNode);
            } else if ("SENIORENHEIM".equalsIgnoreCase(value)) {
                parent.removeChild(node);
                Element newNode = doc.createElementNS(StringUtils.EMPTY, "zinshaus_renditeobjekt");
                newNode.setAttribute("zins_typ", "SENIORENHEIM");
                parent.appendChild(newNode);
            } else if ("BETREUTES-WOHNEN".equalsIgnoreCase(value)) {
                parent.removeChild(node);
                Element newNode = doc.createElementNS(StringUtils.EMPTY, "zinshaus_renditeobjekt");
                newNode.setAttribute("zins_typ", "BETREUTES-WOHNEN");
                parent.appendChild(newNode);
            }
        }
    }
}