JavaType
- the class of a (via JAXB generated) Java object, that the contained
Document
is mapped toVersionType
- the class to determine different versions of the documentpublic abstract class XmlConvertableDocument<JavaType,VersionType extends XmlVersion> extends XmlDocument<JavaType>
XmlDocument
with versioning functionality.Constructor and Description |
---|
XmlConvertableDocument(Document document) |
Modifier and Type | Method and Description |
---|---|
void |
downgrade(VersionType targetVersion)
Downgrades the contained
Document to an earlier version. |
abstract VersionType |
getDocumentVersion()
Returns the current
XmlVersion of the contained Document . |
abstract VersionType |
getLatestVersion()
Returns the newest supported
XmlVersion for the contained
Document . |
abstract void |
setDocumentVersion(VersionType version)
Changes the
XmlVersion of the contained Document . |
void |
upgrade(XmlVersion targetVersion)
Upgrades the contained
Document to a newer version. |
void |
upgradeToLatestVersion()
Upgrades the contained
Document to the newest / latest version. |
getDocument, isTextWrittenAsCDATA, prepareDocumentBeforeWritingToXml, setTextWrittenAsCDATA, toObject, toXml, toXml, toXml, toXml, toXml, toXml, toXmlString, toXmlString
public XmlConvertableDocument(Document document)
public void downgrade(VersionType targetVersion)
Document
to an earlier version.targetVersion
- the version, that the Document
is downgraded topublic abstract VersionType getDocumentVersion()
XmlVersion
of the contained Document
.public abstract VersionType getLatestVersion()
XmlVersion
for the contained
Document
.public abstract void setDocumentVersion(VersionType version)
XmlVersion
of the contained Document
.
Warning:
This function only changes the version information. It does not execute an
upgrade / downgrade. Use instead
downgrade(org.openestate.io.core.XmlVersion)
,
upgrade(org.openestate.io.core.XmlVersion)
,
upgradeToLatestVersion()
in order to perform an upgrade / downgrade.
version
- new document versionpublic void upgrade(XmlVersion targetVersion)
Document
to a newer version.targetVersion
- the version, that the Document
is upgraded topublic final void upgradeToLatestVersion()
Document
to the newest / latest version.Copyright © 2015 OpenEstate. All rights reserved.