public class KyeroDocument extends XmlConvertableDocument<Root,KyeroVersion>
Constructor and Description |
---|
KyeroDocument(Document document)
Create from a
Document . |
Modifier and Type | Method and Description |
---|---|
KyeroVersion |
getDocumentVersion()
Returns the current
XmlVersion of the contained Document . |
KyeroVersion |
getLatestVersion()
Returns the newest supported
XmlVersion for the contained
Document . |
static boolean |
isReadable(Document doc)
Checks, if a
Document is readable as a KyeroDocument . |
static KyeroDocument |
newDocument()
Creates an empty
KyeroDocument . |
static KyeroDocument |
newDocument(Root root)
Creates a
KyeroDocument from a Root object. |
void |
setDocumentVersion(KyeroVersion version)
Changes the
XmlVersion of the contained Document . |
Root |
toObject()
|
downgrade, upgrade, upgradeToLatestVersion
getDocument, isTextWrittenAsCDATA, prepareDocumentBeforeWritingToXml, setTextWrittenAsCDATA, toXml, toXml, toXml, toXml, toXml, toXml, toXmlString, toXmlString
public KyeroVersion getDocumentVersion()
XmlConvertableDocument
XmlVersion
of the contained Document
.getDocumentVersion
in class XmlConvertableDocument<Root,KyeroVersion>
public KyeroVersion getLatestVersion()
XmlConvertableDocument
XmlVersion
for the contained
Document
.getLatestVersion
in class XmlConvertableDocument<Root,KyeroVersion>
public static boolean isReadable(Document doc)
Document
is readable as a KyeroDocument
.doc
- document to checkpublic static KyeroDocument newDocument() throws ParserConfigurationException, JAXBException
KyeroDocument
.ParserConfigurationException
- if the parser is not properly configuredJAXBException
- if a problem with JAXB occuredpublic static KyeroDocument newDocument(Root root) throws ParserConfigurationException, JAXBException
KyeroDocument
from a Root
object.root
- Java object, that represents the <root> root elementParserConfigurationException
- if the parser is not properly configuredJAXBException
- if a problem with JAXB occuredpublic void setDocumentVersion(KyeroVersion version)
XmlConvertableDocument
XmlVersion
of the contained Document
.
Warning:
This function only changes the version information. It does not execute an
upgrade / downgrade. Use instead
XmlConvertableDocument.downgrade(org.openestate.io.core.XmlVersion)
,
XmlConvertableDocument.upgrade(org.openestate.io.core.XmlVersion)
,
XmlConvertableDocument.upgradeToLatestVersion()
in order to perform an upgrade / downgrade.
setDocumentVersion
in class XmlConvertableDocument<Root,KyeroVersion>
version
- new document versionpublic Root toObject() throws JAXBException
toObject
in class XmlDocument<Root>
JAXBException
- if a problem with JAXB occuredCopyright © 2015 OpenEstate. All rights reserved.