Examples/src/main/java/org/openestate/io/examples/DaftIeReadingExample.java
protected static void printToConsole(DaftIeDocument doc) throws JAXBException {
        LOGGER.info("> process document in version "
                + doc.getDocumentVersion());

        Daft daft = doc.toObject();

        // process overseas rental
        if (daft.getOverseasRental() != null) {
            for (OverseasRentalAdType ad : daft.getOverseasRental().getOverseasRentalAd()) {
                // get object nr
                String objectNr = StringUtils.trimToNull(ad.getExternalId());
                if (objectNr == null) objectNr = "???";

                // get object description
                String objectInfo = StringUtils.trimToNull(ad.getDescription());
                if (objectInfo == null) objectInfo = "???";

                // print object information to console
                LOGGER.info("> found object "
                        + "'" + objectNr + "' for rent: " + objectInfo);
            }
        }

        // process overseas sales
        if (daft.getOverseasSales() != null) {
            for (OverseasSaleAdType ad : daft.getOverseasSales().getOverseasSaleAd()) {
                // get object nr
                String objectNr = StringUtils.trimToNull(ad.getExternalId());
                if (objectNr == null) objectNr = "???";

                // get object description
                String objectInfo = StringUtils.trimToNull(ad.getDescription());
                if (objectInfo == null) objectInfo = "???";

                // print object information to console
                LOGGER.info("> found object "
                        + "'" + objectNr + "' for sale: " + objectInfo);
            }
        }
    }
protected static void printToConsole(DaftIeDocument doc) throws JAXBException {
        LOGGER.info("> process document in version "
                + doc.getDocumentVersion());

        Daft daft = doc.toObject();

        // process overseas rental
        if (daft.getOverseasRental() != null) {
            for (OverseasRentalAdType ad : daft.getOverseasRental().getOverseasRentalAd()) {
                // get object nr
                String objectNr = StringUtils.trimToNull(ad.getExternalId());
                if (objectNr == null) objectNr = "???";

                // get object description
                String objectInfo = StringUtils.trimToNull(ad.getDescription());
                if (objectInfo == null) objectInfo = "???";

                // print object information to console
                LOGGER.info("> found object "
                        + "'" + objectNr + "' for rent: " + objectInfo);
            }
        }

        // process overseas sales
        if (daft.getOverseasSales() != null) {
            for (OverseasSaleAdType ad : daft.getOverseasSales().getOverseasSaleAd()) {
                // get object nr
                String objectNr = StringUtils.trimToNull(ad.getExternalId());
                if (objectNr == null) objectNr = "???";

                // get object description
                String objectInfo = StringUtils.trimToNull(ad.getDescription());
                if (objectInfo == null) objectInfo = "???";

                // print object information to console
                LOGGER.info("> found object "
                        + "'" + objectNr + "' for sale: " + objectInfo);
            }
        }
    }
Print some content of a {@link DaftIeDocument} to console.

@param doc the document to process
@throws JAXBException if XML conversion into Java objects failed