OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_4.java
@Override
    public void downgradeToPreviousVersion(OpenImmoDocument doc) {
        doc.setDocumentVersion(OpenImmoVersion.V1_2_3);

        // downgrade a feedback document
        if (doc instanceof OpenImmoFeedbackDocument) {
            try {
                this.removeFeedbackVersionElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't remove unsupported <version> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

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

        // downgrade a transfer document
        else if (doc instanceof OpenImmoTransferDocument) {
            try {
                this.removePreiseChildElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't remove unsupported children of <preise> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

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

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

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

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

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

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

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

            try {
                this.downgradeParkenElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <parken> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }
        }
    }
@Override
    public void downgradeToPreviousVersion(OpenImmoDocument doc) {
        doc.setDocumentVersion(OpenImmoVersion.V1_2_3);

        // downgrade a feedback document
        if (doc instanceof OpenImmoFeedbackDocument) {
            try {
                this.removeFeedbackVersionElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't remove unsupported <version> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

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

        // downgrade a transfer document
        else if (doc instanceof OpenImmoTransferDocument) {
            try {
                this.removePreiseChildElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't remove unsupported children of <preise> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }

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

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

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

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

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

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

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

            try {
                this.downgradeParkenElements(doc.getDocument());
            } catch (Exception ex) {
                LOGGER.error("Can't downgrade <parken> elements!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            }
        }
    }
@ Override public void downgradeToPreviousVersion ( OpenImmoDocument doc ) { doc . setDocumentVersion ( OpenImmoVersion . V1_2_3 ) ; // downgrade a feedback document if ( doc instanceof OpenImmoFeedbackDocument ) { try { this . removeFeedbackVersionElements ( doc . getDocument ( ) ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't remove unsupported <version> elements!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; } try { this . removeFeedbackInteressentChildElements ( doc . getDocument ( ) ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't remove unsupported children of <interessent> elements!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; } } // downgrade a transfer document else if ( doc instanceof OpenImmoTransferDocument ) { try { this . removePreiseChildElements ( doc . getDocument ( ) ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't remove unsupported children of <preise> elements!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; } try { this . removeWintergartenElements ( doc . getDocument ( ) ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't remove unsupported <wintergarten> elements!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; } try { this . downgradeEnergietypElements ( doc . getDocument ( ) ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't downgrade <energietyp> elements!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; } try { this . downgradeBebaubarNachElements ( doc . getDocument ( ) ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't downgrade <bebaubar_nach> elements!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; } try { this . downgradeAnhangElements ( doc . getDocument ( ) ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't downgrade <anhang> elements!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; } try { this . downgradeWohnungElements ( doc . getDocument ( ) ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't downgrade <wohnung> elements!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; } try { this . downgradeGrundstueckElements ( doc . getDocument ( ) ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't downgrade <grundstueck> elements!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; } try { this . downgradeLandUndForstwirtschaftElements ( doc . getDocument ( ) ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't downgrade <land_und_forstwirtschaft> elements!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; } try { this . downgradeParkenElements ( doc . getDocument ( ) ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't downgrade <parken> elements!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; } } }
Downgrade an OpenImmo document from version 1.2.4 to 1.2.3.

@param doc OpenImmo document in version 1.2.4
Downgrade an OpenImmo document from version 1 . 2 . 4 to 1 . 2 . 3 .