Interface XmlFactory<T>
- Type Parameters:
T- the object type to read/write
- All Superinterfaces:
Service
- All Known Subinterfaces:
ModelXmlFactory,SettingsXmlFactory,ToolchainsXmlFactory
- All Known Implementing Classes:
DefaultModelXmlFactory,DefaultSettingsXmlFactory,DefaultToolchainsXmlFactory
Generic interface to read/write objects to/from XML.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault TfromXmlString(String xml) Simply parse the given xml string.default Tread(InputStream input) default Tread(InputStream input, boolean strict) default Tdefault Tdefault Tdefault Tread(XmlReaderRequest request) default StringtoXmlString(T content) Simply converts the given content to an xml string.voidwrite(XmlWriterRequest<T> request) default voidwrite(T content, OutputStream outputStream) default voiddefault void
-
Method Details
-
read
- Throws:
XmlReaderException
-
read
- Throws:
XmlReaderException
-
read
- Throws:
XmlReaderException
-
read
- Throws:
XmlReaderException
-
read
- Throws:
XmlReaderException
-
read
- Throws:
XmlReaderException
-
read
- Throws:
XmlReaderException
-
write
- Throws:
XmlWriterException
-
write
default void write(@Nonnull T content, @Nonnull OutputStream outputStream) throws XmlWriterException - Throws:
XmlWriterException
-
write
- Throws:
XmlWriterException
-
write
- Throws:
XmlWriterException
-
fromXmlString
Simply parse the given xml string.- Parameters:
xml- the input xml string- Returns:
- the parsed object
- Throws:
XmlReaderException- if an error occurs during the parsing- See Also:
-
toXmlString
Simply converts the given content to an xml string.- Parameters:
content- the object to convert- Returns:
- the xml string representation
- Throws:
XmlWriterException- if an error occurs during the transformation- See Also:
-