public class OpenImmoUtils extends Object
Modifier and Type | Field and Description |
---|---|
static ObjectFactory |
FACTORY
the factory for creation of JAXB objects
|
static String |
NAMESPACE
the XML target namespace of this format
|
static String |
OLD_NAMESPACE
the old XML target namespace of this format, that was used up to version
1.2
|
static String |
PACKAGE
the package, where generated JAXB classes are located
|
static OpenImmoVersion |
VERSION
the latest implemented version of this format
|
Modifier and Type | Method and Description |
---|---|
static OpenImmoDocument |
createDocument(Document doc)
Creates a
OpenImmoDocument from a Document . |
static OpenImmoDocument |
createDocument(File xmlFile)
Creates a
OpenImmoDocument from a File . |
static OpenImmoDocument |
createDocument(InputStream input)
Creates a
OpenImmoDocument from an InputStream . |
static OpenImmoDocument |
createDocument(String xmlString)
Creates a
OpenImmoDocument from a String . |
static Marshaller |
createMarshaller()
Creates a
Marshaller to write JAXB objects into XML. |
static Marshaller |
createMarshaller(String encoding,
boolean formatted)
Creates a
Marshaller to write JAXB objects into XML. |
static Unmarshaller |
createUnmarshaller()
Creates a
Unmarshaller to read JAXB objects from XML. |
static Element |
createUserDefinedSimplefield(Document doc,
String name,
String value)
Helper method to create a <user_defined_simplefield> element with a
"feldname" attribute and a string value.
|
static JAXBContext |
getContext()
Returns the
JAXBContext for this format. |
static DateFormat |
getDateFormat()
Returns the preferred date format for this format.
|
static ObjectFactory |
getFactory()
Returns the
ObjectFactory for this format. |
static void |
initContext(ClassLoader classloader)
Intializes the
JAXBContext for this format. |
static Calendar |
parseDate(String value) |
static Calendar |
parseDateTime(String value) |
static Double |
parseDecimal(String value) |
static String |
printDate(Calendar value) |
static String |
printDateTime(Calendar value) |
static String |
printDecimal(Double value) |
public static final OpenImmoVersion VERSION
public static final String NAMESPACE
public static final String OLD_NAMESPACE
public static final String PACKAGE
public static final ObjectFactory FACTORY
public static OpenImmoDocument createDocument(InputStream input) throws SAXException, IOException, ParserConfigurationException
OpenImmoDocument
from an InputStream
.input
- XML inputSAXException
- if XML is invalidIOException
- if reading failedParserConfigurationException
- if the parser is not properly configuredpublic static OpenImmoDocument createDocument(File xmlFile) throws SAXException, IOException, ParserConfigurationException
OpenImmoDocument
from a File
.xmlFile
- XML fileSAXException
- if XML is invalidIOException
- if reading failedParserConfigurationException
- if the parser is not properly configuredpublic static OpenImmoDocument createDocument(String xmlString) throws SAXException, IOException, ParserConfigurationException
OpenImmoDocument
from a String
.xmlString
- XML stringSAXException
- if XML is invalidIOException
- if reading failedParserConfigurationException
- if the parser is not properly configuredpublic static OpenImmoDocument createDocument(Document doc)
OpenImmoDocument
from a Document
.doc
- XML documentpublic static Marshaller createMarshaller() throws JAXBException
Marshaller
to write JAXB objects into XML.JAXBException
- if a problem with JAXB occuredpublic static Marshaller createMarshaller(String encoding, boolean formatted) throws JAXBException
Marshaller
to write JAXB objects into XML.encoding
- encoding of written XMLformatted
- if written XML is pretty printedJAXBException
- if a problem with JAXB occuredpublic static Unmarshaller createUnmarshaller() throws JAXBException
Unmarshaller
to read JAXB objects from XML.JAXBException
- if a problem with JAXB occuredpublic static Element createUserDefinedSimplefield(Document doc, String name, String value)
doc
- document, for which the element is createdname
- value of the "feldname" attribute in the created elementvalue
- text value of the created elementpublic static JAXBContext getContext() throws JAXBException
JAXBContext
for this format.JAXBException
- if a problem with JAXB occuredpublic static DateFormat getDateFormat()
public static ObjectFactory getFactory()
ObjectFactory
for this format.public static void initContext(ClassLoader classloader) throws JAXBException
JAXBContext
for this format.classloader
- the classloader to load the generated JAXB classes withJAXBException
- if a problem with JAXB occuredCopyright © 2015 OpenEstate. All rights reserved.