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
-
Method Summary
Modifier and TypeMethodDescriptiondefault T
fromXmlString
(String xml) Simply parse the given xml string.default T
read
(InputStream input) default T
read
(InputStream input, boolean strict) default T
default T
default T
default T
read
(XmlReaderRequest request) default String
toXmlString
(T content) Simply converts the given content to an xml string.void
write
(XmlWriterRequest<T> request) default void
write
(T content, OutputStream outputStream) default void
default 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:
-