public class Kyero_3 extends XmlConverter<KyeroDocument,KyeroVersion>
Constructor and Description |
---|
Kyero_3() |
Modifier and Type | Method and Description |
---|---|
protected void |
downgradeNewBuildElements(Document doc)
Downgrade <new_build> elements to Kyero 2.1.
|
void |
downgradeToPreviousVersion(KyeroDocument doc)
Downgrade a Kyero document from version 3.
|
protected void |
downgradeTypeElements(Document doc)
Downgrade <type> elements to Kyero 2.1.
|
protected void |
downgradeUrlElements(Document doc)
Downgrade <url> elements to Kyero 2.1.
|
KyeroVersion |
getVersion()
Returns the version, that this converter is implemented for.
|
protected void |
removeCustomElements(Document doc)
Remove <custom> elements.
|
protected void |
removeEnergyRatingElements(Document doc)
Remove <energy_rating> elements.
|
protected void |
removeLocationElements(Document doc)
Remove <location> elements.
|
protected void |
removeNotesElements(Document doc)
Remove <notes> elements.
|
protected void |
removeUnsupportedLanguageElements(Document doc)
Remove elements with translations in unsupported languages.
|
protected void |
upgradeCurrencyElements(Document doc)
Upgrade <currency> elements to Kyero 3.
|
void |
upgradeFromPreviousVersion(KyeroDocument doc)
Upgrade a Kyero document to version 3.
|
protected void |
upgradeNewBuildElements(Document doc)
Upgrade <new_build> elements for Kyero 3.
|
protected void |
upgradeTypeElements(Document doc)
Upgrade <type> elements to Kyero 3.
|
protected void |
upgradeUrlElements(Document doc)
Upgrade <url> elements to Kyero 3.
|
public KyeroVersion getVersion()
XmlConverter
getVersion
in class XmlConverter<KyeroDocument,KyeroVersion>
public void downgradeToPreviousVersion(KyeroDocument doc)
downgradeToPreviousVersion
in class XmlConverter<KyeroDocument,KyeroVersion>
doc
- Kyero document in version 3public void upgradeFromPreviousVersion(KyeroDocument doc)
upgradeFromPreviousVersion
in class XmlConverter<KyeroDocument,KyeroVersion>
doc
- Kyero document in version 2.1protected void downgradeNewBuildElements(Document doc) throws org.jaxen.JaxenException
The <new_build> elements are not available in version 2.1. Instead the value "new_build" is used in the <price_freq> element.
Any <new_build> elements are removed. If its value is set to "1", then <price_freq>sale</price_freq> is convertet to <price_freq>new_build</price_freq>,
doc
- Kyero document in version 3org.jaxen.JaxenException
protected void downgradeTypeElements(Document doc) throws org.jaxen.JaxenException
The <type> elements require a <en> child element in version 2.1.
An <en> child element is created for any <type> element.
doc
- Kyero document in version 3org.jaxen.JaxenException
protected void downgradeUrlElements(Document doc) throws org.jaxen.JaxenException
The <url> elements only support a simple text value in version 2.1. Version 3 allows different URL's for different languages.
Any children of <url> elements are removed. The english URL or the first found URL is copied as simple value into the <url> element.
doc
- Kyero document in version 3org.jaxen.JaxenException
protected void removeCustomElements(Document doc) throws org.jaxen.JaxenException
Kyero 3 does not support <custom> elements in <property> and <agent>.
Any occurence of these elements is removed.
doc
- OpenImmo document in version 2.1org.jaxen.JaxenException
protected void removeEnergyRatingElements(Document doc) throws org.jaxen.JaxenException
Kyero 2.1 does not support <energy_rating> elements.
doc
- OpenImmo document in version 3org.jaxen.JaxenException
protected void removeLocationElements(Document doc) throws org.jaxen.JaxenException
Kyero 2.1 does not support <location> elements.
doc
- OpenImmo document in version 3org.jaxen.JaxenException
protected void removeNotesElements(Document doc) throws org.jaxen.JaxenException
Kyero 2.1 does not support <notes> elements.
doc
- OpenImmo document in version 3org.jaxen.JaxenException
protected void removeUnsupportedLanguageElements(Document doc) throws org.jaxen.JaxenException
Kyero 2.1 does only support translation in <title> (for images), <desc> (for properties) elements for "en", "es", "de", "nl", "fr".
doc
- OpenImmo document in version 3org.jaxen.JaxenException
protected void upgradeCurrencyElements(Document doc) throws org.jaxen.JaxenException
The <currency> only supports the values "EUR", "GBP", "USD" in version 3.
Any <currency> with an unsupported value is removed from the document.
doc
- Kyero document in version 2.1org.jaxen.JaxenException
protected void upgradeNewBuildElements(Document doc) throws org.jaxen.JaxenException
The <new_build> elements are not available in version 2.1. Instead the value "new_build" is used in the <price_freq> element.
Any occurences of <price_freq>new_build</price_freq> is replaced by <price_freq>sale</price_freq> and <new_build>1</new_build> is added to the property.
doc
- Kyero document in version 2.1org.jaxen.JaxenException
protected void upgradeTypeElements(Document doc) throws org.jaxen.JaxenException
The <type> elements do not support any child element in version 3.
Any child elements of <type> are removed. The text from the <en> child element is copied into the <type> element.
doc
- Kyero document in version 2.1org.jaxen.JaxenException
protected void upgradeUrlElements(Document doc) throws org.jaxen.JaxenException
The <url> elements only support a simple text value in version 2.1. Version 3 allows different URL's for different languages.
The simple value of <url> elements is removed and copied into the <en> child element.
doc
- Kyero document in version 2.1org.jaxen.JaxenException
Copyright © 2015 OpenEstate. All rights reserved.