/*
 * 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.OpenImmoUtils;
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.1.
 *
 * @author Andreas Rudolph
 * @since 1.0
 */
@SuppressWarnings({"SpellCheckingInspection", "WeakerAccess"})
public class OpenImmo_1_2_1 extends XmlConverter<OpenImmoDocument, OpenImmoVersion> {
    @SuppressWarnings("unused")
    private final static Logger LOGGER = LoggerFactory.getLogger(OpenImmo_1_2_1.class);

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

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

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

            try {
                this.downgradeEnergiepassElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <energiepass> 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.downgradeXmlNamespace(doc.getDocument());
        } catch (Exception ex) {
            LOGGER.error("Can't downgrade the XML namespace!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
        }
    }

    /**
     * Upgrade an OpenImmo document from version 1.2.0 to 1.2.1.
     *
     * @param doc OpenImmo document in version 1.2.0
     */
    @Override
    @SuppressWarnings("Duplicates")
    public void upgradeFromPreviousVersion(OpenImmoDocument doc) {
        doc.setDocumentVersion(OpenImmoVersion.V1_2_1);

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

        try {
            this.upgradeXmlNamespace(doc.getDocument());
        } catch (Exception ex) {
            LOGGER.error("Can't upgrade the XML namespace!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
        }
    }

    /**
     * Downgrade <energiepass> elements to OpenImmo 1.2.0.
     *

     * The <mitwarmwasser> child element of the <energiepass> element
     * is not available in version 1.2.0.
     *

     * The <energieverbrauchkennwert>, <endenergiebedarf> child
     * elements of the <energiepass> element are moved into
     * <energiebedarf> and <skala> in version 1.2.0.
     *
     * @param doc OpenImmo document in version 1.2.1
     * @throws JaxenException if xpath evaluation failed
     */
    protected void downgradeEnergiepassElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:energiepass",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element parentNode = (Element) item;
            boolean skalaProcessed = false;
            String artValue = XmlUtils.newXPath("io:art/text()", doc)
                    .stringValueOf(parentNode);

            List childNodes = XmlUtils.newXPath("io:mitwarmwasser", doc)
                    .selectNodes(parentNode);
            for (Object child : childNodes) {
                Node childNode = (Node) child;
                childNode.getParentNode().removeChild(childNode);
            }

            childNodes = XmlUtils.newXPath("io:energieverbrauchkennwert", doc)
                    .selectNodes(parentNode);
            for (Object childItem : childNodes) {
                Node childNode = (Node) childItem;
                String childValue = StringUtils.trimToNull(childNode.getTextContent());
                if (!skalaProcessed && "VERBRAUCH".equalsIgnoreCase(artValue) && childValue != null) {
                    skalaProcessed = true;
                    Element skalaNode = doc.createElementNS(OpenImmoUtils.OLD_NAMESPACE, "skala");
                    skalaNode.setAttribute("type", "ZAHL");
                    skalaNode.setTextContent(childValue);
                    parentNode.appendChild(skalaNode);
                }
                childNode.getParentNode().removeChild(childNode);
            }

            childNodes = XmlUtils.newXPath("io:endenergiebedarf", doc)
                    .selectNodes(parentNode);
            for (Object childItem : childNodes) {
                Node childNode = (Node) childItem;
                String childValue = StringUtils.trimToNull(childNode.getTextContent());
                if (!skalaProcessed && "BEDARF".equalsIgnoreCase(artValue) && childValue != null) {
                    skalaProcessed = true;
                    Element skalaNode = doc.createElementNS(OpenImmoUtils.OLD_NAMESPACE, "skala");
                    skalaNode.setAttribute("type", "ZAHL");
                    skalaNode.setTextContent(childValue);
                    parentNode.appendChild(skalaNode);

                    Element newNode = doc.createElementNS(OpenImmoUtils.OLD_NAMESPACE, "energiebedarf");
                    newNode.setTextContent(childValue);
                    parentNode.appendChild(newNode);
                }
                childNode.getParentNode().removeChild(childNode);
            }
        }
    }

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

     * The option "BUNGALOW" for the "haustyp" attribute of <haus>
     * elements is not available in version 1.2.0.
     *

     * Any occurence of these values is removed.
     *
     * @param doc OpenImmo document in version 1.2.1
     * @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 ("BUNGALOW".equalsIgnoreCase(value))
                node.removeAttribute("haustyp");
        }
    }

    /**
     * Downgrade XML namespace for OpenImmo 1.2.0.
     *

     * OpenImmo 1.2.0 uses the namespace URI "http://www.openimmo.de".
     *
     * @param doc OpenImmo document in version 1.2.1
     */
    protected void downgradeXmlNamespace(Document doc) {
        //System.out.println( "----------------------------" );
        //System.out.println( "DOCUMENT BEFORE CONVERSION:" );
        //DocumentUtils.write( doc, System.out );
        //System.out.println( "----------------------------" );

        XmlUtils.replaceNamespace(doc, OpenImmoUtils.OLD_NAMESPACE);

        //System.out.println( "----------------------------" );
        //System.out.println( "DOCUMENT AFTER CONVERSION:" );
        //DocumentUtils.write( doc, System.out );
        //System.out.println( "----------------------------" );
    }

    /**
     * Remove <objektart_zusatz> elements.
     *

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

    /**
     * Upgrade <energiepass> elements to OpenImmo 1.2.1.
     *

     * Make sure, that a valid value for <art> is used.
     *

     * Remove unsupported <heizwert> element.
     *

     * Replace <energiebedarf>, <skala> with
     * <energieverbrauchkennwert> or <endenergiebedarf> according to
     * the provided <art>.
     *
     * @param doc OpenImmo document in version 1.2.0
     * @throws JaxenException if xpath evaluation failed
     */
    protected void upgradeEnergiepassElements(Document doc) throws JaxenException {
        List nodes = XmlUtils.newXPath(
                "/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:energiepass",
                doc).selectNodes(doc);
        for (Object item : nodes) {
            Element parentNode = (Element) item;
            String energiebedarfValue = null;
            String skalaValue = null;

            Element artNode = (Element) XmlUtils.newXPath("io:art", doc)
                    .selectSingleNode(parentNode);
            String artValue = (artNode != null) ?
                    StringUtils.trimToNull(artNode.getTextContent()) : null;

            List childNodes = XmlUtils.newXPath("io:heizwert", doc)
                    .selectNodes(parentNode);
            for (Object childItem : childNodes) {
                Node childNode = (Node) childItem;
                childNode.getParentNode().removeChild(childNode);
            }

            childNodes = XmlUtils.newXPath("io:energiebedarf", doc)
                    .selectNodes(parentNode);
            for (Object childItem : childNodes) {
                Node childNode = (Node) childItem;
                if (energiebedarfValue == null)
                    energiebedarfValue = StringUtils.trimToNull(childNode.getTextContent());
                childNode.getParentNode().removeChild(childNode);
            }

            childNodes = XmlUtils.newXPath("io:skala", doc)
                    .selectNodes(parentNode);
            for (Object childItem : childNodes) {
                Element childNode = (Element) childItem;
                if (skalaValue == null && "ZAHL".equalsIgnoreCase(childNode.getAttribute("type")))
                    skalaValue = StringUtils.trimToNull(childNode.getTextContent());
                childNode.getParentNode().removeChild(childNode);
            }

            if (artNode != null && "VERBRAUCH".equalsIgnoreCase(artValue)) {
                artNode.setTextContent("VERBRAUCH");
                String value = skalaValue;
                if (value != null) {
                    Element newNode = doc.createElementNS(StringUtils.EMPTY, "energieverbrauchkennwert");
                    newNode.setTextContent(value);
                    parentNode.appendChild(newNode);
                }
            } else if (artNode != null && "BEDARF".equalsIgnoreCase(artValue)) {
                artNode.setTextContent("BEDARF");
                String value = (energiebedarfValue != null) ? energiebedarfValue : skalaValue;
                if (value != null) {
                    Element newNode = doc.createElementNS(StringUtils.EMPTY, "endenergiebedarf");
                    newNode.setTextContent(value);
                    parentNode.appendChild(newNode);
                }
            }
        }
    }

    /**
     * Downgrade XML namespace for OpenImmo 1.2.1.
     *

     * OpenImmo 1.2.1 uses an empty string as namespace URI.
     *
     * @param doc OpenImmo document in version 1.2.0
     */
    protected void upgradeXmlNamespace(Document doc) {
        //System.out.println( "----------------------------" );
        //System.out.println( "DOCUMENT BEFORE CONVERSION:" );
        //DocumentUtils.write( doc, System.out );
        //System.out.println( "----------------------------" );

        XmlUtils.replaceNamespace(doc, StringUtils.EMPTY);

        //System.out.println( "----------------------------" );
        //System.out.println( "DOCUMENT AFTER CONVERSION:" );
        //DocumentUtils.write( doc, System.out );
        //System.out.println( "----------------------------" );
    }
}


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.XmlElement;
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 VermarktungGewerbeTyp2 complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="VermarktungGewerbeTyp2">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <choice>
 *         <element name="Miete">
 *           <complexType>
 *             <complexContent>
 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 <attribute name="Kaution" type="{http://www.immobilienscout24.de/immobilientransfer}Text50Typ" />
 *               </restriction>
 *             </complexContent>
 *           </complexType>
 *         </element>
 *         <element name="Kauf" type="{http://www.w3.org/2001/XMLSchema}anyType"/>
 *       </choice>
 *       <attribute name="Nebenkosten" type="{http://www.immobilienscout24.de/immobilientransfer}Zahl152Typ" />
 *       <attribute name="PreisProParkflaeche" type="{http://www.immobilienscout24.de/immobilientransfer}Zahl152Typ" />
 *       <attribute name="Preis" use="required" type="{http://www.immobilienscout24.de/immobilientransfer}PreisAufAnfrage" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

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

    @XmlElement(name = "Miete")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    protected VermarktungGewerbeTyp2 .Miete miete;
    @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<Object> kauf;
    @XmlAttribute(name = "Nebenkosten")
    @XmlJavaTypeAdapter(Adapter35 .class)
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    protected BigDecimal nebenkosten;
    @XmlAttribute(name = "PreisProParkflaeche")
    @XmlJavaTypeAdapter(Adapter35 .class)
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    protected BigDecimal preisProParkflaeche;
    @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 miete property.
     *
     * @return
     *     possible object is
     *     {@link VermarktungGewerbeTyp2 .Miete }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
    public VermarktungGewerbeTyp2 .Miete getMiete() {
        return miete;
    }

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

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

    /**
     * Sets the value of the kauf property.
     *
     * @param value
     *     allowed object is
     *     {@link JAXBElement }{@code <}{@link Object }{@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<Object> value) {
        this.kauf = value;
    }

    /**
     * Gets the value of the nebenkosten 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 getNebenkosten() {
        return nebenkosten;
    }

    /**
     * Sets the value of the nebenkosten 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 setNebenkosten(BigDecimal value) {
        this.nebenkosten = value;
    }

    /**
     * Gets the value of the preisProParkflaeche 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 getPreisProParkflaeche() {
        return preisProParkflaeche;
    }

    /**
     * Sets the value of the preisProParkflaeche 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 setPreisProParkflaeche(BigDecimal value) {
        this.preisProParkflaeche = 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) {
        {
            VermarktungGewerbeTyp2 .Miete theMiete;
            theMiete = this.getMiete();
            strategy.appendField(locator, this, "miete", buffer, theMiete, (this.miete!= null));
        }
        {
            JAXBElement<Object> theKauf;
            theKauf = this.getKauf();
            strategy.appendField(locator, this, "kauf", buffer, theKauf, (this.kauf!= null));
        }
        {
            BigDecimal theNebenkosten;
            theNebenkosten = this.getNebenkosten();
            strategy.appendField(locator, this, "nebenkosten", buffer, theNebenkosten, (this.nebenkosten!= null));
        }
        {
            BigDecimal thePreisProParkflaeche;
            thePreisProParkflaeche = this.getPreisProParkflaeche();
            strategy.appendField(locator, this, "preisProParkflaeche", buffer, thePreisProParkflaeche, (this.preisProParkflaeche!= 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 VermarktungGewerbeTyp2) {
            final VermarktungGewerbeTyp2 copy = ((VermarktungGewerbeTyp2) draftCopy);
            {
                Boolean mieteShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.miete!= null));
                if (mieteShouldBeCopiedAndSet == Boolean.TRUE) {
                    VermarktungGewerbeTyp2 .Miete sourceMiete;
                    sourceMiete = this.getMiete();
                    VermarktungGewerbeTyp2 .Miete copyMiete = ((VermarktungGewerbeTyp2 .Miete) strategy.copy(LocatorUtils.property(locator, "miete", sourceMiete), sourceMiete, (this.miete!= null)));
                    copy.setMiete(copyMiete);
                } else {
                    if (mieteShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.miete = null;
                    }
                }
            }
            {
                Boolean kaufShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.kauf!= null));
                if (kaufShouldBeCopiedAndSet == Boolean.TRUE) {
                    JAXBElement<Object> sourceKauf;
                    sourceKauf = this.getKauf();
                    @SuppressWarnings("unchecked")
                    JAXBElement<Object> copyKauf = ((JAXBElement<Object> ) strategy.copy(LocatorUtils.property(locator, "kauf", sourceKauf), sourceKauf, (this.kauf!= null)));
                    copy.setKauf(copyKauf);
                } else {
                    if (kaufShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.kauf = null;
                    }
                }
            }
            {
                Boolean nebenkostenShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.nebenkosten!= null));
                if (nebenkostenShouldBeCopiedAndSet == Boolean.TRUE) {
                    BigDecimal sourceNebenkosten;
                    sourceNebenkosten = this.getNebenkosten();
                    BigDecimal copyNebenkosten = ((BigDecimal) strategy.copy(LocatorUtils.property(locator, "nebenkosten", sourceNebenkosten), sourceNebenkosten, (this.nebenkosten!= null)));
                    copy.setNebenkosten(copyNebenkosten);
                } else {
                    if (nebenkostenShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.nebenkosten = null;
                    }
                }
            }
            {
                Boolean preisProParkflaecheShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.preisProParkflaeche!= null));
                if (preisProParkflaecheShouldBeCopiedAndSet == Boolean.TRUE) {
                    BigDecimal sourcePreisProParkflaeche;
                    sourcePreisProParkflaeche = this.getPreisProParkflaeche();
                    BigDecimal copyPreisProParkflaeche = ((BigDecimal) strategy.copy(LocatorUtils.property(locator, "preisProParkflaeche", sourcePreisProParkflaeche), sourcePreisProParkflaeche, (this.preisProParkflaeche!= null)));
                    copy.setPreisProParkflaeche(copyPreisProParkflaeche);
                } else {
                    if (preisProParkflaecheShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.preisProParkflaeche = 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 VermarktungGewerbeTyp2();
    }

    @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 VermarktungGewerbeTyp2 that = ((VermarktungGewerbeTyp2) object);
        {
            VermarktungGewerbeTyp2 .Miete lhsMiete;
            lhsMiete = this.getMiete();
            VermarktungGewerbeTyp2 .Miete rhsMiete;
            rhsMiete = that.getMiete();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "miete", lhsMiete), LocatorUtils.property(thatLocator, "miete", rhsMiete), lhsMiete, rhsMiete, (this.miete!= null), (that.miete!= null))) {
                return false;
            }
        }
        {
            JAXBElement<Object> lhsKauf;
            lhsKauf = this.getKauf();
            JAXBElement<Object> 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;
            }
        }
        {
            BigDecimal lhsNebenkosten;
            lhsNebenkosten = this.getNebenkosten();
            BigDecimal rhsNebenkosten;
            rhsNebenkosten = that.getNebenkosten();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "nebenkosten", lhsNebenkosten), LocatorUtils.property(thatLocator, "nebenkosten", rhsNebenkosten), lhsNebenkosten, rhsNebenkosten, (this.nebenkosten!= null), (that.nebenkosten!= null))) {
                return false;
            }
        }
        {
            BigDecimal lhsPreisProParkflaeche;
            lhsPreisProParkflaeche = this.getPreisProParkflaeche();
            BigDecimal rhsPreisProParkflaeche;
            rhsPreisProParkflaeche = that.getPreisProParkflaeche();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "preisProParkflaeche", lhsPreisProParkflaeche), LocatorUtils.property(thatLocator, "preisProParkflaeche", rhsPreisProParkflaeche), lhsPreisProParkflaeche, rhsPreisProParkflaeche, (this.preisProParkflaeche!= null), (that.preisProParkflaeche!= 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="Kaution" type="{http://www.immobilienscout24.de/immobilientransfer}Text50Typ" />
     *     </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 Miete implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
    {

        @XmlAttribute(name = "Kaution")
        @XmlJavaTypeAdapter(Adapter7 .class)
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
        protected String kaution;

        /**
         * Gets the value of the kaution 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 String getKaution() {
            return kaution;
        }

        /**
         * Sets the value of the kaution 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 setKaution(String value) {
            this.kaution = 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) {
            {
                String theKaution;
                theKaution = this.getKaution();
                strategy.appendField(locator, this, "kaution", buffer, theKaution, (this.kaution!= 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 VermarktungGewerbeTyp2 .Miete) {
                final VermarktungGewerbeTyp2 .Miete copy = ((VermarktungGewerbeTyp2 .Miete) draftCopy);
                {
                    Boolean kautionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.kaution!= null));
                    if (kautionShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourceKaution;
                        sourceKaution = this.getKaution();
                        String copyKaution = ((String) strategy.copy(LocatorUtils.property(locator, "kaution", sourceKaution), sourceKaution, (this.kaution!= null)));
                        copy.setKaution(copyKaution);
                    } else {
                        if (kautionShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.kaution = 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 VermarktungGewerbeTyp2 .Miete();
        }

        @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 VermarktungGewerbeTyp2 .Miete that = ((VermarktungGewerbeTyp2 .Miete) object);
            {
                String lhsKaution;
                lhsKaution = this.getKaution();
                String rhsKaution;
                rhsKaution = that.getKaution();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "kaution", lhsKaution), LocatorUtils.property(thatLocator, "kaution", rhsKaution), lhsKaution, rhsKaution, (this.kaution!= null), (that.kaution!= 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.openimmo.xml;

import java.io.Serializable;
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.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
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 <land_und_forstwirtschaft> element.
 *
 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "land_und_forstwirtschaft")
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public class LandUndForstwirtschaft implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
{

    @XmlAttribute(name = "land_typ")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected LandUndForstwirtschaft.LandTyp landTyp;

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

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

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+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:54:50+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:54:50+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        {
            LandUndForstwirtschaft.LandTyp theLandTyp;
            theLandTyp = this.getLandTyp();
            strategy.appendField(locator, this, "landTyp", buffer, theLandTyp, (this.landTyp!= null));
        }
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+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:54:50+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:54:50+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 LandUndForstwirtschaft) {
            final LandUndForstwirtschaft copy = ((LandUndForstwirtschaft) draftCopy);
            {
                Boolean landTypShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.landTyp!= null));
                if (landTypShouldBeCopiedAndSet == Boolean.TRUE) {
                    LandUndForstwirtschaft.LandTyp sourceLandTyp;
                    sourceLandTyp = this.getLandTyp();
                    LandUndForstwirtschaft.LandTyp copyLandTyp = ((LandUndForstwirtschaft.LandTyp) strategy.copy(LocatorUtils.property(locator, "landTyp", sourceLandTyp), sourceLandTyp, (this.landTyp!= null)));
                    copy.setLandTyp(copyLandTyp);
                } else {
                    if (landTypShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.landTyp = null;
                    }
                }
            }
        }
        return draftCopy;
    }

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

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+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 LandUndForstwirtschaft that = ((LandUndForstwirtschaft) object);
        {
            LandUndForstwirtschaft.LandTyp lhsLandTyp;
            lhsLandTyp = this.getLandTyp();
            LandUndForstwirtschaft.LandTyp rhsLandTyp;
            rhsLandTyp = that.getLandTyp();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "landTyp", lhsLandTyp), LocatorUtils.property(thatLocator, "landTyp", rhsLandTyp), lhsLandTyp, rhsLandTyp, (this.landTyp!= null), (that.landTyp!= null))) {
                return false;
            }
        }
        return true;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+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 enum for land_typ attribute in <land_und_forstwirtschaft> elements.
     *
     *
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="LANDWIRTSCHAFTLICHE_BETRIEBE"/>
     *     <enumeration value="BAUERNHOF"/>
     *     <enumeration value="AUSSIEDLERHOF"/>
     *     <enumeration value="GARTENBAU"/>
     *     <enumeration value="ACKERBAU"/>
     *     <enumeration value="WEINBAU"/>
     *     <enumeration value="VIEHWIRTSCHAFT"/>
     *     <enumeration value="JAGD_UND_FORSTWIRTSCHAFT"/>
     *     <enumeration value="TEICH_UND_FISCHWIRTSCHAFT"/>
     *     <enumeration value="SCHEUNEN"/>
     *     <enumeration value="REITERHOEFE"/>
     *     <enumeration value="SONSTIGE_LANDWIRTSCHAFTSIMMOBILIEN"/>
     *     <enumeration value="ANWESEN"/>
     *     <enumeration value="JAGDREVIER"/>
     *   </restriction>
     * </simpleType>
     *

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

        LANDWIRTSCHAFTLICHE_BETRIEBE,
        BAUERNHOF,
        AUSSIEDLERHOF,
        GARTENBAU,
        ACKERBAU,
        WEINBAU,
        VIEHWIRTSCHAFT,
        JAGD_UND_FORSTWIRTSCHAFT,
        TEICH_UND_FISCHWIRTSCHAFT,
        SCHEUNEN,
        REITERHOEFE,
        SONSTIGE_LANDWIRTSCHAFTSIMMOBILIEN,
        ANWESEN,
        JAGDREVIER;

        public String value() {
            return name();
        }

        public static LandUndForstwirtschaft.LandTyp fromValue(String v) {
            return valueOf(v);
        }

    }

}


package org.openestate.io.filemaker.xml.result;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
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.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
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 MetaDataType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="MetaDataType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="FIELD" maxOccurs="unbounded" minOccurs="0">
 *           <complexType>
 *             <complexContent>
 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 <attribute name="NAME" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 *                 <attribute name="TYPE" use="required" type="{http://www.filemaker.com/fmpxmlresult}FieldType" />
 *                 <attribute name="EMPTYOK" use="required" type="{http://www.filemaker.com/fmpxmlresult}BooleanType" />
 *                 <attribute name="MAXREPEAT" use="required" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" />
 *               </restriction>
 *             </complexContent>
 *           </complexType>
 *         </element>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

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

    @XmlElement(name = "FIELD")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+02:00", comments = "JAXB RI v2.2.11")
    protected List<MetaDataType.FIELD> field;

    /**
     * Gets the value of the field property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the field property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getFIELD().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link MetaDataType.FIELD }
     *
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+02:00", comments = "JAXB RI v2.2.11")
    public List<MetaDataType.FIELD> getFIELD() {
        if (field == null) {
            field = new ArrayList<MetaDataType.FIELD>();
        }
        return this.field;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+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:42:33+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:42:33+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        {
            List<MetaDataType.FIELD> theFIELD;
            theFIELD = (((this.field!= null)&&(!this.field.isEmpty()))?this.getFIELD():null);
            strategy.appendField(locator, this, "field", buffer, theFIELD, ((this.field!= null)&&(!this.field.isEmpty())));
        }
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+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:42:33+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:42:33+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 MetaDataType) {
            final MetaDataType copy = ((MetaDataType) draftCopy);
            {
                Boolean fieldShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.field!= null)&&(!this.field.isEmpty())));
                if (fieldShouldBeCopiedAndSet == Boolean.TRUE) {
                    List<MetaDataType.FIELD> sourceFIELD;
                    sourceFIELD = (((this.field!= null)&&(!this.field.isEmpty()))?this.getFIELD():null);
                    @SuppressWarnings("unchecked")
                    List<MetaDataType.FIELD> copyFIELD = ((List<MetaDataType.FIELD> ) strategy.copy(LocatorUtils.property(locator, "field", sourceFIELD), sourceFIELD, ((this.field!= null)&&(!this.field.isEmpty()))));
                    copy.field = null;
                    if (copyFIELD!= null) {
                        List<MetaDataType.FIELD> uniqueFIELDl = copy.getFIELD();
                        uniqueFIELDl.addAll(copyFIELD);
                    }
                } else {
                    if (fieldShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.field = null;
                    }
                }
            }
        }
        return draftCopy;
    }

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

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+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 MetaDataType that = ((MetaDataType) object);
        {
            List<MetaDataType.FIELD> lhsFIELD;
            lhsFIELD = (((this.field!= null)&&(!this.field.isEmpty()))?this.getFIELD():null);
            List<MetaDataType.FIELD> rhsFIELD;
            rhsFIELD = (((that.field!= null)&&(!that.field.isEmpty()))?that.getFIELD():null);
            if (!strategy.equals(LocatorUtils.property(thisLocator, "field", lhsFIELD), LocatorUtils.property(thatLocator, "field", rhsFIELD), lhsFIELD, rhsFIELD, ((this.field!= null)&&(!this.field.isEmpty())), ((that.field!= null)&&(!that.field.isEmpty())))) {
                return false;
            }
        }
        return true;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+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="NAME" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
     *       <attribute name="TYPE" use="required" type="{http://www.filemaker.com/fmpxmlresult}FieldType" />
     *       <attribute name="EMPTYOK" use="required" type="{http://www.filemaker.com/fmpxmlresult}BooleanType" />
     *       <attribute name="MAXREPEAT" use="required" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" />
     *     </restriction>
     *   </complexContent>
     * </complexType>
     *

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

        @XmlAttribute(name = "NAME", required = true)
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+02:00", comments = "JAXB RI v2.2.11")
        protected String name;
        @XmlAttribute(name = "TYPE", required = true)
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+02:00", comments = "JAXB RI v2.2.11")
        protected FieldType type;
        @XmlAttribute(name = "EMPTYOK", required = true)
        @XmlJavaTypeAdapter(Adapter1 .class)
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+02:00", comments = "JAXB RI v2.2.11")
        protected Boolean emptyok;
        @XmlAttribute(name = "MAXREPEAT", required = true)
        @XmlSchemaType(name = "nonNegativeInteger")
        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+02:00", comments = "JAXB RI v2.2.11")
        protected BigInteger maxrepeat;

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

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

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

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

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

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

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

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

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+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:42:33+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:42:33+02:00", comments = "JAXB RI v2.2.11")
        public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
            {
                String theNAME;
                theNAME = this.getNAME();
                strategy.appendField(locator, this, "name", buffer, theNAME, (this.name!= null));
            }
            {
                FieldType theTYPE;
                theTYPE = this.getTYPE();
                strategy.appendField(locator, this, "type", buffer, theTYPE, (this.type!= null));
            }
            {
                Boolean theEMPTYOK;
                theEMPTYOK = this.getEMPTYOK();
                strategy.appendField(locator, this, "emptyok", buffer, theEMPTYOK, (this.emptyok!= null));
            }
            {
                BigInteger theMAXREPEAT;
                theMAXREPEAT = this.getMAXREPEAT();
                strategy.appendField(locator, this, "maxrepeat", buffer, theMAXREPEAT, (this.maxrepeat!= null));
            }
            return buffer;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+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:42:33+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:42:33+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 MetaDataType.FIELD) {
                final MetaDataType.FIELD copy = ((MetaDataType.FIELD) draftCopy);
                {
                    Boolean nameShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.name!= null));
                    if (nameShouldBeCopiedAndSet == Boolean.TRUE) {
                        String sourceNAME;
                        sourceNAME = this.getNAME();
                        String copyNAME = ((String) strategy.copy(LocatorUtils.property(locator, "name", sourceNAME), sourceNAME, (this.name!= null)));
                        copy.setNAME(copyNAME);
                    } else {
                        if (nameShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.name = null;
                        }
                    }
                }
                {
                    Boolean typeShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.type!= null));
                    if (typeShouldBeCopiedAndSet == Boolean.TRUE) {
                        FieldType sourceTYPE;
                        sourceTYPE = this.getTYPE();
                        FieldType copyTYPE = ((FieldType) strategy.copy(LocatorUtils.property(locator, "type", sourceTYPE), sourceTYPE, (this.type!= null)));
                        copy.setTYPE(copyTYPE);
                    } else {
                        if (typeShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.type = null;
                        }
                    }
                }
                {
                    Boolean emptyokShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.emptyok!= null));
                    if (emptyokShouldBeCopiedAndSet == Boolean.TRUE) {
                        Boolean sourceEMPTYOK;
                        sourceEMPTYOK = this.getEMPTYOK();
                        Boolean copyEMPTYOK = ((Boolean) strategy.copy(LocatorUtils.property(locator, "emptyok", sourceEMPTYOK), sourceEMPTYOK, (this.emptyok!= null)));
                        copy.setEMPTYOK(copyEMPTYOK);
                    } else {
                        if (emptyokShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.emptyok = null;
                        }
                    }
                }
                {
                    Boolean maxrepeatShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.maxrepeat!= null));
                    if (maxrepeatShouldBeCopiedAndSet == Boolean.TRUE) {
                        BigInteger sourceMAXREPEAT;
                        sourceMAXREPEAT = this.getMAXREPEAT();
                        BigInteger copyMAXREPEAT = ((BigInteger) strategy.copy(LocatorUtils.property(locator, "maxrepeat", sourceMAXREPEAT), sourceMAXREPEAT, (this.maxrepeat!= null)));
                        copy.setMAXREPEAT(copyMAXREPEAT);
                    } else {
                        if (maxrepeatShouldBeCopiedAndSet == Boolean.FALSE) {
                            copy.maxrepeat = null;
                        }
                    }
                }
            }
            return draftCopy;
        }

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

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+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 MetaDataType.FIELD that = ((MetaDataType.FIELD) object);
            {
                String lhsNAME;
                lhsNAME = this.getNAME();
                String rhsNAME;
                rhsNAME = that.getNAME();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsNAME), LocatorUtils.property(thatLocator, "name", rhsNAME), lhsNAME, rhsNAME, (this.name!= null), (that.name!= null))) {
                    return false;
                }
            }
            {
                FieldType lhsTYPE;
                lhsTYPE = this.getTYPE();
                FieldType 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;
                }
            }
            {
                Boolean lhsEMPTYOK;
                lhsEMPTYOK = this.getEMPTYOK();
                Boolean rhsEMPTYOK;
                rhsEMPTYOK = that.getEMPTYOK();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "emptyok", lhsEMPTYOK), LocatorUtils.property(thatLocator, "emptyok", rhsEMPTYOK), lhsEMPTYOK, rhsEMPTYOK, (this.emptyok!= null), (that.emptyok!= null))) {
                    return false;
                }
            }
            {
                BigInteger lhsMAXREPEAT;
                lhsMAXREPEAT = this.getMAXREPEAT();
                BigInteger rhsMAXREPEAT;
                rhsMAXREPEAT = that.getMAXREPEAT();
                if (!strategy.equals(LocatorUtils.property(thisLocator, "maxrepeat", lhsMAXREPEAT), LocatorUtils.property(thatLocator, "maxrepeat", rhsMAXREPEAT), lhsMAXREPEAT, rhsMAXREPEAT, (this.maxrepeat!= null), (that.maxrepeat!= null))) {
                    return false;
                }
            }
            return true;
        }

        @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+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.examples;

import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.URI;
import java.net.URISyntaxException;
import org.apache.commons.io.output.NullOutputStream;
import org.apache.commons.io.output.NullWriter;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.PropertyConfigurator;
import org.openestate.io.is24_xml.Is24XmlDocument;
import org.openestate.io.is24_xml.Is24XmlUtils;
import org.openestate.io.is24_xml.xml.AktionsTyp;
import org.openestate.io.is24_xml.xml.AusstattungsqualitaetsTyp;
import org.openestate.io.is24_xml.xml.BauphaseTyp;
import org.openestate.io.is24_xml.xml.EnergieausweistypTyp;
import org.openestate.io.is24_xml.xml.GenehmigungTyp;
import org.openestate.io.is24_xml.xml.HausKategorienTyp;
import org.openestate.io.is24_xml.xml.HausKauf;
import org.openestate.io.is24_xml.xml.HausMiete;
import org.openestate.io.is24_xml.xml.HeizungsartTyp;
import org.openestate.io.is24_xml.xml.ISOLaenderCodeTyp;
import org.openestate.io.is24_xml.xml.ImmobilieBaseTyp;
import org.openestate.io.is24_xml.xml.ImmobilienTransferTyp;
import org.openestate.io.is24_xml.xml.ImmobilienTransferTyp.Anbieter;
import org.openestate.io.is24_xml.xml.ObjectFactory;
import org.openestate.io.is24_xml.xml.ObjektZustandTyp;
import org.openestate.io.is24_xml.xml.StatusTyp;
import org.openestate.io.is24_xml.xml.StellplatzKategorieTyp;
import org.openestate.io.is24_xml.xml.WaehrungTyp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Example for writing IS24-XML files.
 * <p>
 * This example illustrates the programmatic creation of IS24-XML documents and
 * how they are written into XML.
 *
 * @author Andreas Rudolph
 * @since 1.0
 */
@SuppressWarnings("WeakerAccess")
public class Is24XmlWritingExample {
    @SuppressWarnings("unused")
    private final static Logger LOGGER = LoggerFactory.getLogger(Is24XmlWritingExample.class);
    private final static String PACKAGE = "/org/openestate/io/examples";
    private final static ObjectFactory FACTORY = Is24XmlUtils.getFactory();
    private final static boolean PRETTY_PRINT = true;

    /**
     * Start the example application.
     *
     * @param args command line arguments
     */
    @SuppressWarnings("Duplicates")
    public static void main(String[] args) {
        // init logging
        PropertyConfigurator.configure(
                Is24XmlWritingExample.class.getResource(PACKAGE + "/log4j.properties"));

        // create a ImmobilienTransferTyp object with some example data
        // this object corresponds to the <IS24ImmobilienTransfer> root element in XML
        ImmobilienTransferTyp transfer = FACTORY.createImmobilienTransferTyp();
        transfer.setEmailBeiFehler("test@test.org");
        transfer.setErstellerSoftware("OpenEstate-IO");
        transfer.setErstellerSoftwareVersion("1.4");
        transfer.setAnbieter(createAnbieter());

        // convert the ImmobilienTransferTyp object into a XML document
        Is24XmlDocument doc = null;
        try {
            doc = Is24XmlDocument.newDocument(transfer);
        } catch (Exception ex) {
            LOGGER.error("Can't create XML document!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }

        // write XML document into a java.io.File
        try {
            write(doc, File.createTempFile("output-", ".xml"));
        } catch (IOException ex) {
            LOGGER.error("Can't create temporary file!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }

        // write XML document into a java.io.OutputStream
        write(doc, new NullOutputStream());

        // write XML document into a java.io.Writer
        write(doc, new NullWriter());

        // write XML document into a string and send it to the console
        writeToConsole(doc);
    }

    /**
     * Create an {@link Anbieter} with some example data.
     *
     * @return created example object
     */
    protected static Anbieter createAnbieter() {
        // create an example agency
        Anbieter anbieter = FACTORY.createImmobilienTransferTypAnbieter();
        anbieter.setScoutKundenID("123456");

        // add some real estates to the agency
        anbieter.getImmobilie().add(createImmobilieHausKauf());
        anbieter.getImmobilie().add(createImmobilieHausKauf());
        anbieter.getImmobilie().add(createImmobilieHausMiete());
        anbieter.getImmobilie().add(createImmobilieHausMiete());

        return anbieter;
    }

    /**
     * Create an {@link HausKauf} with some example data.
     *
     * @return created example object
     */
    protected static HausKauf createImmobilieHausKauf() {
        // create an example real estate
        HausKauf.Type obj = FACTORY.createHausKaufType();
        initImmobilie(obj);

        obj.setAlsFerienwohnungGeeignet(RandomUtils.nextInt(0, 2) == 1);
        obj.setAnzahlBadezimmer(RandomUtils.nextLong(1, 5));
        obj.setAnzahlGaragenStellplaetze(RandomUtils.nextLong(0, 3));
        obj.setAnzahlSchlafzimmer(RandomUtils.nextLong(1, 5));
        obj.setAusstattungsqualitaet(AusstattungsqualitaetsTyp.LUXUS);
        obj.setBarrierefrei(RandomUtils.nextInt(0, 2) == 1);
        obj.setBaujahr(RandomUtils.nextLong(1900, 2010));
        obj.setBauphase(BauphaseTyp.HAUS_FERTIG_GESTELLT);
        obj.setDenkmalschutzobjekt(RandomUtils.nextInt(0, 2) == 1);
        obj.setEtagenzahl(RandomUtils.nextLong(1, 10));
        obj.setFreiAb("notes about availability");
        obj.setGaesteWC(RandomUtils.nextInt(0, 2) == 1);
        obj.setGrundstuecksFlaeche(BigDecimal.valueOf(RandomUtils.nextDouble(100, 1500)));
        obj.setHausKategorie(HausKategorienTyp.MEHRFAMILIENHAUS);
        obj.setHeizungsart(HeizungsartTyp.ETAGENHEIZUNG);
        obj.setJahrLetzteModernisierung(RandomUtils.nextLong(1980, 2000));
        obj.setKeller(RandomUtils.nextInt(0, 2) == 1);
        obj.setMitEinliegerwohnung(RandomUtils.nextInt(0, 2) == 1);
        obj.setNutzflaeche(BigDecimal.valueOf(RandomUtils.nextDouble(100, 1000)));
        obj.setObjektzustand(ObjektZustandTyp.NEUWERTIG);
        obj.setParkplatz(StellplatzKategorieTyp.TIEFGARAGE);
        obj.setRollstuhlgerecht(RandomUtils.nextInt(0, 2) == 1);
        obj.setVermietet(RandomUtils.nextInt(0, 2) == 1);
        obj.setWohnflaeche(BigDecimal.valueOf(RandomUtils.nextDouble(50, 500)));
        obj.setZimmer(BigDecimal.valueOf(RandomUtils.nextDouble(1, 10)));

        obj.setBefeuerungsArt(FACTORY.createBefeuerungsArtTyp());
        obj.getBefeuerungsArt().setOel(FACTORY.createBefeuerungsArtTypOel(Boolean.TRUE));
        obj.getBefeuerungsArt().setGas(FACTORY.createBefeuerungsArtTypGas(Boolean.TRUE));

        obj.setEnergieausweis(FACTORY.createEnergieausweisTyp());
        obj.getEnergieausweis().setEnergieausweistyp(EnergieausweistypTyp.ENERGIEVERBRAUCHSKENNWERT);
        obj.getEnergieausweis().setEnergieverbrauchskennwert(BigDecimal.valueOf(RandomUtils.nextDouble(50, 500)));
        obj.getEnergieausweis().setWarmwasserEnthalten(RandomUtils.nextInt(0, 2) == 1);

        obj.setKaufpreise(FACTORY.createVermarktungWohnKaufTyp());
        obj.getKaufpreise().setKaufpreis(BigDecimal.valueOf(RandomUtils.nextDouble(100000, 9999999)));
        obj.getKaufpreise().setMieteinnahmenProMonat(BigDecimal.valueOf(RandomUtils.nextDouble(5000, 50000)));
        obj.getKaufpreise().setStellplatzKaufpreis(BigDecimal.valueOf(RandomUtils.nextDouble(1000, 10000)));
        obj.getKaufpreise().setWohngeld(BigDecimal.valueOf(RandomUtils.nextDouble(500, 5000)));

        return FACTORY.createHausKauf(obj);
    }

    /**
     * Create an {@link HausMiete} with some example data.
     *
     * @return created example object
     */
    protected static HausMiete createImmobilieHausMiete() {
        // create an example real estate
        HausMiete.Type obj = FACTORY.createHausMieteType();
        initImmobilie(obj);

        obj.setAnzahlBadezimmer(RandomUtils.nextLong(1, 5));
        obj.setAnzahlGaragenStellplaetze(RandomUtils.nextLong(0, 3));
        obj.setAnzahlSchlafzimmer(RandomUtils.nextLong(1, 5));
        obj.setAusstattungsqualitaet(AusstattungsqualitaetsTyp.GEHOBEN);
        obj.setBarrierefrei(RandomUtils.nextInt(0, 2) == 1);
        obj.setBaujahr(RandomUtils.nextLong(1900, 2010));
        obj.setBetreutesWohnen(RandomUtils.nextInt(0, 2) == 1);
        obj.setEinbaukueche(RandomUtils.nextInt(0, 2) == 1);
        obj.setEtagenzahl(RandomUtils.nextLong(1, 10));
        obj.setFreiAb("notes about availability");
        obj.setGaesteWC(RandomUtils.nextInt(0, 2) == 1);
        obj.setGrundstuecksFlaeche(BigDecimal.valueOf(RandomUtils.nextDouble(100, 1500)));
        obj.setHausKategorie(HausKategorienTyp.EINFAMILIENHAUS);
        obj.setHaustiere(GenehmigungTyp.NACH_VEREINBARUNG);
        obj.setHeizungsart(HeizungsartTyp.ZENTRALHEIZUNG);
        obj.setJahrLetzteModernisierung(RandomUtils.nextLong(1980, 2000));
        obj.setKeller(RandomUtils.nextInt(0, 2) == 1);
        obj.setNutzflaeche(BigDecimal.valueOf(RandomUtils.nextDouble(150, 500)));
        obj.setObjektzustand(ObjektZustandTyp.GEPFLEGT);
        obj.setParkplatz(StellplatzKategorieTyp.CARPORT);
        obj.setRollstuhlgerecht(RandomUtils.nextInt(0, 2) == 1);
        obj.setWohnflaeche(BigDecimal.valueOf(RandomUtils.nextDouble(50, 300)));
        obj.setZimmer(BigDecimal.valueOf(RandomUtils.nextDouble(1, 5)));

        obj.setBefeuerungsArt(FACTORY.createBefeuerungsArtTyp());
        obj.getBefeuerungsArt().setErdwaerme(FACTORY.createBefeuerungsArtTypErdwaerme(Boolean.TRUE));
        obj.getBefeuerungsArt().setPelletheizung(FACTORY.createBefeuerungsArtTypPelletheizung(Boolean.TRUE));

        obj.setEnergieausweis(FACTORY.createEnergieausweisTyp());
        obj.getEnergieausweis().setEnergieausweistyp(EnergieausweistypTyp.ENERGIEVERBRAUCHSKENNWERT);
        obj.getEnergieausweis().setEnergieverbrauchskennwert(BigDecimal.valueOf(RandomUtils.nextDouble(50, 500)));
        obj.getEnergieausweis().setWarmwasserEnthalten(RandomUtils.nextInt(0, 2) == 1);

        obj.setMietpreise(FACTORY.createVermarktungWohnMieteTyp());
        obj.getMietpreise().setHeizkosten(BigDecimal.valueOf(RandomUtils.nextDouble(100, 500)));
        obj.getMietpreise().setHeizkostenInWarmmieteEnthalten(RandomUtils.nextInt(0, 2) == 1);
        obj.getMietpreise().setKaltmiete(BigDecimal.valueOf(RandomUtils.nextDouble(150, 1500)));
        obj.getMietpreise().setKaution("notes about deposit");
        obj.getMietpreise().setNebenkosten(BigDecimal.valueOf(RandomUtils.nextDouble(50, 500)));
        obj.getMietpreise().setStellplatzMiete(BigDecimal.valueOf(RandomUtils.nextDouble(50, 500)));
        obj.getMietpreise().setWarmmiete(BigDecimal.valueOf(RandomUtils.nextDouble(250, 2500)));

        return FACTORY.createHausMiete(obj);
    }

    @SuppressWarnings("CatchMayIgnoreException")
    protected static void initImmobilie(ImmobilieBaseTyp immobilie) {
        immobilie.setAdressdruck(RandomUtils.nextInt(0, 2) == 1);
        immobilie.setAktiveGruppen("active groups");
        immobilie.setAnbieterObjektID("123");
        immobilie.setAusstattung("notes about features");
        immobilie.setGruppierungsID(RandomUtils.nextLong(1, 9999));
        immobilie.setImportmodus(AktionsTyp.AKTUALISIEREN);
        immobilie.setLage("notes about location");
        immobilie.setObjektbeschreibung("notes about the property");
        immobilie.setProvision("commission");
        immobilie.setProvisionshinweis("notes about commission");
        immobilie.setProvisionspflichtig(RandomUtils.nextInt(0, 2) == 1);
        immobilie.setScoutObjektID(BigInteger.valueOf(456));
        immobilie.setSonstigeAngaben("further notes");
        immobilie.setStatusHP(StatusTyp.AKTIV);
        immobilie.setStatusIS24(StatusTyp.AKTIV);
        immobilie.setStatusVBM(StatusTyp.INAKTIV);
        immobilie.setUeberschrift("title of the property");
        immobilie.setWaehrung(WaehrungTyp.EUR);

        immobilie.setAdresse(FACTORY.createImmobilienAdresseTyp());
        immobilie.getAdresse().setHausnummer("1");
        immobilie.getAdresse().setInternationaleRegion("Berlin");
        immobilie.getAdresse().setLaenderkennzeichen(ISOLaenderCodeTyp.DEU);
        immobilie.getAdresse().setOrt("Berlin");
        immobilie.getAdresse().setPostleitzahl("12345");
        immobilie.getAdresse().setStrasse("name of the street");

        immobilie.setApiSuchfelder(FACTORY.createImmobilieBaseTypApiSuchfelder(FACTORY.createApiSuchfelderTyp()));
        immobilie.getApiSuchfelder().getValue().setApiSuchfeld1(FACTORY.createApiSuchfelderTypApiSuchfeld1("value1"));
        immobilie.getApiSuchfelder().getValue().setApiSuchfeld2(FACTORY.createApiSuchfelderTypApiSuchfeld2("value2"));
        immobilie.getApiSuchfelder().getValue().setApiSuchfeld3(FACTORY.createApiSuchfelderTypApiSuchfeld3("value3"));

        immobilie.setKontaktperson(FACTORY.createKontaktAdresseTyp());
        immobilie.getKontaktperson().setAnrede("addressing");
        immobilie.getKontaktperson().setEMail("tester@test.org");
        immobilie.getKontaktperson().setHausnummer("1");
        immobilie.getKontaktperson().setLaenderkennzeichen(ISOLaenderCodeTyp.DEU);
        immobilie.getKontaktperson().setMobiltelefon("030/123456");
        immobilie.getKontaktperson().setNachname("Mustermann");
        immobilie.getKontaktperson().setOrt("Berlin");
        immobilie.getKontaktperson().setPostleitzahl("13125");
        immobilie.getKontaktperson().setStrasse("name of the street");
        immobilie.getKontaktperson().setTelefax("030/123457");
        immobilie.getKontaktperson().setTelefon("030/123458");
        immobilie.getKontaktperson().setVorname("Max");
        try {
            immobilie.getKontaktperson().setHomepage(new URI("http://mywebsite.com"));
        } catch (URISyntaxException ex) {
        }

        immobilie.setManuelleGeoCodierung(FACTORY.createManuellGeoCodingTyp());
        immobilie.getManuelleGeoCodierung().setTermsRegion("name of region");
        immobilie.getManuelleGeoCodierung().setTermsStadt("name of city");
        immobilie.getManuelleGeoCodierung().setTermsStadtTeil("name of district");
    }

    /**
     * Write an {@link Is24XmlDocument} into a {@link File}.
     *
     * @param doc  the document to write
     * @param file the file, where the document is written to
     */
    @SuppressWarnings("Duplicates")
    protected static void write(Is24XmlDocument doc, File file) {
        LOGGER.info("writing document");
        try {
            doc.toXml(file, PRETTY_PRINT);
            LOGGER.info("> written to: " + file.getAbsolutePath());
        } catch (Exception ex) {
            LOGGER.error("Can't write document into a file!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }
    }

    /**
     * Write an {@link Is24XmlDocument} into an {@link OutputStream}.
     *
     * @param doc    the document to write
     * @param output the stream, where the document is written to
     */
    @SuppressWarnings("Duplicates")
    protected static void write(Is24XmlDocument doc, OutputStream output) {
        LOGGER.info("writing document");
        try {
            doc.toXml(output, PRETTY_PRINT);
            LOGGER.info("> written to a java.io.OutputStream");
        } catch (Exception ex) {
            LOGGER.error("Can't write document into an OutputStream!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }
    }

    /**
     * Write an {@link Is24XmlDocument} into a {@link Writer}.
     *
     * @param doc    the document to write
     * @param output the writer, where the document is written to
     */
    @SuppressWarnings("Duplicates")
    protected static void write(Is24XmlDocument doc, Writer output) {
        LOGGER.info("writing document");
        try {
            doc.toXml(output, PRETTY_PRINT);
            LOGGER.info("> written to a java.io.Writer");
        } catch (Exception ex) {
            LOGGER.error("Can't write document into an OutputStream!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }
    }

    /**
     * Write an {@link Is24XmlDocument} into a {@link String} and print the
     * results to the console.
     *
     * @param doc the document to write
     */
    @SuppressWarnings("Duplicates")
    protected static void writeToConsole(Is24XmlDocument doc) {
        LOGGER.info("writing document");
        try {
            String xml = doc.toXmlString(PRETTY_PRINT);
            LOGGER.info(StringUtils.repeat("-", 50)
                    + System.lineSeparator() + xml);
        } catch (Exception ex) {
            LOGGER.error("Can't write document into a string!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }
    }
}


package org.openestate.io.immobiliare_it.xml;

import javax.xml.bind.annotation.XmlRegistry;

/**
 * This object contains factory methods for each
 * Java content interface and Java element interface
 * generated in the org.openestate.io.immobiliare_it.xml package.
 * <p>An ObjectFactory allows you to programatically
 * construct new instances of the Java representation
 * for XML content. The Java representation of XML
 * content can consist of schema derived interfaces
 * and classes representing the binding of schema
 * type definitions, element declarations and model
 * groups.  Factory methods for each of these are
 * provided in this class.
 *
 */
@XmlRegistry
public class ObjectFactory {

    /**
     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.openestate.io.immobiliare_it.xml
     *
     */
    public ObjectFactory() {
    }

    /**
     * Create an instance of {@link BoxProject }
     *
     */
    public BoxProject createBoxProject() {
        return new BoxProject();
    }

    /**
     * Create an instance of {@link FloorProject }
     *
     */
    public FloorProject createFloorProject() {
        return new FloorProject();
    }

    /**
     * Create an instance of {@link Floor }
     *
     */
    public Floor createFloor() {
        return new Floor();
    }

    /**
     * Create an instance of {@link Box }
     *
     */
    public Box createBox() {
        return new Box();
    }

    /**
     * Create an instance of {@link LocationStructure }
     *
     */
    public LocationStructure createLocationStructure() {
        return new LocationStructure();
    }

    /**
     * Create an instance of {@link LocationStructure.Locality }
     *
     */
    public LocationStructure.Locality createLocationStructureLocality() {
        return new LocationStructure.Locality();
    }

    /**
     * Create an instance of {@link LocationStructure.Locality.Neighbourhood }
     *
     */
    public LocationStructure.Locality.Neighbourhood createLocationStructureLocalityNeighbourhood() {
        return new LocationStructure.Locality.Neighbourhood();
    }

    /**
     * Create an instance of {@link BusinessElement }
     *
     */
    public BusinessElement createBusinessElement() {
        return new BusinessElement();
    }

    /**
     * Create an instance of {@link Feed }
     *
     */
    public Feed createFeed() {
        return new Feed();
    }

    /**
     * Create an instance of {@link Feed.Properties }
     *
     */
    public Feed.Properties createFeedProperties() {
        return new Feed.Properties();
    }

    /**
     * Create an instance of {@link Feed.Properties.Property }
     *
     */
    public Feed.Properties.Property createFeedPropertiesProperty() {
        return new Feed.Properties.Property();
    }

    /**
     * Create an instance of {@link Feed.Projects }
     *
     */
    public Feed.Projects createFeedProjects() {
        return new Feed.Projects();
    }

    /**
     * Create an instance of {@link Feed.Projects.Project }
     *
     */
    public Feed.Projects.Project createFeedProjectsProject() {
        return new Feed.Projects.Project();
    }

    /**
     * Create an instance of {@link Feed.Projects.Project.Lots }
     *
     */
    public Feed.Projects.Project.Lots createFeedProjectsProjectLots() {
        return new Feed.Projects.Project.Lots();
    }

    /**
     * Create an instance of {@link Feed.Projects.Project.Lots.Lot }
     *
     */
    public Feed.Projects.Project.Lots.Lot createFeedProjectsProjectLotsLot() {
        return new Feed.Projects.Project.Lots.Lot();
    }

    /**
     * Create an instance of {@link Feed.Projects.Project.Agent }
     *
     */
    public Feed.Projects.Project.Agent createFeedProjectsProjectAgent() {
        return new Feed.Projects.Project.Agent();
    }

    /**
     * Create an instance of {@link Feed.Projects.Project.Agent.SalesOffice }
     *
     */
    public Feed.Projects.Project.Agent.SalesOffice createFeedProjectsProjectAgentSalesOffice() {
        return new Feed.Projects.Project.Agent.SalesOffice();
    }

    /**
     * Create an instance of {@link Feed.Metadata }
     *
     */
    public Feed.Metadata createFeedMetadata() {
        return new Feed.Metadata();
    }

    /**
     * Create an instance of {@link Publisher }
     *
     */
    public Publisher createPublisher() {
        return new Publisher();
    }

    /**
     * Create an instance of {@link TransactionType }
     *
     */
    public TransactionType createTransactionType() {
        return new TransactionType();
    }

    /**
     * Create an instance of {@link Terrains }
     *
     */
    public Terrains createTerrains() {
        return new Terrains();
    }

    /**
     * Create an instance of {@link Building }
     *
     */
    public Building createBuilding() {
        return new Building();
    }

    /**
     * Create an instance of {@link Proptype }
     *
     */
    public Proptype createProptype() {
        return new Proptype();
    }

    /**
     * Create an instance of {@link TerrainElement }
     *
     */
    public TerrainElement createTerrainElement() {
        return new TerrainElement();
    }

    /**
     * Create an instance of {@link SizeType }
     *
     */
    public SizeType createSizeType() {
        return new SizeType();
    }

    /**
     * Create an instance of {@link LandSizeType }
     *
     */
    public LandSizeType createLandSizeType() {
        return new LandSizeType();
    }

    /**
     * Create an instance of {@link PriceType }
     *
     */
    public PriceType createPriceType() {
        return new PriceType();
    }

    /**
     * Create an instance of {@link Langtxt }
     *
     */
    public Langtxt createLangtxt() {
        return new Langtxt();
    }

    /**
     * Create an instance of {@link DescriptionType }
     *
     */
    public DescriptionType createDescriptionType() {
        return new DescriptionType();
    }

    /**
     * Create an instance of {@link PictureProject }
     *
     */
    public PictureProject createPictureProject() {
        return new PictureProject();
    }

    /**
     * Create an instance of {@link PictureExtended }
     *
     */
    public PictureExtended createPictureExtended() {
        return new PictureExtended();
    }

    /**
     * Create an instance of {@link VideoProject }
     *
     */
    public VideoProject createVideoProject() {
        return new VideoProject();
    }

    /**
     * Create an instance of {@link ClassEnergyPerformance }
     *
     */
    public ClassEnergyPerformance createClassEnergyPerformance() {
        return new ClassEnergyPerformance();
    }

    /**
     * Create an instance of {@link AdditionalCostsType }
     *
     */
    public AdditionalCostsType createAdditionalCostsType() {
        return new AdditionalCostsType();
    }

    /**
     * Create an instance of {@link LocationStructure.SubAdministrativeArea }
     *
     */
    public LocationStructure.SubAdministrativeArea createLocationStructureSubAdministrativeArea() {
        return new LocationStructure.SubAdministrativeArea();
    }

    /**
     * Create an instance of {@link LocationStructure.City }
     *
     */
    public LocationStructure.City createLocationStructureCity() {
        return new LocationStructure.City();
    }

    /**
     * Create an instance of {@link LocationStructure.Locality.Thoroughfare }
     *
     */
    public LocationStructure.Locality.Thoroughfare createLocationStructureLocalityThoroughfare() {
        return new LocationStructure.Locality.Thoroughfare();
    }

    /**
     * Create an instance of {@link Feed.Properties.Property.Agent }
     *
     */
    public Feed.Properties.Property.Agent createFeedPropertiesPropertyAgent() {
        return new Feed.Properties.Property.Agent();
    }

    /**
     * Create an instance of {@link Feed.Properties.Property.Features }
     *
     */
    public Feed.Properties.Property.Features createFeedPropertiesPropertyFeatures() {
        return new Feed.Properties.Property.Features();
    }

    /**
     * Create an instance of {@link Feed.Properties.Property.ExtraFeatures }
     *
     */
    public Feed.Properties.Property.ExtraFeatures createFeedPropertiesPropertyExtraFeatures() {
        return new Feed.Properties.Property.ExtraFeatures();
    }

    /**
     * Create an instance of {@link Feed.Properties.Property.Pictures }
     *
     */
    public Feed.Properties.Property.Pictures createFeedPropertiesPropertyPictures() {
        return new Feed.Properties.Property.Pictures();
    }

    /**
     * Create an instance of {@link Feed.Properties.Property.Blueprints }
     *
     */
    public Feed.Properties.Property.Blueprints createFeedPropertiesPropertyBlueprints() {
        return new Feed.Properties.Property.Blueprints();
    }

    /**
     * Create an instance of {@link Feed.Properties.Property.Videos }
     *
     */
    public Feed.Properties.Property.Videos createFeedPropertiesPropertyVideos() {
        return new Feed.Properties.Property.Videos();
    }

    /**
     * Create an instance of {@link Feed.Projects.Project.Features }
     *
     */
    public Feed.Projects.Project.Features createFeedProjectsProjectFeatures() {
        return new Feed.Projects.Project.Features();
    }

    /**
     * Create an instance of {@link Feed.Projects.Project.Pictures }
     *
     */
    public Feed.Projects.Project.Pictures createFeedProjectsProjectPictures() {
        return new Feed.Projects.Project.Pictures();
    }

    /**
     * Create an instance of {@link Feed.Projects.Project.Videos }
     *
     */
    public Feed.Projects.Project.Videos createFeedProjectsProjectVideos() {
        return new Feed.Projects.Project.Videos();
    }

    /**
     * Create an instance of {@link Feed.Projects.Project.Lots.Lot.Pictures }
     *
     */
    public Feed.Projects.Project.Lots.Lot.Pictures createFeedProjectsProjectLotsLotPictures() {
        return new Feed.Projects.Project.Lots.Lot.Pictures();
    }

    /**
     * Create an instance of {@link Feed.Projects.Project.Agent.SalesOffice.City }
     *
     */
    public Feed.Projects.Project.Agent.SalesOffice.City createFeedProjectsProjectAgentSalesOfficeCity() {
        return new Feed.Projects.Project.Agent.SalesOffice.City();
    }

    /**
     * Create an instance of {@link Feed.Projects.Project.Agent.SalesOffice.Locality }
     *
     */
    public Feed.Projects.Project.Agent.SalesOffice.Locality createFeedProjectsProjectAgentSalesOfficeLocality() {
        return new Feed.Projects.Project.Agent.SalesOffice.Locality();
    }

    /**
     * Create an instance of {@link Feed.Metadata.Multipage }
     *
     */
    public Feed.Metadata.Multipage createFeedMetadataMultipage() {
        return new Feed.Metadata.Multipage();
    }

}